Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄营
datax-cloud
Commits
e9e3cb73
Commit
e9e3cb73
authored
Nov 20, 2019
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
b0068098
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
DataUserDetailService.java
...ain/java/cn/datax/auth/service/DataUserDetailService.java
+1
-1
RedisConfig.java
...c/main/java/cn/datax/common/redis/config/RedisConfig.java
+1
-1
UserDto.java
...rc/main/java/cn/datax/service/system/api/dto/UserDto.java
+3
-3
UserServiceImpl.java
...cn/datax/service/system/service/impl/UserServiceImpl.java
+6
-6
UserMapper.xml
...t/system-service/src/main/resources/mapper/UserMapper.xml
+2
-2
No files found.
datax-auth/src/main/java/cn/datax/auth/service/DataUserDetailService.java
View file @
e9e3cb73
...
...
@@ -35,7 +35,7 @@ public class DataUserDetailService implements UserDetailsService {
//远程获取用户
R
result
=
userServiceFeign
.
loginByUsername
(
s
);
log
.
info
(
JSON
.
toJSONString
(
result
));
if
(
result
==
null
||
ObjectUtil
.
isEmpty
(
result
.
getData
())){
if
(
result
==
null
||
!
result
.
isSuccess
()
||
ObjectUtil
.
isEmpty
(
result
.
getData
())){
throw
new
UsernameNotFoundException
(
StrUtil
.
format
(
"{}用户不存在"
,
s
));
}
UserInfo
userInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
result
.
getData
()),
UserInfo
.
class
);
...
...
datax-common/datax-common-redis/src/main/java/cn/datax/common/redis/config/RedisConfig.java
View file @
e9e3cb73
...
...
@@ -57,7 +57,7 @@ public class RedisConfig extends CachingConfigurerSupport {
//不缓存null值
.
disableCachingNullValues
()
//默认缓存过期时间
.
entryTtl
(
Duration
.
of
Seconds
(
6
0
));
.
entryTtl
(
Duration
.
of
Minutes
(
3
0
));
//设置一个初始化的缓存名称set集合
Set
<
String
>
cacheNames
=
new
HashSet
<>();
...
...
datax-modules/system-service-parent/system-service-api/src/main/java/cn/datax/service/system/api/dto/UserDto.java
View file @
e9e3cb73
...
...
@@ -53,15 +53,15 @@ public class UserDto implements Serializable {
@ApiModelProperty
(
value
=
"部门"
)
@NotEmpty
(
message
=
"部门不能为空"
,
groups
=
{
ValidateGroupForSave
.
class
,
ValidateGroupForUpdate
.
class
})
@Size
(
min
=
1
,
max
=
1
,
message
=
"部门长度必须位于{min}-{max}之间"
)
private
List
<
String
>
dept
s
;
private
List
<
String
>
dept
List
;
@ApiModelProperty
(
value
=
"角色"
)
@NotEmpty
(
message
=
"角色不能为空"
,
groups
=
{
ValidateGroupForSave
.
class
,
ValidateGroupForUpdate
.
class
})
@Size
(
min
=
1
,
max
=
5
,
message
=
"角色长度必须位于{min}-{max}之间"
)
private
List
<
String
>
role
s
;
private
List
<
String
>
role
List
;
@ApiModelProperty
(
value
=
"岗位"
)
@NotEmpty
(
message
=
"岗位不能为空"
,
groups
=
{
ValidateGroupForSave
.
class
,
ValidateGroupForUpdate
.
class
})
@Size
(
min
=
1
,
max
=
1
,
message
=
"岗位长度必须位于{min}-{max}之间"
)
private
List
<
String
>
post
s
;
private
List
<
String
>
post
List
;
}
datax-modules/system-service-parent/system-service/src/main/java/cn/datax/service/system/service/impl/UserServiceImpl.java
View file @
e9e3cb73
...
...
@@ -63,9 +63,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
String
passwordEncode
=
new
BCryptPasswordEncoder
().
encode
(
user
.
getPassword
());
user
.
setPassword
(
passwordEncode
);
userDao
.
insert
(
user
);
insertBatchRole
(
userDto
.
getRole
s
(),
user
.
getId
());
insertBatchDept
(
userDto
.
getDept
s
(),
user
.
getId
());
insertBatchPost
(
userDto
.
getPost
s
(),
user
.
getId
());
insertBatchRole
(
userDto
.
getRole
List
(),
user
.
getId
());
insertBatchDept
(
userDto
.
getDept
List
(),
user
.
getId
());
insertBatchPost
(
userDto
.
getPost
List
(),
user
.
getId
());
}
private
void
insertBatchPost
(
List
<
String
>
posts
,
String
userId
)
{
...
...
@@ -108,13 +108,13 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
userDao
.
updateById
(
user
);
userRoleDao
.
delete
(
Wrappers
.<
UserRoleEntity
>
lambdaQuery
()
.
eq
(
UserRoleEntity:
:
getUserId
,
user
.
getId
()));
insertBatchRole
(
userDto
.
getRole
s
(),
user
.
getId
());
insertBatchRole
(
userDto
.
getRole
List
(),
user
.
getId
());
userDeptDao
.
delete
(
Wrappers
.<
UserDeptEntity
>
lambdaQuery
()
.
eq
(
UserDeptEntity:
:
getUserId
,
user
.
getId
()));
insertBatchDept
(
userDto
.
getDept
s
(),
user
.
getId
());
insertBatchDept
(
userDto
.
getDept
List
(),
user
.
getId
());
userPostDao
.
delete
(
Wrappers
.<
UserPostEntity
>
lambdaQuery
()
.
eq
(
UserPostEntity:
:
getUserId
,
user
.
getId
()));
insertBatchPost
(
userDto
.
getPost
s
(),
user
.
getId
());
insertBatchPost
(
userDto
.
getPost
List
(),
user
.
getId
());
}
@Override
...
...
datax-modules/system-service-parent/system-service/src/main/resources/mapper/UserMapper.xml
View file @
e9e3cb73
...
...
@@ -54,7 +54,7 @@
<property
name=
"alias"
value=
"r"
/>
</include>
from sys_role r
left join sys_user_role ur on
d
.id = ur.role_id
left join sys_user_role ur on
r
.id = ur.role_id
where 1 = 1 and r.status = 1
<if
test=
"null != userId and '' != userId"
>
and ur.user_id = #{userId}
...
...
@@ -67,7 +67,7 @@
<property
name=
"alias"
value=
"p"
/>
</include>
from sys_post p
left join sys_user_post up on
d
.id = up.post_id
left join sys_user_post up on
p
.id = up.post_id
where 1 = 1 and p.status = 1
<if
test=
"null != userId and '' != userId"
>
and up.user_id = #{userId}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment