Skip to content

Commit ca576e1

Browse files
authored
Merge pull request #58 from zlt2000/dev
Dev
2 parents 610e17e + f8340fa commit ca576e1

File tree

116 files changed

+2148
-1280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2148
-1280
lines changed

pom.xml

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.zlt</groupId>
77
<artifactId>central-platform</artifactId>
8-
<version>5.5.0</version>
8+
<version>5.6.0</version>
99
<packaging>pom</packaging>
1010

1111
<properties>
@@ -50,7 +50,7 @@
5050
<hibernate-validator.version>6.2.0.Final</hibernate-validator.version>
5151
<dubbo.version>2.7.8</dubbo.version>
5252
<curator.version>5.1.0</curator.version>
53-
<jackson-databind.version>2.12.4</jackson-databind.version>
53+
<jackson-databind.version>2.13.4</jackson-databind.version>
5454
<commons-configuration.version>1.10</commons-configuration.version>
5555
<zuul.version>2.2.9.RELEASE</zuul.version>
5656
<aws-java-sdk-s3.version>1.12.40</aws-java-sdk-s3.version>
@@ -62,6 +62,7 @@
6262
<docker.image.prefix>hub.zlt.com:8080/microservices-platform</docker.image.prefix>
6363
<docker.java.security.egd>-Djava.security.egd=file:/dev/./urandom</docker.java.security.egd>
6464
<docker.java.opts>-Xms128m -Xmx128m</docker.java.opts>
65+
<guava.version>20.0</guava.version>
6566
</properties>
6667

6768
<dependencies>
@@ -430,6 +431,11 @@
430431
<type>pom</type>
431432
<scope>import</scope>
432433
</dependency>
434+
<dependency>
435+
<groupId>com.google.guava</groupId>
436+
<artifactId>guava</artifactId>
437+
<version>${guava.version}</version>
438+
</dependency>
433439
</dependencies>
434440
</dependencyManagement>
435441

@@ -483,7 +489,7 @@
483489
<!-- 业务 -->
484490
<module>zlt-business</module>
485491
<!-- 前端 -->
486-
<!--<module>zlt-web</module>-->
492+
<module>zlt-web</module>
487493
<!-- 任务 -->
488494
<module>zlt-job</module>
489495
<!-- 监控 -->

zlt-business/code-generator/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>zlt-business</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>code-generator</artifactId>
1010

zlt-business/file-center/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>zlt-business</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>file-center</artifactId>
1010
<description>文件中心</description>

zlt-business/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>central-platform</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>zlt-business</artifactId>
1010
<description>业务中心</description>

zlt-business/search-center/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>zlt-business</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>search-center</artifactId>
1010
<description>搜索中心</description>

zlt-business/search-center/search-client/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>search-center</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>search-client</artifactId>
1010
<description>搜索中心客户端</description>

zlt-business/search-center/search-server/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>search-center</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>search-server</artifactId>
1010
<description>搜索中心服务端</description>

zlt-business/user-center/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>zlt-business</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>user-center</artifactId>
1010
<description>用户中心</description>

zlt-business/user-center/src/main/java/com/central/user/controller/SysMenuController.java

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import cn.hutool.core.util.ObjectUtil;
99
import com.central.common.annotation.LoginUser;
1010
import com.central.common.constant.CommonConstant;
11+
import com.central.common.context.LoginUserContextHolder;
1112
import com.central.common.model.*;
1213
import lombok.extern.slf4j.Slf4j;
1314
import org.apache.commons.lang3.StringUtils;
@@ -147,6 +148,9 @@ public PageResult<SysMenu> findOnes() {
147148
@PostMapping("saveOrUpdate")
148149
public Result saveOrUpdate(@RequestBody SysMenu menu) {
149150
try {
151+
if (menu.getId() == null) {
152+
menu.setCreatorId(LoginUserContextHolder.getUser().getId());
153+
}
150154
menuService.saveOrUpdate(menu);
151155
return Result.succeed("操作成功");
152156
} catch (Exception ex) {

zlt-business/user-center/src/main/java/com/central/user/controller/SysUserController.java

+18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.util.Set;
88

99
import cn.hutool.core.bean.BeanUtil;
10+
import cn.hutool.core.util.ObjectUtil;
1011
import com.central.common.annotation.LoginUser;
1112
import com.central.common.constant.CommonConstant;
1213
import com.central.common.model.*;
@@ -286,6 +287,23 @@ public PageResult<JsonNode> search(SearchDto searchDto) {
286287
return queryService.strQuery("sys_user", searchDto, SEARCH_LOGIC_DEL_DTO);
287288
}
288289

290+
/**
291+
* 获取用户并返回角色列表
292+
* @param username
293+
* @return
294+
*/
295+
@GetMapping(value = "/users/roleUser/{username}")
296+
@ApiOperation(value = "查询用户-带角色信息")
297+
@Cacheable(value = "userRoles", key = "#username")
298+
public SysUser selectRoleUser(@PathVariable("username") String username){
299+
SysUser sysUser = selectByUsername(username);
300+
if(ObjectUtil.isNotNull(sysUser)){
301+
List<SysRole> roleList = findRolesByUserId(sysUser.getId());
302+
sysUser.setRoles(roleList);
303+
}
304+
return sysUser;
305+
}
306+
289307
/**
290308
* 是否超级管理员
291309
*/

zlt-business/user-center/src/main/java/com/central/user/service/impl/SysRoleServiceImpl.java

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
77
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
88
import com.central.common.constant.CommonConstant;
9+
import com.central.common.context.LoginUserContextHolder;
910
import com.central.common.lock.DistributedLock;
1011
import com.central.common.model.*;
1112
import com.central.common.service.impl.SuperServiceImpl;
@@ -69,6 +70,7 @@ public PageResult<SysRole> findRoles(Map<String, Object> params) {
6970
@Transactional
7071
public Result saveOrUpdateRole(SysRole sysRole) throws Exception {
7172
if (sysRole.getId() == null) {
73+
sysRole.setCreatorId(LoginUserContextHolder.getUser().getId());
7274
this.saveRole(sysRole);
7375
} else {
7476
baseMapper.updateById(sysRole);

zlt-business/user-center/src/main/java/com/central/user/service/impl/SysUserServiceImpl.java

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
88
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
99
import com.central.common.constant.CommonConstant;
10+
import com.central.common.context.LoginUserContextHolder;
1011
import com.central.common.lock.DistributedLock;
1112
import com.central.common.model.*;
1213
import com.central.common.service.impl.SuperServiceImpl;
@@ -226,6 +227,7 @@ public Result saveOrUpdateUser(SysUser sysUser) throws Exception {
226227
}
227228
sysUser.setPassword(passwordEncoder.encode(CommonConstant.DEF_USER_PASSWORD));
228229
sysUser.setEnabled(Boolean.TRUE);
230+
sysUser.setCreatorId(LoginUserContextHolder.getUser().getId());
229231
}
230232
String username = sysUser.getUsername();
231233
boolean result = super.saveOrUpdateIdempotency(sysUser, lock

zlt-business/user-center/src/main/resources/application.yml

+13
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ zlt:
3838
- com.central.user.mapper.SysRoleMapper.findAll
3939
# 用户列表显示用户所关联的所有角色
4040
- com.central.user.mapper.SysUserRoleMapper.findRolesByUserIds
41+
# 数据权限
42+
datascope:
43+
enabled: false
44+
ignoreTables:
45+
- sys_role_user
46+
- sys_role_menu
47+
includeSqls:
48+
# 用户列表
49+
- com.central.user.mapper.SysUserMapper.findList
50+
# 角色列表
51+
- com.central.user.mapper.SysRoleMapper.findList
52+
# 菜单列表
53+
- com.central.user.mapper.SysMenuMapper.selectList
4154
#审计日志
4255
# audit-log:
4356
# enabled: true

zlt-business/user-center/src/main/resources/mapper/SysRoleMapper.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
name,
99
create_time,
1010
update_time,
11-
tenant_id
11+
tenant_id,
12+
data_scope
1213
</sql>
1314

1415
<sql id="where">

zlt-commons/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>central-platform</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>zlt-commons</artifactId>
1010
<description>通用组件</description>

zlt-commons/zlt-auth-client-spring-boot-starter/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.zlt</groupId>
77
<artifactId>zlt-commons</artifactId>
8-
<version>5.5.0</version>
8+
<version>5.6.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111
<packaging>jar</packaging>

zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/properties/AuthProperties.java

+11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
* 认证配置
88
*
99
* @author zlt
10+
* @version 1.0
11+
* @date 2019/1/19
12+
* <p>
13+
* Blog: https://zlt2000.gitee.io
14+
* Github: https://github.com/zlt2000
1015
*/
1116
@Setter
1217
@Getter
@@ -47,4 +52,10 @@ public class AuthProperties {
4752
* false: 就算使用同一账号登录时都会新建一个token
4853
*/
4954
private Boolean isShareToken = true;
55+
56+
/**
57+
* 参数加密(rsa),对应的私钥(用于解密)
58+
* 默认私钥对应的公钥为:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6u4sP969hZP7BUEeAXJlq5wEmZ2CIZU4+5JADY8Ium55qGaE5qXEwMaV+M2HFWU4PZbHfH+RGEIMwjkARRok93krFnJuuwTjLwgyUSsKm5M7v3Ek8zdqs474v1qOxqE6BmHz9QJfgnAtFYxwEyVRoQ12+IAhpOzDU3rz02VR05kGCrgGU6szxDtp6cQ+u9ACGPy/uKdIQ6H7aM/oxMyPlwK9H38ni6Lxai7q56qp6F1p7drxh8CWJZ3j0NicB5ZPnOMtrGL5lfnifHBjB+CDJXv8kffY0zwL3J+LrnyFbpKeNeMJZpykoYW85Pdz+8WnE9KGMM3EeOeD/QX/OfMdFQIDAQAB
59+
*/
60+
private String decryptParamPrivateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDq7iw/3r2Fk/sFQR4BcmWrnASZnYIhlTj7kkANjwi6bnmoZoTmpcTAxpX4zYcVZTg9lsd8f5EYQgzCOQBFGiT3eSsWcm67BOMvCDJRKwqbkzu/cSTzN2qzjvi/Wo7GoToGYfP1Al+CcC0VjHATJVGhDXb4gCGk7MNTevPTZVHTmQYKuAZTqzPEO2npxD670AIY/L+4p0hDoftoz+jEzI+XAr0ffyeLovFqLurnqqnoXWnt2vGHwJYlnePQ2JwHlk+c4y2sYvmV+eJ8cGMH4IMle/yR99jTPAvcn4uufIVukp414wlmnKShhbzk93P7xacT0oYwzcR454P9Bf858x0VAgMBAAECggEBAJxK94VGWi+T01wbhirQQHN6yFSqRPiyncY/9f0PO29MMAOosKIBhnP5qaxsj4HcZR4UQYLCG3VX+8T6xwMx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twIfK0Wf1gWdAxC6vvv3DQ7zXbTlvqMdVOFzCKlocCYkzWMvIsejWXnW";
5061
}

zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/properties/PermitProperties.java

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
* 配置需要放权的url白名单
1111
*
1212
* @author zlt
13+
* @version 1.0
14+
* @date 2019/1/19
15+
* <p>
16+
* Blog: https://zlt2000.gitee.io
17+
* Github: https://github.com/zlt2000
1318
*/
1419
@Setter
1520
@Getter

zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/properties/RenewProperties.java

+4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
* 续签配置
1111
*
1212
* @author zlt
13+
* @version 1.0
1314
* @date 2019/7/9
15+
* <p>
16+
* Blog: https://zlt2000.gitee.io
17+
* Github: https://github.com/zlt2000
1418
*/
1519
@Setter
1620
@Getter

zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/properties/SecurityProperties.java

+4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77

88
/**
99
* @author zlt
10+
* @version 1.0
1011
* @date 2019/1/4
12+
* <p>
13+
* Blog: https://zlt2000.gitee.io
14+
* Github: https://github.com/zlt2000
1115
*/
1216
@Setter
1317
@Getter

zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/properties/UrlPermissionProperties.java

+4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
* url权限配置
1111
*
1212
* @author zlt
13+
* @version 1.0
1314
* @date 2019/8/2
15+
* <p>
16+
* Blog: https://zlt2000.gitee.io
17+
* Github: https://github.com/zlt2000
1418
*/
1519
@Setter
1620
@Getter

zlt-commons/zlt-common-core/pom.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.zlt</groupId>
66
<artifactId>zlt-commons</artifactId>
7-
<version>5.5.0</version>
7+
<version>5.6.0</version>
88
</parent>
99
<artifactId>zlt-common-core</artifactId>
1010
<description>公共通用组件</description>
@@ -89,5 +89,9 @@
8989
<groupId>com.fasterxml.jackson.core</groupId>
9090
<artifactId>jackson-databind</artifactId>
9191
</dependency>
92+
<dependency>
93+
<groupId>com.google.guava</groupId>
94+
<artifactId>guava</artifactId>
95+
</dependency>
9296
</dependencies>
9397
</project>

zlt-commons/zlt-common-core/src/main/java/com/central/common/constant/CommonConstant.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public interface CommonConstant {
1010
/**
1111
* 项目版本号(banner使用)
1212
*/
13-
String PROJECT_VERSION = "5.5.0";
13+
String PROJECT_VERSION = "5.6.0";
1414

1515
/**
1616
* token请求头名称

0 commit comments

Comments
 (0)