Compare commits
33 Commits
icbc-sandb
...
2.0.0.rc3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f831f4faf0 | ||
|
|
d7016b418e | ||
|
|
fd92109e2e | ||
|
|
c9679eeeac | ||
|
|
08a3c52f34 | ||
|
|
5a25006189 | ||
|
|
093d39a108 | ||
|
|
c0ded4356f | ||
|
|
8f7d543c8b | ||
|
|
67bb6041c6 | ||
|
|
78cb8dafeb | ||
|
|
d77eb50a5b | ||
|
|
aee4fa86f6 | ||
|
|
a10b57f6fc | ||
|
|
d2229e0028 | ||
|
|
80cd48b97c | ||
|
|
0e6bee4714 | ||
|
|
ae67cc53ec | ||
|
|
419cb06ff6 | ||
|
|
384ac928e3 | ||
|
|
130cd45de2 | ||
|
|
6840faa9d8 | ||
|
|
b6caecf140 | ||
|
|
fdcb1614cc | ||
|
|
88bc553213 | ||
|
|
5942c4cea4 | ||
|
|
ef34146563 | ||
|
|
1c8bc648ea | ||
|
|
144ca50fea | ||
|
|
1d2cabb048 | ||
|
|
b4334f4a5b | ||
|
|
ce44e4a05a | ||
|
|
a7024f7a8d |
27
pom.xml
27
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>springboot-parent</name>
|
||||
<description>杭州铁晟科技有限公司基础依赖</description>
|
||||
@@ -28,6 +28,7 @@
|
||||
<module>springboot-message</module>
|
||||
<module>springboot-encrypt</module>
|
||||
<module>springboot-annotation</module>
|
||||
<module>springboot-role</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
@@ -57,55 +58,61 @@
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-database</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-login</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-web</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-message</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-role</artifactId>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-ademo</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
@@ -26,6 +26,11 @@
|
||||
<artifactId>springboot-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-role</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.demo;
|
||||
|
||||
|
||||
import com.tiesheng.core.EnableTieshengWeb;
|
||||
import com.tiesheng.web.EnableTieshengWeb;
|
||||
import com.tiesheng.demo.config.DemoWebConfigurer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -13,7 +13,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
@EnableTransactionManagement
|
||||
@SpringBootApplication
|
||||
@EnableTieshengWeb(webConfigurer = DemoWebConfigurer.class)
|
||||
//@EnableEncryptConfig
|
||||
public class DemoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.tiesheng.demo.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.core.pojos.RequestUserInfo;
|
||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.web.pojos.RequestUserInfo;
|
||||
import com.tiesheng.web.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.web.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.util.config.GlobalConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.tiesheng.demo.config;
|
||||
|
||||
|
||||
import com.tiesheng.core.service.CoreConfigService;
|
||||
import com.tiesheng.core.service.CoreJobService;
|
||||
import com.tiesheng.web.service.CoreConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -14,19 +13,11 @@ import javax.annotation.PostConstruct;
|
||||
@Component
|
||||
public class TestJobConfig {
|
||||
|
||||
@Autowired
|
||||
CoreJobService coreJobService;
|
||||
@Autowired
|
||||
CoreConfigService coreConfigService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
||||
coreConfigService.refreshFunc("230328001", "demo", "辅导员统计", "辅导员责任班级,学生展示");
|
||||
|
||||
// 辅导员职位
|
||||
coreJobService.refresh("class_fdy", "辅导员", "辅导员", 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,15 +8,14 @@ import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.read.listener.ReadListener;
|
||||
import com.tiesheng.annotation.operation.OperationLog;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.service.CoreLogService;
|
||||
import com.tiesheng.core.service.CoreMessageService;
|
||||
import com.tiesheng.core.util.ProcessImportConsumer;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import com.tiesheng.web.service.CoreMessageService;
|
||||
import com.tiesheng.web.util.ProcessImportConsumer;
|
||||
import com.tiesheng.database.config.DbBackupConfig;
|
||||
import com.tiesheng.demo.pojos.PoiBean;
|
||||
import com.tiesheng.demo.pojos.TestFile;
|
||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.message.pojos.UserChannel;
|
||||
import com.tiesheng.util.config.EncryptConfig;
|
||||
@@ -28,7 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -58,7 +56,6 @@ public class TestController {
|
||||
|
||||
@RequestMapping("/index")
|
||||
public ApiResp<String> index() {
|
||||
dbBackupConfig.dbBackup();
|
||||
return ApiResp.respOK("hello world");
|
||||
}
|
||||
|
||||
@@ -94,7 +91,7 @@ public class TestController {
|
||||
public ApiResp<MessageReqResp> sendMessage() {
|
||||
|
||||
MessageReqResp reqResp = coreMessageService.send(new UserChannel("13567116463", "sms"),
|
||||
JSONUtil.createObj().putOpt("code", "123456").putOpt("template_code", "SMS_154950909"));
|
||||
JSONUtil.createObj().putOpt("action", "sms-visitor-invite"));
|
||||
|
||||
return ApiResp.respOK(reqResp);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.tiesheng.demo.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.tiesheng.message.config.aliyun.AliyunSmsHandler;
|
||||
import com.tiesheng.message.pojos.AliyunTempParam;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
public class DemoSmsHandler implements AliyunSmsHandler {
|
||||
|
||||
@Override
|
||||
public AliyunTempParam handler(JSONObject obj) {
|
||||
|
||||
String action = obj.getStr("action");
|
||||
|
||||
AliyunTempParam param = new AliyunTempParam();
|
||||
param.setSignName("智慧校园");
|
||||
|
||||
if (Objects.equals(action, "sms-visitor-invite")) {
|
||||
param.setTemplateCode("SMS_276125463");
|
||||
param.setTemplateParam(JSONUtil.createObj()
|
||||
.putOpt("date", DateUtil.today())
|
||||
);
|
||||
}
|
||||
|
||||
return param;
|
||||
}
|
||||
}
|
||||
@@ -19,10 +19,12 @@ tiesheng:
|
||||
test-map:
|
||||
"1111":
|
||||
id: "1111"
|
||||
role-id: "student_bks"
|
||||
global:
|
||||
version: 2
|
||||
host: http://localhost:8100
|
||||
aliyun:
|
||||
access-key-id: LTAI5tJtbgBCnTY5eS4SmrTf
|
||||
access-key-secret: JIHqpRUFffCHhXaJEVvWN31WcexWqG
|
||||
sign-name: 阿里云短信测试
|
||||
encrypt:
|
||||
body: false
|
||||
|
||||
@@ -9,6 +9,7 @@ spring:
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 20MB
|
||||
max-request-size: 20MB
|
||||
web:
|
||||
resources:
|
||||
static-locations: classpath:/static/,file:static/
|
||||
@@ -24,3 +25,4 @@ tiesheng:
|
||||
token:
|
||||
ignore-paths:
|
||||
- /test/index
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-database</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-login</artifactId>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.tiesheng.login.config.token;
|
||||
package com.tiesheng.login.config;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
@@ -6,8 +6,8 @@ import cn.hutool.core.util.URLUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.tiesheng.annotation.operation.OperationIgnore;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.login.pojos.CodeExtraDTO;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.login.pojos.UniqueIndexDTO;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.tiesheng.login.service;
|
||||
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.tiesheng.login.service.impl;
|
||||
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.login.service.TieshengLoginConfigurer;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-message</artifactId>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tiesheng.message.config.aliyun;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.tiesheng.message.pojos.AliyunTempParam;
|
||||
|
||||
public interface AliyunSmsHandler {
|
||||
|
||||
|
||||
/**
|
||||
* 数据处理
|
||||
*
|
||||
* @param obj
|
||||
*/
|
||||
AliyunTempParam handler(JSONObject obj);
|
||||
|
||||
}
|
||||
@@ -3,15 +3,16 @@ package com.tiesheng.message.config.aliyun;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.extra.validation.ValidationUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.tiesheng.message.pojos.AliyunTempParam;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.message.service.TieshengMessageSender;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -39,7 +40,9 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
|
||||
private String accessKeyId;
|
||||
private String accessKeySecret;
|
||||
private String signName;
|
||||
|
||||
@Autowired(required = false)
|
||||
AliyunSmsHandler aliyunSmsHandler;
|
||||
|
||||
/**
|
||||
* 特殊字符替换
|
||||
@@ -97,7 +100,16 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
String signature = specialUrlEncode(digest);
|
||||
queryMap.put("Signature", signature);
|
||||
|
||||
return HttpUtil.get(ENDPOINT + "?Signature=" + signature + sortQueryStringTmp, 10 * 1000);
|
||||
String respBody = "";
|
||||
try {
|
||||
respBody = HttpUtil.get(ENDPOINT + "?Signature=" + signature + sortQueryStringTmp, 10 * 1000);
|
||||
} catch (Exception e) {
|
||||
respBody = JSONUtil.createObj()
|
||||
.putOpt("Code", "Error")
|
||||
.putOpt("Message", "消息通道异常")
|
||||
.toString();
|
||||
}
|
||||
return respBody;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,29 +117,28 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
* 创建发送请求
|
||||
*
|
||||
* @param phoneNumbers 手机号,多个用,隔开
|
||||
* @param templateCode 短信模板
|
||||
* @param params 模板参数
|
||||
* @param tempParam 短信模板
|
||||
* @return
|
||||
*/
|
||||
public MessageReqResp sendSms(String phoneNumbers, String templateCode, JSONObject params) {
|
||||
public MessageReqResp sendSms(String phoneNumbers, AliyunTempParam tempParam) {
|
||||
|
||||
MessageReqResp reqResp = new MessageReqResp("阿里云短信");
|
||||
reqResp.setTarget(phoneNumbers);
|
||||
reqResp.setResult(1);
|
||||
reqResp.setContent(JSONUtil.createObj()
|
||||
.putOpt("PhoneNumbers", phoneNumbers)
|
||||
.putOpt("SignName", getSignName())
|
||||
.putOpt("TemplateCode", templateCode)
|
||||
.putOpt("TemplateParam", params)
|
||||
.putOpt("SignName", tempParam.getSignName())
|
||||
.putOpt("TemplateCode", tempParam.getTemplateCode())
|
||||
.putOpt("TemplateParam", tempParam.getTemplateParam())
|
||||
.toString());
|
||||
|
||||
// 业务API参数
|
||||
ConcurrentHashMap<String, String> queryMap = new ConcurrentHashMap<>();
|
||||
queryMap.put("PhoneNumbers", phoneNumbers);
|
||||
queryMap.put("SignName", getSignName());
|
||||
queryMap.put("TemplateCode", templateCode);
|
||||
if (params != null) {
|
||||
queryMap.put("TemplateParam", params.toString());
|
||||
queryMap.put("SignName", tempParam.getSignName());
|
||||
queryMap.put("TemplateCode", tempParam.getTemplateCode());
|
||||
if (tempParam.getTemplateParam() != null) {
|
||||
queryMap.put("TemplateParam", tempParam.getTemplateParam().toString());
|
||||
}
|
||||
|
||||
reqResp.setRespBody(request("SendSms", queryMap));
|
||||
@@ -146,11 +157,17 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
if (!mobile) {
|
||||
return null;
|
||||
}
|
||||
String templateCode = body.getStr("template_code");
|
||||
if (StrUtil.isEmpty(templateCode)) {
|
||||
return null;
|
||||
|
||||
if (aliyunSmsHandler == null) {
|
||||
throw new ApiException("未注册短信参数处理器");
|
||||
}
|
||||
return sendSms(user, templateCode, body);
|
||||
|
||||
AliyunTempParam tempParam = aliyunSmsHandler.handler(body);
|
||||
if (tempParam == null) {
|
||||
throw new ApiException("未配置短信参数处理器");
|
||||
}
|
||||
|
||||
return sendSms(user, tempParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,7 +177,7 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
|
||||
@Override
|
||||
public boolean support() {
|
||||
return StrUtil.isAllNotEmpty(accessKeyId, accessKeySecret, signName);
|
||||
return StrUtil.isAllNotEmpty(accessKeyId, accessKeySecret);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -183,12 +200,5 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
this.accessKeySecret = accessKeySecret;
|
||||
}
|
||||
|
||||
public String getSignName() {
|
||||
return signName;
|
||||
}
|
||||
|
||||
public void setSignName(String signName) {
|
||||
this.signName = signName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.tiesheng.message.pojos;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
public class AliyunTempParam {
|
||||
|
||||
private String signName;
|
||||
private String templateCode;
|
||||
private JSONObject templateParam;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getSignName() {
|
||||
return signName;
|
||||
}
|
||||
|
||||
public void setSignName(String signName) {
|
||||
this.signName = signName;
|
||||
}
|
||||
|
||||
public String getTemplateCode() {
|
||||
return templateCode;
|
||||
}
|
||||
|
||||
public void setTemplateCode(String templateCode) {
|
||||
this.templateCode = templateCode;
|
||||
}
|
||||
|
||||
public JSONObject getTemplateParam() {
|
||||
return templateParam;
|
||||
}
|
||||
|
||||
public void setTemplateParam(JSONObject templateParam) {
|
||||
this.templateParam = templateParam;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
|
||||
27
springboot-role/pom.xml
Normal file
27
springboot-role/pom.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-role</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,317 @@
|
||||
package com.tiesheng.role.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.role.pojos.dao.*;
|
||||
import com.tiesheng.role.pojos.dto.GroupRxUpdateDTO;
|
||||
import com.tiesheng.role.pojos.dto.MenuListDTO;
|
||||
import com.tiesheng.role.pojos.dto.OwnerMenuDTO;
|
||||
import com.tiesheng.role.pojos.dto.OwnerPointDTO;
|
||||
import com.tiesheng.role.pojos.vo.GroupTypeDTO;
|
||||
import com.tiesheng.role.pojos.vo.RoleUserPageVO;
|
||||
import com.tiesheng.role.pojos.vo.ServiceMenuVO;
|
||||
import com.tiesheng.role.service.CoreRoleService;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.IdDTO;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/role")
|
||||
public class RoleController {
|
||||
|
||||
@Resource
|
||||
CoreRoleService coreRoleService;
|
||||
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/group/list")
|
||||
public ApiResp<List<CoreRoleGroup>> groupList(@Valid GroupTypeDTO dto) {
|
||||
return ApiResp.respOK(coreRoleService.list(
|
||||
new QueryWrapper<CoreRoleGroup>()
|
||||
.eq("is_deleted", 0)
|
||||
.eq("type", dto.getType())
|
||||
.orderByAsc("sort")
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 角色编辑
|
||||
*
|
||||
* @param roleGroup
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/group/update")
|
||||
public ApiResp<String> groupUpdate(@RequestBody CoreRoleGroup roleGroup) {
|
||||
|
||||
if (StrUtil.isNotEmpty(roleGroup.getId())) {
|
||||
roleGroup.setType(null);
|
||||
roleGroup.setIsSystem(null);
|
||||
}
|
||||
|
||||
coreRoleService.saveOrUpdate(roleGroup);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 角色-删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/group/deleted")
|
||||
public ApiResp<String> groupDeleted(@RequestBody @Valid IdDTO dto) {
|
||||
|
||||
CoreRoleGroup byId = coreRoleService.getById(dto.getId());
|
||||
if (byId == null || byId.getIsDeleted() != 0) {
|
||||
throw new ApiException("角色不存在或已删除");
|
||||
}
|
||||
|
||||
if (byId.getIsSystem() == 1) {
|
||||
throw new ApiException(StrUtil.format("该{}无法删除",
|
||||
Objects.equals(byId.getType(), "role") ? "角色" : "职位"));
|
||||
}
|
||||
|
||||
CoreRoleGroup coreServiceMenu = new CoreRoleGroup();
|
||||
coreServiceMenu.setId(dto.getId());
|
||||
coreServiceMenu.setIsDeleted(1);
|
||||
coreRoleService.updateById(coreServiceMenu);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取角色的权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/group/rx/list")
|
||||
public ApiResp<List<CoreRoleGroupRx>> groupRxList(@Valid IdDTO dto) {
|
||||
List<CoreRoleGroupRx> list = coreRoleService.getGroupRxMapper().selectList(new QueryWrapper<CoreRoleGroupRx>()
|
||||
.eq(CoreRoleGroupRx.IS_DELETED, 0)
|
||||
.eq("group_id", dto.getId())
|
||||
);
|
||||
return ApiResp.respOK(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 橘色的权限编辑
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/group/rx/update")
|
||||
public ApiResp<String> groupRxUpdate(@RequestBody @Valid GroupRxUpdateDTO dto) {
|
||||
coreRoleService.updateGroupRx(dto);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 授权列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/user/page")
|
||||
public ApiResp<List<RoleUserPageVO>> userPage(PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreRoleUser> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("cru.is_deleted", 0);
|
||||
dto.likeColumns(queryWrapper, "cru.ext1", "cru.ext2", "cru.ext3");
|
||||
queryWrapper.orderByAsc("cru.user_id");
|
||||
|
||||
Page<RoleUserPageVO> page = dto.pageObj();
|
||||
coreRoleService.getUserMapper().page(page, queryWrapper);
|
||||
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 授权调整
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/user/update")
|
||||
public ApiResp<String> userUpdate(@RequestBody CoreRoleUser roleUser) {
|
||||
if (StrUtil.isNotEmpty(roleUser.getId())) {
|
||||
coreRoleService.getUserMapper().updateById(roleUser);
|
||||
} else {
|
||||
coreRoleService.getUserMapper().insert(roleUser);
|
||||
}
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 授权-删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/user/deleted")
|
||||
public ApiResp<String> userDeleted(@RequestBody @Valid IdDTO dto) {
|
||||
CoreRoleUser coreRoleUser = new CoreRoleUser();
|
||||
coreRoleUser.setId(dto.getId());
|
||||
coreRoleUser.setIsDeleted(1);
|
||||
coreRoleService.getUserMapper().updateById(coreRoleUser);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取服务列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/server/list")
|
||||
public ApiResp<List<CoreRoleServer>> list() {
|
||||
return ApiResp.respOK(coreRoleService.getServerMapper().selectList(new QueryWrapper<CoreRoleServer>()
|
||||
.eq(CoreRoleServer.IS_DELETED, 0)
|
||||
.eq("is_open", 1)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改服务
|
||||
*
|
||||
* @param coreService
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/server/update")
|
||||
public ApiResp<String> update(@RequestBody CoreRoleServer coreService) {
|
||||
if (StrUtil.isNotEmpty(coreService.getId())) {
|
||||
coreRoleService.getServerMapper().updateById(coreService);
|
||||
} else {
|
||||
coreRoleService.getServerMapper().insert(coreService);
|
||||
}
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 权限-列出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/authority/list")
|
||||
public ApiResp<List<ServiceMenuVO>> menuList(@Valid MenuListDTO dto) {
|
||||
|
||||
List<CoreRoleAuthority> list = coreRoleService.getAuthorityMapper().selectList(new QueryWrapper<CoreRoleAuthority>()
|
||||
.eq(CoreRoleAuthority.IS_DELETED, 0)
|
||||
.eq("service", dto.getService())
|
||||
.eq(StrUtil.isNotEmpty(dto.getPlatform()), "platform", dto.getPlatform())
|
||||
.orderByAsc("sort")
|
||||
);
|
||||
|
||||
List<ServiceMenuVO> collect = coreRoleService.menuChildrenWrap(list, null);
|
||||
|
||||
return ApiResp.respOK(collect);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 权限-编辑
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/authority/update")
|
||||
public ApiResp<String> menuUpdate(@RequestBody CoreRoleAuthority serviceMenu) {
|
||||
serviceMenu.setParent(StrUtil.emptyToDefault(serviceMenu.getParent(), null));
|
||||
if (StrUtil.isEmpty(serviceMenu.getId())) {
|
||||
coreRoleService.getAuthorityMapper().insert(serviceMenu);
|
||||
} else {
|
||||
serviceMenu.setNo(null);
|
||||
coreRoleService.getAuthorityMapper().updateById(serviceMenu);
|
||||
}
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取自己拥有的服务
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/owner/server")
|
||||
public ApiResp<List<CoreRoleServer>> ownerServer() {
|
||||
TokenBean tokenBean = TsTokenConfig.get();
|
||||
List<CoreRoleAuthority> allOwnerMenus = coreRoleService.getOwnerAuthorityLeafList(tokenBean.getId(), tokenBean.getRoleId());
|
||||
|
||||
List<CoreRoleServer> roleServerList = coreRoleService.getServerMapper().selectList(new QueryWrapper<CoreRoleServer>()
|
||||
.in("id", allOwnerMenus.stream().map(CoreRoleAuthority::getService).collect(Collectors.toList()))
|
||||
.eq(CoreRoleServer.IS_DELETED, 0)
|
||||
.eq("is_open", 1)
|
||||
);
|
||||
|
||||
return ApiResp.respOK(roleServerList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取自己拥有的菜单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/owner/menu")
|
||||
public ApiResp<List<ServiceMenuVO>> ownerMenu(@Valid OwnerMenuDTO dto) {
|
||||
|
||||
TokenBean tokenBean = TsTokenConfig.get();
|
||||
List<ServiceMenuVO> ownerMenus = coreRoleService.getOwnerMenus(tokenBean.getId(), tokenBean.getRoleId(), dto);
|
||||
|
||||
return ApiResp.respOK(ownerMenus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自己拥有的功能点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/owner/point")
|
||||
public ApiResp<List<CoreRoleAuthority>> ownerPoint(@Valid OwnerPointDTO dto) {
|
||||
|
||||
TokenBean tokenBean = TsTokenConfig.get();
|
||||
List<CoreRoleAuthority> allOwnerMenus = coreRoleService.getOwnerAuthorityLeafList(tokenBean.getId(), tokenBean.getRoleId());
|
||||
|
||||
String parentId;
|
||||
if (StrUtil.isNotEmpty(dto.getParentNo())) {
|
||||
CoreRoleAuthority selected = coreRoleService.getAuthorityMapper().selectOne(new QueryWrapper<CoreRoleAuthority>()
|
||||
.eq("no", dto.getParentNo())
|
||||
.eq("is_deleted", 0)
|
||||
.last("limit 1")
|
||||
);
|
||||
parentId = selected == null ? "" : selected.getId();
|
||||
} else {
|
||||
parentId = "";
|
||||
}
|
||||
|
||||
List<CoreRoleAuthority> collect = allOwnerMenus.stream()
|
||||
.filter(it -> Objects.equals(it.getType(), "point"))
|
||||
.filter(it -> it.getService().equals(dto.getService()))
|
||||
.filter(it -> it.getPlatform().equals(dto.getPlatform()))
|
||||
.filter(it -> {
|
||||
if (StrUtil.isNotEmpty(parentId)) {
|
||||
return parentId.equals(it.getParent());
|
||||
}
|
||||
return true;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return ApiResp.respOK(collect);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||
|
||||
public interface CoreRoleAuthorityMapper extends BaseMapper<CoreRoleAuthority> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleGroup;
|
||||
|
||||
public interface CoreRoleGroupMapper extends BaseMapper<CoreRoleGroup> {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleGroupRx;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreRoleGroupRxMapper extends BaseMapper<CoreRoleGroupRx> {
|
||||
/**
|
||||
* 批量插入数据
|
||||
*
|
||||
* @param coreRoleGroupRxs
|
||||
* @return
|
||||
*/
|
||||
int batchInsert(@Param("list") List<CoreRoleGroupRx> coreRoleGroupRxs);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleServer;
|
||||
|
||||
public interface CoreRoleServerMapper extends BaseMapper<CoreRoleServer> {
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleUser;
|
||||
import com.tiesheng.role.pojos.vo.RoleUserPageVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreRoleUserMapper extends BaseMapper<CoreRoleUser> {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param wrapper
|
||||
* @return
|
||||
*/
|
||||
Page<RoleUserPageVO> page(Page<RoleUserPageVO> page, @Param("ew") QueryWrapper<CoreRoleUser> wrapper);
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户所有的权限
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<CoreRoleAuthority> getOwnerAuthorityLeafList(@Param("userId") String userId,
|
||||
@Param("roleId") String roleId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-权限
|
||||
*/
|
||||
@TableName(value = "core_role_authority")
|
||||
public class CoreRoleAuthority extends DaoBase {
|
||||
/**
|
||||
* 服务
|
||||
*/
|
||||
@TableField(value = "service")
|
||||
private String service;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableField(value = "`no`")
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
@TableField(value = "`level`")
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 父类ID
|
||||
*/
|
||||
@TableField(value = "parent")
|
||||
private String parent;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@TableField(value = "is_open")
|
||||
private Integer isOpen;
|
||||
|
||||
/**
|
||||
* 类型:group-分组,menu-菜单项,point-点
|
||||
*/
|
||||
@TableField(value = "`type`")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 跳转地址
|
||||
*/
|
||||
@TableField(value = "link")
|
||||
private String link;
|
||||
|
||||
/**
|
||||
* 平台:ding、web、mobile等
|
||||
*/
|
||||
@TableField(value = "platform")
|
||||
private String platform;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@TableField(value = "ext1")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 扩展2
|
||||
*/
|
||||
@TableField(value = "ext2")
|
||||
private String ext2;
|
||||
|
||||
/**
|
||||
* 扩展3
|
||||
*/
|
||||
@TableField(value = "ext3")
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 获取服务
|
||||
*
|
||||
* @return service - 服务
|
||||
*/
|
||||
public String getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置服务
|
||||
*
|
||||
* @param service 服务
|
||||
*/
|
||||
public void setService(String service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取编号
|
||||
*
|
||||
* @return no - 编号
|
||||
*/
|
||||
public String getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置编号
|
||||
*
|
||||
* @param no 编号
|
||||
*/
|
||||
public void setNo(String no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序
|
||||
*
|
||||
* @return sort - 排序
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置排序
|
||||
*
|
||||
* @param sort 排序
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取层级
|
||||
*
|
||||
* @return level - 层级
|
||||
*/
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置层级
|
||||
*
|
||||
* @param level 层级
|
||||
*/
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取父类ID
|
||||
*
|
||||
* @return parent - 父类ID
|
||||
*/
|
||||
public String getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置父类ID
|
||||
*
|
||||
* @param parent 父类ID
|
||||
*/
|
||||
public void setParent(String parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取说明
|
||||
*
|
||||
* @return remark - 说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置说明
|
||||
*
|
||||
* @param remark 说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否启用
|
||||
*
|
||||
* @return is_open - 是否启用
|
||||
*/
|
||||
public Integer getIsOpen() {
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否启用
|
||||
*
|
||||
* @param isOpen 是否启用
|
||||
*/
|
||||
public void setIsOpen(Integer isOpen) {
|
||||
this.isOpen = isOpen;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型:group-分组,menu-菜单项,point-点
|
||||
*
|
||||
* @return type - 类型:group-分组,menu-菜单项,point-点
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置类型:group-分组,menu-菜单项,point-点
|
||||
*
|
||||
* @param type 类型:group-分组,menu-菜单项,point-点
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取跳转地址
|
||||
*
|
||||
* @return link - 跳转地址
|
||||
*/
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置跳转地址
|
||||
*
|
||||
* @param link 跳转地址
|
||||
*/
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取平台:ding、web、mobile等
|
||||
*
|
||||
* @return platform - 平台:ding、web、mobile等
|
||||
*/
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置平台:ding、web、mobile等
|
||||
*
|
||||
* @param platform 平台:ding、web、mobile等
|
||||
*/
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
* @return ext1 - 扩展1
|
||||
*/
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展1
|
||||
*
|
||||
* @param ext1 扩展1
|
||||
*/
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展2
|
||||
*
|
||||
* @return ext2 - 扩展2
|
||||
*/
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展2
|
||||
*
|
||||
* @param ext2 扩展2
|
||||
*/
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展3
|
||||
*
|
||||
* @return ext3 - 扩展3
|
||||
*/
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展3
|
||||
*
|
||||
* @param ext3 扩展3
|
||||
*/
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-分组
|
||||
*/
|
||||
@TableName(value = "core_role_group")
|
||||
public class CoreRoleGroup extends DaoBase {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 类型:role-角色,job-职位
|
||||
*/
|
||||
@TableField(value = "`type`")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否系统
|
||||
*/
|
||||
@TableField(value = "is_system")
|
||||
private Integer isSystem;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@TableField(value = "ext1")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 扩展2
|
||||
*/
|
||||
@TableField(value = "ext2")
|
||||
private String ext2;
|
||||
|
||||
/**
|
||||
* 扩展3
|
||||
*/
|
||||
@TableField(value = "ext3")
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取说明
|
||||
*
|
||||
* @return remark - 说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置说明
|
||||
*
|
||||
* @param remark 说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型:role-角色,job-职位
|
||||
*
|
||||
* @return type - 类型:role-角色,job-职位
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置类型:role-角色,job-职位
|
||||
*
|
||||
* @param type 类型:role-角色,job-职位
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 是否系统
|
||||
*
|
||||
* @return is_system - 是否系统
|
||||
*/
|
||||
public Integer getIsSystem() {
|
||||
return isSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 是否系统
|
||||
*
|
||||
* @param isSystem 是否系统
|
||||
*/
|
||||
public void setIsSystem(Integer isSystem) {
|
||||
this.isSystem = isSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序
|
||||
*
|
||||
* @return sort - 排序
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置排序
|
||||
*
|
||||
* @param sort 排序
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
* @return ext1 - 扩展1
|
||||
*/
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展1
|
||||
*
|
||||
* @param ext1 扩展1
|
||||
*/
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展2
|
||||
*
|
||||
* @return ext2 - 扩展2
|
||||
*/
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展2
|
||||
*
|
||||
* @param ext2 扩展2
|
||||
*/
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展3
|
||||
*
|
||||
* @return ext3 - 扩展3
|
||||
*/
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展3
|
||||
*
|
||||
* @param ext3 扩展3
|
||||
*/
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-分组-关系
|
||||
*/
|
||||
@TableName(value = "core_role_group_rx")
|
||||
public class CoreRoleGroupRx extends DaoBase {
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
@TableField(value = "group_id")
|
||||
private String groupId;
|
||||
|
||||
/**
|
||||
* 菜单id
|
||||
*/
|
||||
@TableField(value = "menu_id")
|
||||
private String menuId;
|
||||
|
||||
/**
|
||||
* 获取角色id
|
||||
*
|
||||
* @return group_id - 角色id
|
||||
*/
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置角色id
|
||||
*
|
||||
* @param groupId 角色id
|
||||
*/
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单id
|
||||
*
|
||||
* @return menu_id - 菜单id
|
||||
*/
|
||||
public String getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置菜单id
|
||||
*
|
||||
* @param menuId 菜单id
|
||||
*/
|
||||
public void setMenuId(String menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-服务
|
||||
*/
|
||||
@TableName(value = "core_role_server")
|
||||
public class CoreRoleServer extends DaoBase {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
@TableField(value = "logo")
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@TableField(value = "is_open")
|
||||
private Integer isOpen;
|
||||
|
||||
/**
|
||||
* 跳转地址
|
||||
*/
|
||||
@TableField(value = "link")
|
||||
private String link;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@TableField(value = "ext1")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 扩展2
|
||||
*/
|
||||
@TableField(value = "ext2")
|
||||
private String ext2;
|
||||
|
||||
/**
|
||||
* 扩展3
|
||||
*/
|
||||
@TableField(value = "ext3")
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取说明
|
||||
*
|
||||
* @return remark - 说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置说明
|
||||
*
|
||||
* @param remark 说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取logo
|
||||
*
|
||||
* @return logo - logo
|
||||
*/
|
||||
public String getLogo() {
|
||||
return logo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置logo
|
||||
*
|
||||
* @param logo logo
|
||||
*/
|
||||
public void setLogo(String logo) {
|
||||
this.logo = logo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序
|
||||
*
|
||||
* @return sort - 排序
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置排序
|
||||
*
|
||||
* @param sort 排序
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否启用
|
||||
*
|
||||
* @return is_open - 是否启用
|
||||
*/
|
||||
public Integer getIsOpen() {
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否启用
|
||||
*
|
||||
* @param isOpen 是否启用
|
||||
*/
|
||||
public void setIsOpen(Integer isOpen) {
|
||||
this.isOpen = isOpen;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取跳转地址
|
||||
*
|
||||
* @return link - 跳转地址
|
||||
*/
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置跳转地址
|
||||
*
|
||||
* @param link 跳转地址
|
||||
*/
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
* @return ext1 - 扩展1
|
||||
*/
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展1
|
||||
*
|
||||
* @param ext1 扩展1
|
||||
*/
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展2
|
||||
*
|
||||
* @return ext2 - 扩展2
|
||||
*/
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展2
|
||||
*
|
||||
* @param ext2 扩展2
|
||||
*/
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展3
|
||||
*
|
||||
* @return ext3 - 扩展3
|
||||
*/
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展3
|
||||
*
|
||||
* @param ext3 扩展3
|
||||
*/
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,40 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 职位-用户
|
||||
* 角色-用户
|
||||
*/
|
||||
@TableName(value = "core_job_user")
|
||||
public class CoreJobUser extends DaoBase {
|
||||
@TableName(value = "core_role_user")
|
||||
public class CoreRoleUser extends DaoBase {
|
||||
/**
|
||||
* 用户id
|
||||
* 用户ID
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
* 类型:menu-菜单,group-分组
|
||||
*/
|
||||
@TableField(value = "job_id")
|
||||
private String jobId;
|
||||
@TableField(value = "`type`")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 类型关联的记录ID
|
||||
*/
|
||||
@TableField(value = "type_id")
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 过期时间,无则不过期
|
||||
*/
|
||||
@TableField(value = "expire_time")
|
||||
private Date expireTime;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
@@ -43,45 +55,75 @@ public class CoreJobUser extends DaoBase {
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 扩展文本
|
||||
*/
|
||||
@TableField(value = "ext_text")
|
||||
private String extText;
|
||||
|
||||
/**
|
||||
* 获取用户id
|
||||
* 获取用户ID
|
||||
*
|
||||
* @return user_id - 用户id
|
||||
* @return user_id - 用户ID
|
||||
*/
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户id
|
||||
* 设置用户ID
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param userId 用户ID
|
||||
*/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
* 获取类型:menu-菜单,group-分组
|
||||
*
|
||||
* @return job_id - 用户
|
||||
* @return type - 类型:menu-菜单,group-分组
|
||||
*/
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户
|
||||
* 设置类型:menu-菜单,group-分组
|
||||
*
|
||||
* @param jobId 用户
|
||||
* @param type 类型:menu-菜单,group-分组
|
||||
*/
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型关联的记录ID
|
||||
*
|
||||
* @return type_id - 类型关联的记录ID
|
||||
*/
|
||||
public String getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置类型关联的记录ID
|
||||
*
|
||||
* @param typeId 类型关联的记录ID
|
||||
*/
|
||||
public void setTypeId(String typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取过期时间,无则不过期
|
||||
*
|
||||
* @return expire_time - 过期时间,无则不过期
|
||||
*/
|
||||
public Date getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置过期时间,无则不过期
|
||||
*
|
||||
* @param expireTime 过期时间,无则不过期
|
||||
*/
|
||||
public void setExpireTime(Date expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,22 +179,4 @@ public class CoreJobUser extends DaoBase {
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展文本
|
||||
*
|
||||
* @return ext_text - 扩展文本
|
||||
*/
|
||||
public String getExtText() {
|
||||
return extText;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展文本
|
||||
*
|
||||
* @param extText 扩展文本
|
||||
*/
|
||||
public void setExtText(String extText) {
|
||||
this.extText = extText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tiesheng.role.pojos.dto;
|
||||
|
||||
import com.tiesheng.util.pojos.IdDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GroupRxUpdateDTO extends IdDTO {
|
||||
|
||||
private List<String> menuIds;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public List<String> getMenuIds() {
|
||||
return menuIds;
|
||||
}
|
||||
|
||||
public void setMenuIds(List<String> menuIds) {
|
||||
this.menuIds = menuIds;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.tiesheng.role.pojos.dto;
|
||||
|
||||
public class MenuListDTO extends ServiceDTO {
|
||||
|
||||
private String platform;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.tiesheng.role.pojos.dto;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class OwnerMenuDTO extends ServiceDTO {
|
||||
|
||||
@NotEmpty(message = "请选择一个平台")
|
||||
private String platform;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public @NotEmpty(message = "请选择一个平台") String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(@NotEmpty(message = "请选择一个平台") String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.tiesheng.role.pojos.dto;
|
||||
|
||||
public class OwnerPointDTO extends OwnerMenuDTO {
|
||||
|
||||
private String parentNo;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getParentNo() {
|
||||
return parentNo;
|
||||
}
|
||||
|
||||
public void setParentNo(String parentNo) {
|
||||
this.parentNo = parentNo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tiesheng.role.pojos.dto;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class ServiceDTO {
|
||||
|
||||
@NotEmpty(message = "请选择一个服务")
|
||||
private String service;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public String getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public void setService(String service) {
|
||||
this.service = service;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tiesheng.role.pojos.vo;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class GroupTypeDTO {
|
||||
|
||||
@NotEmpty(message = "请选择一个类型")
|
||||
private String type;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tiesheng.role.pojos.vo;
|
||||
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleUser;
|
||||
|
||||
public class RoleUserPageVO extends CoreRoleUser {
|
||||
|
||||
private String typeName;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tiesheng.role.pojos.vo;
|
||||
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ServiceMenuVO extends CoreRoleAuthority {
|
||||
|
||||
private List<ServiceMenuVO> children;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public List<ServiceMenuVO> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<ServiceMenuVO> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.tiesheng.role.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.role.mapper.*;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleGroup;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleGroupRx;
|
||||
import com.tiesheng.role.pojos.dto.GroupRxUpdateDTO;
|
||||
import com.tiesheng.role.pojos.dto.OwnerMenuDTO;
|
||||
import com.tiesheng.role.pojos.vo.ServiceMenuVO;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRoleGroup> {
|
||||
|
||||
|
||||
@Resource
|
||||
CoreRoleUserMapper coreRoleUserMapper;
|
||||
|
||||
@Resource
|
||||
CoreRoleGroupRxMapper coreRoleGroupRxMapper;
|
||||
|
||||
@Resource
|
||||
CoreRoleAuthorityMapper coreRoleAuthorityMapper;
|
||||
|
||||
@Resource
|
||||
CoreRoleServerMapper coreRoleServerMapper;
|
||||
|
||||
public CoreRoleServerMapper getServerMapper() {
|
||||
return coreRoleServerMapper;
|
||||
}
|
||||
|
||||
public CoreRoleAuthorityMapper getAuthorityMapper() {
|
||||
return coreRoleAuthorityMapper;
|
||||
}
|
||||
|
||||
public CoreRoleUserMapper getUserMapper() {
|
||||
return coreRoleUserMapper;
|
||||
}
|
||||
|
||||
public CoreRoleGroupRxMapper getGroupRxMapper() {
|
||||
return coreRoleGroupRxMapper;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 菜单封装
|
||||
*
|
||||
* @param coreServiceMenuList
|
||||
* @param parent
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceMenuVO> menuChildrenWrap(List<CoreRoleAuthority> coreServiceMenuList, String parent) {
|
||||
List<CoreRoleAuthority> distinctList = coreServiceMenuList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
List<ServiceMenuVO> list = new ArrayList<>();
|
||||
|
||||
for (CoreRoleAuthority coreServiceMenu : distinctList) {
|
||||
if (!StrUtil.equals(parent, coreServiceMenu.getParent())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ServiceMenuVO menuVO = BeanUtil.copyProperties(coreServiceMenu, ServiceMenuVO.class);
|
||||
menuVO.setChildren(menuChildrenWrap(distinctList, coreServiceMenu.getId()));
|
||||
list.add(menuVO);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新角色的权限
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateGroupRx(GroupRxUpdateDTO dto) {
|
||||
coreRoleGroupRxMapper.delete(new QueryWrapper<CoreRoleGroupRx>()
|
||||
.eq("group_id", dto.getId())
|
||||
);
|
||||
List<CoreRoleGroupRx> list = new ArrayList<>();
|
||||
for (String menuId : dto.getMenuIds()) {
|
||||
CoreRoleGroupRx coreRoleGroupRx = new CoreRoleGroupRx();
|
||||
coreRoleGroupRx.setGroupId(dto.getId());
|
||||
coreRoleGroupRx.setMenuId(menuId);
|
||||
list.add(coreRoleGroupRx);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
coreRoleGroupRxMapper.batchInsert(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取拥有的所有叶子权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<CoreRoleAuthority> getOwnerAuthorityLeafList(String userId, String roleId) {
|
||||
return coreRoleUserMapper.getOwnerAuthorityLeafList(userId, roleId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取自己拥有的所有菜单
|
||||
*
|
||||
* @param userId
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceMenuVO> getOwnerMenus(String userId, String roleId, OwnerMenuDTO dto) {
|
||||
List<CoreRoleAuthority> allOwnerMenus = getOwnerAuthorityLeafList(userId, roleId);
|
||||
|
||||
List<CoreRoleAuthority> allRoleAuthorityList = coreRoleAuthorityMapper.selectList(new QueryWrapper<CoreRoleAuthority>()
|
||||
.eq(CoreRoleAuthority.IS_DELETED, 0)
|
||||
.eq("service", dto.getService())
|
||||
.eq("platform", dto.getPlatform())
|
||||
.eq("is_open", 1)
|
||||
);
|
||||
Map<Object, CoreRoleAuthority> allAuthorityMap = CollUtil.fieldValueMap(allRoleAuthorityList, "id");
|
||||
|
||||
|
||||
List<CoreRoleAuthority> ownerAuthorityList = new ArrayList<>();
|
||||
for (CoreRoleAuthority roleAuthority : allOwnerMenus) {
|
||||
ownerAuthorityList.add(roleAuthority);
|
||||
|
||||
String parentId = roleAuthority.getParent();
|
||||
while (StrUtil.isNotEmpty(parentId)) {
|
||||
CoreRoleAuthority parent = allAuthorityMap.get(parentId);
|
||||
if (parent == null) {
|
||||
parentId = "";
|
||||
} else {
|
||||
parentId = parent.getParent();
|
||||
ownerAuthorityList.add(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return menuChildrenWrap(ownerAuthorityList.stream()
|
||||
.filter(it -> Objects.equals(it.getType(), "group") || Objects.equals(it.getType(), "menu"))
|
||||
.collect(Collectors.toList()), null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
create table core_role_authority
|
||||
(
|
||||
id varchar(50) not null
|
||||
primary key,
|
||||
create_time datetime not null,
|
||||
update_time datetime not null,
|
||||
is_deleted int(6) default 0 not null,
|
||||
service varchar(50) not null comment '服务',
|
||||
no varchar(50) not null comment '编号',
|
||||
name varchar(50) not null comment '名称',
|
||||
sort int(6) default 0 null comment '排序',
|
||||
level int(6) default 0 null comment '层级',
|
||||
parent varchar(50) null comment '父类ID',
|
||||
remark varchar(500) null comment '说明',
|
||||
is_open int(6) default 0 null comment '是否启用',
|
||||
type varchar(20) default 'item' not null comment '类型:group-分组,menu-菜单项,point-点',
|
||||
link text null comment '跳转地址',
|
||||
platform varchar(20) null comment '平台:ding、web、mobile等',
|
||||
ext1 varchar(500) null comment '扩展1',
|
||||
ext2 varchar(500) null comment '扩展2',
|
||||
ext3 varchar(500) null comment '扩展3'
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
comment '角色-权限';
|
||||
|
||||
create table core_role_group
|
||||
(
|
||||
id varchar(50) not null
|
||||
primary key,
|
||||
create_time datetime not null,
|
||||
update_time datetime not null,
|
||||
is_deleted int(6) default 0 not null,
|
||||
name varchar(50) not null comment '名称',
|
||||
remark varchar(500) null comment '说明',
|
||||
type varchar(10) null comment '类型:role-角色,job-职位',
|
||||
is_system int(2) default 0 not null comment ' 是否系统',
|
||||
sort int(6) default 0 not null comment '排序',
|
||||
ext1 varchar(500) null comment '扩展1',
|
||||
ext2 varchar(500) null comment '扩展2',
|
||||
ext3 varchar(500) null comment '扩展3'
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
comment '角色-分组';
|
||||
|
||||
create table core_role_group_rx
|
||||
(
|
||||
id varchar(50) not null
|
||||
primary key,
|
||||
create_time datetime not null,
|
||||
update_time datetime not null,
|
||||
is_deleted int(6) default 0 not null,
|
||||
group_id varchar(50) not null comment '角色id',
|
||||
menu_id varchar(50) not null comment '菜单id'
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
comment '角色-分组-关系';
|
||||
|
||||
create table core_role_server
|
||||
(
|
||||
id varchar(50) not null
|
||||
primary key,
|
||||
create_time datetime not null,
|
||||
update_time datetime not null,
|
||||
is_deleted int(6) default 0 not null,
|
||||
name varchar(255) null comment '名称',
|
||||
remark varchar(500) null comment '说明',
|
||||
logo varchar(500) null comment 'logo',
|
||||
sort int(6) default 0 null comment '排序',
|
||||
is_open int(2) default 1 not null comment '是否启用',
|
||||
link varchar(500) null comment '跳转地址',
|
||||
ext1 varchar(500) null comment '扩展1',
|
||||
ext2 varchar(500) null comment '扩展2',
|
||||
ext3 varchar(500) null comment '扩展3'
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
comment '角色-服务';
|
||||
|
||||
create table core_role_user
|
||||
(
|
||||
id varchar(50) not null
|
||||
primary key,
|
||||
create_time datetime not null,
|
||||
update_time datetime not null,
|
||||
is_deleted int(6) default 0 not null,
|
||||
user_id varchar(50) not null comment '用户ID',
|
||||
type varchar(50) not null comment '类型:menu-菜单,job-职位',
|
||||
type_id varchar(50) not null comment '类型关联的记录ID',
|
||||
expire_time datetime null comment '过期时间,无则不过期',
|
||||
ext1 varchar(500) null comment '扩展1',
|
||||
ext2 varchar(500) null comment '扩展2',
|
||||
ext3 varchar(500) null comment '扩展3'
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
comment '角色-用户';
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.role.mapper.CoreRoleAuthorityMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleAuthority">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_authority-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="service" jdbcType="VARCHAR" property="service" />
|
||||
<result column="no" jdbcType="VARCHAR" property="no" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="level" jdbcType="INTEGER" property="level" />
|
||||
<result column="parent" jdbcType="VARCHAR" property="parent" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="link" jdbcType="LONGVARCHAR" property="link" />
|
||||
<result column="platform" jdbcType="VARCHAR" property="platform" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, service, `no`, `name`, sort, `level`, parent,
|
||||
remark, is_open, `type`, link, platform, ext1, ext2, ext3
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.role.mapper.CoreRoleGroupMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleGroup">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_group-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="is_system" jdbcType="INTEGER" property="isSystem" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, `name`, remark, `type`, is_system, sort,
|
||||
ext1, ext2, ext3
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.role.mapper.CoreRoleGroupRxMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleGroupRx">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_group_rx-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="group_id" jdbcType="VARCHAR" property="groupId" />
|
||||
<result column="menu_id" jdbcType="VARCHAR" property="menuId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, group_id, menu_id
|
||||
</sql>
|
||||
|
||||
<insert id="batchInsert">
|
||||
insert into core_role_group_rx(id, create_time, update_time, is_deleted, group_id, menu_id)
|
||||
values
|
||||
<foreach collection="list" separator="," item="item">
|
||||
(uuid(), now(), now(), 0,
|
||||
#{item.groupId},
|
||||
#{item.menuId})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.role.mapper.CoreRoleServerMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleServer">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_server-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="logo" jdbcType="VARCHAR" property="logo" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen" />
|
||||
<result column="link" jdbcType="VARCHAR" property="link" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, `name`, remark, logo, sort, is_open, link,
|
||||
ext1, ext2, ext3
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.role.mapper.CoreRoleUserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleUser">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_user-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="type_id" jdbcType="VARCHAR" property="typeId" />
|
||||
<result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, user_id, `type`, type_id, expire_time,
|
||||
ext1, ext2, ext3
|
||||
</sql>
|
||||
|
||||
<select id="page" resultType="com.tiesheng.role.pojos.vo.RoleUserPageVO">
|
||||
select *,
|
||||
(case cru.type
|
||||
when 'menu' then (select name from core_role_authority where id = cru.type_id and is_deleted = 0)
|
||||
when 'job' then (select name from core_role_group where id = cru.type_id and is_deleted = 0)
|
||||
else '' end) type_name
|
||||
from core_role_user cru
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getOwnerAuthorityLeafList" resultType="com.tiesheng.role.pojos.dao.CoreRoleAuthority">
|
||||
select *
|
||||
from core_role_authority
|
||||
where is_open = 1
|
||||
and is_deleted = 0
|
||||
and
|
||||
id in (select type_id
|
||||
from core_role_user
|
||||
where type = 'menu'
|
||||
and user_id = #{userId}
|
||||
and is_deleted = 0
|
||||
and (expire_time is null or expire_time > now())
|
||||
|
||||
union
|
||||
|
||||
select crgr.menu_id
|
||||
from core_role_user cru
|
||||
left join core_role_group_rx crgr on crgr.group_id = cru.type_id
|
||||
where type = 'job'
|
||||
and user_id = #{userId}
|
||||
and cru.is_deleted = 0
|
||||
and (cru.expire_time is null or cru.expire_time > now())
|
||||
|
||||
<if test="roleId != null and roleId != ''">
|
||||
union
|
||||
|
||||
select menu_id
|
||||
from core_role_group_rx
|
||||
where group_id = #{roleId}
|
||||
</if>
|
||||
)
|
||||
order by sort
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
BIN
springboot-util/.DS_Store
vendored
BIN
springboot-util/.DS_Store
vendored
Binary file not shown.
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-util</artifactId>
|
||||
@@ -36,6 +36,24 @@
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MySql驱动 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.30</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- fastJson -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
|
||||
BIN
springboot-util/src/main/.DS_Store
vendored
BIN
springboot-util/src/main/.DS_Store
vendored
Binary file not shown.
@@ -0,0 +1,44 @@
|
||||
package com.tiesheng.util;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class CharacterUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 移除特殊字符
|
||||
*
|
||||
* @param o 类
|
||||
*/
|
||||
public static void removeSymbol(Object o) {
|
||||
removeSymbol(o, "\n|\r|\t| ");
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除特殊字符
|
||||
*
|
||||
* @param o 类
|
||||
* @param searchStr 规则
|
||||
*/
|
||||
public static void removeSymbol(Object o, String searchStr) {
|
||||
JSONObject object = JSONUtil.parseObj(o, false);
|
||||
for (Map.Entry<String, Object> entry : object) {
|
||||
if (ObjectUtil.isEmpty(entry.getValue()) || StrUtil.equals("null", String.valueOf(entry.getValue()))) {
|
||||
entry.setValue("");
|
||||
continue;
|
||||
}
|
||||
if (StrUtil.isNotEmpty(entry.getKey())) {
|
||||
entry.setValue(StrUtil.trim(StrUtil.replace(entry.getValue().toString(), searchStr, "")));
|
||||
}
|
||||
}
|
||||
BeanUtil.copyProperties(object, o);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.login.config.token;
|
||||
package com.tiesheng.util.config;
|
||||
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
@@ -7,9 +7,9 @@ import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.jwt.JWT;
|
||||
import cn.hutool.jwt.JWTValidator;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -95,8 +95,10 @@ public class TsTokenConfig {
|
||||
String id = decode.getPayload("id").toString();
|
||||
String environmentType = decode.getPayload("environmentType").toString();
|
||||
String service = decode.getPayload("service").toString();
|
||||
String extra = decode.getPayload("extra").toString();
|
||||
String extra = StrUtil.toStringOrNull(decode.getPayload("extra"));
|
||||
String roleId = StrUtil.toStringOrNull(decode.getPayload("roleId"));
|
||||
tokenBean = new TokenBean(id, environmentType, service);
|
||||
tokenBean.setRoleId(roleId);
|
||||
tokenBean.setExtra(extra);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.pojos;
|
||||
package com.tiesheng.util.pojos;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.pojos.dto;
|
||||
package com.tiesheng.util.pojos;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.pojos.dto;
|
||||
package com.tiesheng.util.pojos;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.tiesheng.login.config.token.bean;
|
||||
package com.tiesheng.util.pojos;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.jwt.JWT;
|
||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
@@ -14,6 +14,7 @@ public class TokenBean {
|
||||
private String id;
|
||||
private String environmentType;
|
||||
private String service;
|
||||
private String roleId;
|
||||
private String extra;
|
||||
|
||||
public TokenBean() {
|
||||
@@ -23,6 +24,7 @@ public class TokenBean {
|
||||
this.id = id;
|
||||
this.environmentType = environmentType;
|
||||
this.service = service;
|
||||
this.roleId = "";
|
||||
this.extra = "";
|
||||
}
|
||||
|
||||
@@ -37,6 +39,7 @@ public class TokenBean {
|
||||
.setPayload("id", getId())
|
||||
.setPayload("environmentType", StrUtil.emptyToDefault(getEnvironmentType(), ""))
|
||||
.setPayload("service", StrUtil.emptyToDefault(getService(), ""))
|
||||
.setPayload("roleId", StrUtil.emptyToDefault(getRoleId(), ""))
|
||||
.setPayload("extra", StrUtil.emptyToDefault(getExtra(), ""))
|
||||
.setKey(tsTokenConfig.getEncryptKey().getBytes())
|
||||
.sign();
|
||||
@@ -77,4 +80,12 @@ public class TokenBean {
|
||||
public void setExtra(String extra) {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.service;
|
||||
package com.tiesheng.util.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.0.24</version>
|
||||
<version>2.0.0.rc3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-web</artifactId>
|
||||
@@ -39,24 +39,6 @@
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MySql驱动 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.30</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.tiesheng.core;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
|
||||
@ComponentScan({
|
||||
"com.tiesheng.core.**.*",
|
||||
})
|
||||
@MapperScan("com.tiesheng.core.mapper")
|
||||
public class CoreAutoConfigurer {
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
package com.tiesheng.core.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.core.pojos.dto.IdDTO;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUpdateDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUpdateRxDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUserAssignDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUserOwner;
|
||||
import com.tiesheng.core.service.CoreJobService;
|
||||
import com.tiesheng.login.config.token.TsTokenConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/job")
|
||||
public class JobController {
|
||||
|
||||
@Autowired
|
||||
CoreJobService coreJobService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取职位列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ApiResp<List<CoreJob>> list(PageDTO dto) {
|
||||
QueryWrapper<CoreJob> queryWrapper = new QueryWrapper<CoreJob>().eq("is_deleted", 0);
|
||||
dto.likeColumns(queryWrapper, "name");
|
||||
List<CoreJob> jobList = coreJobService.list(queryWrapper);
|
||||
return ApiResp.respOK(jobList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加、编辑职位
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public ApiResp<String> update(@Valid @RequestBody JobUpdateDTO dto) {
|
||||
CoreJob job = BeanUtil.copyProperties(dto, CoreJob.class);
|
||||
if (!StrUtil.isEmpty(job.getId())) {
|
||||
CoreJob byId = coreJobService.getById(job.getId());
|
||||
if (byId != null && byId.getIsSystem() == 1) {
|
||||
throw new ApiException("系统配置,无法编辑");
|
||||
}
|
||||
}
|
||||
coreJobService.saveOrUpdate(job);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取关系
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/func/rx")
|
||||
public ApiResp<List<String>> funcRx(@Valid IdDTO dto) {
|
||||
List<String> list = coreJobService.getBaseMapper().getJobFunc(dto.getId(), null);
|
||||
return ApiResp.respOK(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新职位关系
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/func/rx")
|
||||
public ApiResp<String> updateJobRx(@Valid @RequestBody JobUpdateRxDTO dto) {
|
||||
coreJobService.updateJobRx(dto.getJobId(), StrUtil.split(dto.getPoints(), ","));
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户职位分配
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/user/assign")
|
||||
public ApiResp<String> userAssign(@Valid @RequestBody JobUserAssignDTO dto) {
|
||||
coreJobService.userAssign(dto.getUserId(), dto.getJobId());
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户自己的
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/user/owner")
|
||||
public ApiResp<List<JobUserOwner>> userOwner() {
|
||||
List<JobUserOwner> coreJobUsers = coreJobService.getJobUserMapper().list(TsTokenConfig.get().getId());
|
||||
coreJobUsers.forEach(it -> {
|
||||
List<String> list = coreJobService.getBaseMapper().getJobFunc(it.getJobId(), 1);
|
||||
it.setPoints(list);
|
||||
});
|
||||
return ApiResp.respOK(coreJobUsers);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreConfigFuncMapper extends BaseMapper<CoreConfigFunc> {
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreJobMapper extends BaseMapper<CoreJob> {
|
||||
|
||||
/**
|
||||
* 清除职位的关联关系
|
||||
*
|
||||
* @param jobId
|
||||
*/
|
||||
void clearJobFunc(@Param("jobId") String jobId);
|
||||
|
||||
|
||||
/**
|
||||
* 更新关联关系
|
||||
*
|
||||
* @param pointList
|
||||
*/
|
||||
void updateJobFunc(@Param("list") List<IdName> pointList);
|
||||
|
||||
|
||||
/**
|
||||
* 获取关联的func
|
||||
*
|
||||
* @param jobId
|
||||
* @return
|
||||
*/
|
||||
List<String> getJobFunc(@Param("jobId") String jobId, @Param("isUsed") Integer isUsed);
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJobUser;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUserOwner;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreJobUserMapper extends BaseMapper<CoreJobUser> {
|
||||
/**
|
||||
* 获取指定用户的职位和功能点
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<JobUserOwner> list(@Param("userId") String userId);
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 职位-功能点
|
||||
*/
|
||||
@TableName(value = "core_config_func")
|
||||
public class CoreConfigFunc extends DaoBase {
|
||||
/**
|
||||
* 业务
|
||||
*/
|
||||
@TableField(value = "service")
|
||||
private String service;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 其他说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@TableField(value = "is_used")
|
||||
private Integer isUsed;
|
||||
|
||||
/**
|
||||
* 获取业务
|
||||
*
|
||||
* @return service - 业务
|
||||
*/
|
||||
public String getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置业务
|
||||
*
|
||||
* @param service 业务
|
||||
*/
|
||||
public void setService(String service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取其他说明
|
||||
*
|
||||
* @return remark - 其他说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置其他说明
|
||||
*
|
||||
* @param remark 其他说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否启用
|
||||
*
|
||||
* @return is_used - 是否启用
|
||||
*/
|
||||
public Integer getIsUsed() {
|
||||
return isUsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否启用
|
||||
*
|
||||
* @param isUsed 是否启用
|
||||
*/
|
||||
public void setIsUsed(Integer isUsed) {
|
||||
this.isUsed = isUsed;
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
@TableName(value = "core_job")
|
||||
public class CoreJob extends DaoBase {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 其他说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否系统
|
||||
*/
|
||||
@TableField(value = "is_system")
|
||||
private Integer isSystem;
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取其他说明
|
||||
*
|
||||
* @return remark - 其他说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置其他说明
|
||||
*
|
||||
* @param remark 其他说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否系统
|
||||
*
|
||||
* @return is_system - 是否系统
|
||||
*/
|
||||
public Integer getIsSystem() {
|
||||
return isSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否系统
|
||||
*
|
||||
* @param isSystem 是否系统
|
||||
*/
|
||||
public void setIsSystem(Integer isSystem) {
|
||||
this.isSystem = isSystem;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dto.config;
|
||||
|
||||
public class ConfigFuncDTO {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String remark;
|
||||
private Integer isUsed;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Integer getIsUsed() {
|
||||
return isUsed;
|
||||
}
|
||||
|
||||
public void setIsUsed(Integer isUsed) {
|
||||
this.isUsed = isUsed;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dto.job;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class JobUpdateDTO {
|
||||
|
||||
private String id;
|
||||
|
||||
@NotEmpty(message = "请输入职位名称")
|
||||
private String name;
|
||||
private String remark;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dto.job;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class JobUpdateRxDTO {
|
||||
|
||||
@NotEmpty(message = "请选择职位")
|
||||
private String jobId;
|
||||
private String points;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(String points) {
|
||||
this.points = points;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dto.job;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class JobUserAssignDTO {
|
||||
|
||||
@NotEmpty(message = "请选择用户")
|
||||
private String userId;
|
||||
@NotEmpty(message = "请选择职位")
|
||||
private String jobId;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.tiesheng.core.pojos.dto.job;
|
||||
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class JobUserOwner {
|
||||
|
||||
private String jobId;
|
||||
private String jobName;
|
||||
private List<String> points;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getJobName() {
|
||||
return jobName;
|
||||
}
|
||||
|
||||
public void setJobName(String jobName) {
|
||||
this.jobName = jobName;
|
||||
}
|
||||
|
||||
public List<String> getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(List<String> points) {
|
||||
this.points = points;
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
package com.tiesheng.core.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.core.mapper.CoreJobMapper;
|
||||
import com.tiesheng.core.mapper.CoreJobUserMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.core.pojos.dao.CoreJobUser;
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Service
|
||||
public class CoreJobService extends TsServiceBase<CoreJobMapper, CoreJob> {
|
||||
|
||||
@Autowired
|
||||
CoreJobUserMapper coreJobUserMapper;
|
||||
|
||||
public CoreJobUserMapper getJobUserMapper() {
|
||||
return coreJobUserMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新职位
|
||||
*
|
||||
* @param name
|
||||
* @param remark
|
||||
* @param isSystem
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void refresh(String id, String name, String remark, Integer isSystem) {
|
||||
CoreJob coreJob = new CoreJob();
|
||||
coreJob.setId(id);
|
||||
coreJob.setName(name);
|
||||
coreJob.setRemark(remark);
|
||||
coreJob.setIsSystem(isSystem);
|
||||
saveOrUpdate(coreJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新关联关系
|
||||
*
|
||||
* @param jobId
|
||||
* @param points
|
||||
*/
|
||||
public void updateJobRx(String jobId, List<String> points) {
|
||||
List<IdName> nameList = new ArrayList<>();
|
||||
for (String s : points) {
|
||||
IdName id = new IdName();
|
||||
id.setId(IdUtil.getSnowflakeNextIdStr());
|
||||
id.setName(jobId);
|
||||
id.setExtra(s);
|
||||
nameList.add(id);
|
||||
}
|
||||
if (StrUtil.isEmpty(jobId)) {
|
||||
return;
|
||||
}
|
||||
getBaseMapper().clearJobFunc(jobId);
|
||||
if (CollUtil.isNotEmpty(nameList)) {
|
||||
getBaseMapper().updateJobFunc(nameList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分配职位
|
||||
*
|
||||
* @param userId
|
||||
* @param jobId
|
||||
*/
|
||||
public void userAssign(String userId, String jobId) {
|
||||
CoreJobUser jobUser = coreJobUserMapper.selectOne(new QueryWrapper<CoreJobUser>()
|
||||
.eq("is_deleted", 0)
|
||||
.eq("user_id", userId)
|
||||
.eq("job_id", jobId)
|
||||
);
|
||||
if (jobUser == null) {
|
||||
jobUser = new CoreJobUser();
|
||||
}
|
||||
jobUser.setUserId(userId);
|
||||
jobUser.setJobId(jobId);
|
||||
if (StrUtil.isEmpty(jobUser.getId())) {
|
||||
coreJobUserMapper.insert(jobUser);
|
||||
} else {
|
||||
coreJobUserMapper.updateById(jobUser);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.tiesheng.core;
|
||||
package com.tiesheng.web;
|
||||
|
||||
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.database.DatabaseAutoConfigurer;
|
||||
import com.tiesheng.encrypt.EncryptAutoConfigurer;
|
||||
import com.tiesheng.login.LoginAutoConfigurer;
|
||||
import com.tiesheng.message.MessageAutoConfigurer;
|
||||
import com.tiesheng.util.UtilAutoConfigurer;
|
||||
import com.tiesheng.web.service.TieshengWebConfigurer;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
@@ -19,10 +19,10 @@ import java.lang.annotation.*;
|
||||
@Import({
|
||||
UtilAutoConfigurer.class,
|
||||
MessageAutoConfigurer.class,
|
||||
CoreAutoConfigurer.class,
|
||||
WebAutoConfigurer.class,
|
||||
LoginAutoConfigurer.class,
|
||||
DatabaseAutoConfigurer.class,
|
||||
EncryptAutoConfigurer.class
|
||||
EncryptAutoConfigurer.class,
|
||||
})
|
||||
public @interface EnableTieshengWeb {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tiesheng.web;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
|
||||
@ComponentScan({
|
||||
"com.tiesheng.web.**.*",
|
||||
"com.tiesheng.role.**.*",
|
||||
})
|
||||
@MapperScan(value = {"com.tiesheng.web.mapper", "com.tiesheng.role.mapper"})
|
||||
public class WebAutoConfigurer {
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.tiesheng.core.config.exception;
|
||||
package com.tiesheng.web.config.exception;
|
||||
|
||||
import cn.hutool.core.exceptions.ValidateException;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.web.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.exception.ApiRespEnum;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.config.json;
|
||||
package com.tiesheng.web.config.json;
|
||||
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import com.tiesheng.util.CommonUtil;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.config.mybatis;
|
||||
package com.tiesheng.web.config.mybatis;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.config.mybatis;
|
||||
package com.tiesheng.web.config.mybatis;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.config.operation;
|
||||
package com.tiesheng.web.config.operation;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
@@ -6,8 +6,9 @@ import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.annotation.operation.OperationIgnore;
|
||||
import com.tiesheng.annotation.operation.OperationLog;
|
||||
import com.tiesheng.core.service.CoreLogService;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
@@ -108,7 +109,7 @@ public class OperationAspect {
|
||||
}
|
||||
}
|
||||
|
||||
coreLogService.addOperationLog(title, subject, reqMaps);
|
||||
coreLogService.addOperationLog(TsTokenConfig.getWithoutThr(), title, subject, reqMaps);
|
||||
|
||||
return response;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.tiesheng.web.config.template;
|
||||
|
||||
import com.tiesheng.web.pojos.dto.TemplateDealDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TieshengTemplateHandler implements ToolTemplateHandler {
|
||||
@Override
|
||||
public String handler(TemplateDealDTO dto) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateUrl() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getParms(Object params) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getAction() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSort() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.tiesheng.web.config.template;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.web.pojos.dto.TemplateDealDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public interface ToolTemplateHandler {
|
||||
|
||||
|
||||
/**
|
||||
* 处理对象
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String handler(TemplateDealDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 获取模版地址
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getTemplateUrl();
|
||||
|
||||
Object getParms(Object params);
|
||||
|
||||
|
||||
/**
|
||||
* 动作说明(唯一)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getAction();
|
||||
|
||||
|
||||
/**
|
||||
* 排序,如果action相同,只会使用sort大的来处理
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getSort();
|
||||
|
||||
/**
|
||||
* 获取模版ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
default String getTeamplateId() {
|
||||
return StrUtil.format("{}_{}", getAction(), getSort());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +1,22 @@
|
||||
package com.tiesheng.core.controller;
|
||||
package com.tiesheng.web.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.ConfigFuncDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.ConfigSystemDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.EnumTypeDTO;
|
||||
import com.tiesheng.core.service.CoreConfigService;
|
||||
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.web.pojos.dto.config.ConfigSystemDTO;
|
||||
import com.tiesheng.web.pojos.dto.config.EnumTypeDTO;
|
||||
import com.tiesheng.web.service.CoreConfigService;
|
||||
import com.tiesheng.web.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -103,35 +99,4 @@ public class ConfigController {
|
||||
return ApiResp.respOK(selectList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 功能点列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/func/page")
|
||||
public ApiResp<List<CoreConfigFunc>> funcList(Integer isUsed, PageDTO dto) {
|
||||
QueryWrapper<CoreConfigFunc> queryWrapper = new QueryWrapper<CoreConfigFunc>().eq("is_deleted", 0);
|
||||
if (isUsed != null) {
|
||||
queryWrapper.eq("is_used", isUsed);
|
||||
}
|
||||
dto.likeColumns(queryWrapper, "name");
|
||||
Page<CoreConfigFunc> page = dto.pageObj();
|
||||
coreConfigService.getFuncMapper().selectPage(page, queryWrapper);
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能点更新
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/func/update")
|
||||
public ApiResp<String> funcUpdate(@Valid @RequestBody ConfigFuncDTO dto) {
|
||||
CoreConfigFunc configFunc = BeanUtil.copyProperties(dto, CoreConfigFunc.class);
|
||||
coreConfigService.getFuncMapper().updateById(configFunc);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.tiesheng.core.controller;
|
||||
package com.tiesheng.web.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.core.pojos.vo.ProcessDetailVo;
|
||||
import com.tiesheng.core.service.CoreLogService;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogMessage;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.web.pojos.vo.ProcessDetailVo;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -1,21 +1,26 @@
|
||||
package com.tiesheng.core.controller;
|
||||
package com.tiesheng.web.controller;
|
||||
|
||||
|
||||
import cn.hutool.captcha.LineCaptcha;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.pojos.dto.ChunkCheckDTO;
|
||||
import com.tiesheng.core.pojos.dto.ChunkMergeDTO;
|
||||
import com.tiesheng.core.pojos.dto.ChunkStartDTO;
|
||||
import com.tiesheng.core.pojos.dto.ImageCodeDTO;
|
||||
import com.tiesheng.core.pojos.vo.PicVerifyVo;
|
||||
import com.tiesheng.core.service.FileUploadService;
|
||||
import com.tiesheng.core.service.TimedCacheService;
|
||||
import com.tiesheng.web.config.template.ToolTemplateHandler;
|
||||
import com.tiesheng.web.pojos.dto.*;
|
||||
import com.tiesheng.web.pojos.vo.TemplateInfoVO;
|
||||
import com.tiesheng.web.pojos.vo.PicVerifyVo;
|
||||
import com.tiesheng.web.service.FileUploadService;
|
||||
import com.tiesheng.web.service.TimedCacheService;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 工具类
|
||||
*
|
||||
@@ -29,6 +34,8 @@ public class ToolController {
|
||||
TimedCacheService timedCacheService;
|
||||
@Autowired
|
||||
FileUploadService fileUploadService;
|
||||
@Autowired
|
||||
List<ToolTemplateHandler> templateHandlerList;
|
||||
|
||||
|
||||
/**
|
||||
@@ -117,4 +124,40 @@ public class ToolController {
|
||||
}
|
||||
|
||||
|
||||
@TokenIgnore
|
||||
@GetMapping("/template/info")
|
||||
public ApiResp<TemplateInfoVO> templateInfo(TemplateInfoDTO dto) {
|
||||
|
||||
List<ToolTemplateHandler> collect = templateHandlerList.stream()
|
||||
.filter(it -> Objects.equals(it.getAction(), dto.getAction()))
|
||||
.sorted((it, it2) -> it2.getSort() - it.getSort())
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(collect)) {
|
||||
throw new ApiException("没有找到对应的模版");
|
||||
}
|
||||
|
||||
ToolTemplateHandler toolTemplateHandler = collect.get(0);
|
||||
|
||||
TemplateInfoVO template = new TemplateInfoVO();
|
||||
template.setTemplateUrl(toolTemplateHandler.getTemplateUrl());
|
||||
template.setParams(toolTemplateHandler.getParms(dto.getParams()));
|
||||
template.setTemplateId(toolTemplateHandler.getTeamplateId());
|
||||
|
||||
return ApiResp.respOK(template);
|
||||
}
|
||||
|
||||
@TokenIgnore
|
||||
@PostMapping("/template/deal")
|
||||
public ApiResp<String> templateDeal(@RequestBody TemplateDealDTO dto) {
|
||||
|
||||
List<ToolTemplateHandler> collect = templateHandlerList.stream().
|
||||
filter(it -> Objects.equals(it.getTeamplateId(), dto.getTemplateId()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(collect)) {
|
||||
throw new ApiException("模版ID不存在");
|
||||
}
|
||||
|
||||
return ApiResp.respOK(collect.get(0).handler(dto));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
package com.tiesheng.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigEnum;
|
||||
|
||||
public interface CoreConfigEnumMapper extends BaseMapper<CoreConfigEnum> {
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
package com.tiesheng.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.web.pojos.dao.CoreConfigSystem;
|
||||
|
||||
public interface CoreConfigSystemMapper extends BaseMapper<CoreConfigSystem> {
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
package com.tiesheng.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogLogin;
|
||||
|
||||
public interface CoreLogLoginMapper extends BaseMapper<CoreLogLogin> {
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
package com.tiesheng.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogMessage;
|
||||
|
||||
public interface CoreLogMessageMapper extends BaseMapper<CoreLogMessage> {
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
package com.tiesheng.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CoreLogOperationMapper extends BaseMapper<CoreLogOperation> {
|
||||
|
||||
|
||||
@@ -20,4 +22,12 @@ public interface CoreLogOperationMapper extends BaseMapper<CoreLogOperation> {
|
||||
Page<CoreLogOperation> page(IPage<CoreLogOperation> page, @Param("ew") QueryWrapper<CoreLogOperation> queryWrapper);
|
||||
|
||||
|
||||
/**
|
||||
* 批量插入日志
|
||||
*
|
||||
* @param coreLogOperations
|
||||
* @return
|
||||
*/
|
||||
int batchInsert(@Param("list") List<CoreLogOperation> coreLogOperations);
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
package com.tiesheng.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogProcess;
|
||||
|
||||
public interface CoreLogProcessMapper extends BaseMapper<CoreLogProcess> {
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.core.mapper;
|
||||
package com.tiesheng.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.web.pojos.dao.CorePlatformUnique;
|
||||
|
||||
public interface CorePlatformUniqueMapper extends BaseMapper<CorePlatformUnique> {
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.pojos;
|
||||
package com.tiesheng.web.pojos;
|
||||
|
||||
/**
|
||||
* 当前token的数据
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
package com.tiesheng.web.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 配置-枚举
|
||||
@@ -107,4 +104,4 @@ public class CoreConfigEnum extends DaoBase {
|
||||
public void setExt(String ext) {
|
||||
this.ext = ext;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
package com.tiesheng.web.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 配置-系统
|
||||
@@ -141,4 +138,4 @@ public class CoreConfigSystem extends DaoBase {
|
||||
public void setReadOnly(Integer readOnly) {
|
||||
this.readOnly = readOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
package com.tiesheng.web.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-登录
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
package com.tiesheng.web.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-消息
|
||||
@@ -131,4 +128,4 @@ public class CoreLogMessage extends DaoBase {
|
||||
public void setResult(Integer result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
package com.tiesheng.web.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-操作
|
||||
@@ -131,4 +128,4 @@ public class CoreLogOperation extends DaoBase {
|
||||
public void setParams(String params) {
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
package com.tiesheng.web.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-过程
|
||||
@@ -227,4 +224,4 @@ public class CoreLogProcess extends DaoBase {
|
||||
public void setProcess(Integer process) {
|
||||
this.process = process;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user