Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a14e42ad
authored
Aug 08, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[chg] 优化代码
1 parent
ef75b2f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
src/main/java/vion/controller/UserController.java
src/main/java/vion/controller/UserController.java
View file @
a14e42a
...
...
@@ -64,7 +64,7 @@ public class UserController {
@GetMapping
(
"/user"
)
@SaCheckPermission
(
value
=
"user:query"
,
orRole
=
"admin"
)
public
User
getUserById
(
@RequestParam
(
name
=
"id"
)
Integer
id
)
{
public
User
getUserById
(
@RequestParam
Long
id
)
{
return
userService
.
getById
(
id
);
}
...
...
@@ -89,8 +89,7 @@ public class UserController {
@GetMapping
(
"/user/role/{id}"
)
@SaCheckPermission
(
value
=
"user:role"
,
orRole
=
"admin"
)
public
List
<
RoleVO
>
listRoleById
(
@PathVariable
Long
id
)
{
List
<
RUserRole
>
userRoleList
=
userRoleService
.
lambdaQuery
().
eq
(
RUserRole:
:
getUserId
,
id
).
list
();
List
<
Role
>
roleList
=
Opt
.
ofEmptyAble
(
userRoleList
)
List
<
Role
>
roleList
=
Opt
.
ofEmptyAble
(
userRoleService
.
lambdaQuery
().
eq
(
RUserRole:
:
getUserId
,
id
).
list
())
.
map
(
l
->
l
.
stream
().
map
(
RUserRole:
:
getRoleId
).
collect
(
Collectors
.
toList
()))
.
filter
(
CollUtil:
:
isNotEmpty
)
.
map
(
roleIdList
->
roleService
.
lambdaQuery
().
in
(
Role:
:
getId
,
roleIdList
).
list
())
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment