Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a9bde971
authored
Oct 07, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:调整删除角色入参
1 parent
1a45eacb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
project-interface/src/main/java/com/dituhui/pea/user/IRole.java
project-user/src/main/java/com/dituhui/pea/user/controller/RoleController.java
project-user/src/main/java/com/dituhui/pea/user/service/RoleService.java
project-interface/src/main/java/com/dituhui/pea/user/IRole.java
View file @
a9bde97
...
@@ -46,7 +46,7 @@ public interface IRole {
...
@@ -46,7 +46,7 @@ public interface IRole {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/pea-user/role/delete"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/pea-user/role/delete"
,
method
=
RequestMethod
.
POST
)
Result
<
Boolean
>
deleteRole
(
@Request
Param
(
"id"
)
String
roleId
);
Result
<
Boolean
>
deleteRole
(
@Request
Body
RoleInfo
roleInfo
);
/**
/**
* 添加用户角色
* 添加用户角色
...
...
project-user/src/main/java/com/dituhui/pea/user/controller/RoleController.java
View file @
a9bde97
...
@@ -46,11 +46,11 @@ public class RoleController implements IRole {
...
@@ -46,11 +46,11 @@ public class RoleController implements IRole {
}
}
@Override
@Override
public
Result
<
Boolean
>
deleteRole
(
String
roleId
)
{
public
Result
<
Boolean
>
deleteRole
(
RoleInfo
roleInfo
)
{
if
(
StringUtils
.
isBlank
(
roleI
d
))
{
if
(
StringUtils
.
isBlank
(
roleI
nfo
.
getId
()
))
{
return
Result
.
failed
(
StatusCodeEnum
.
COMMON_PARAM_EMPTY
,
false
);
return
Result
.
failed
(
StatusCodeEnum
.
COMMON_PARAM_EMPTY
,
false
);
}
}
roleService
.
deleteRole
(
roleI
d
);
roleService
.
deleteRole
(
roleI
nfo
.
getId
()
);
return
Result
.
success
(
true
);
return
Result
.
success
(
true
);
}
}
...
...
project-user/src/main/java/com/dituhui/pea/user/service/RoleService.java
View file @
a9bde97
...
@@ -66,13 +66,13 @@ public class RoleService {
...
@@ -66,13 +66,13 @@ public class RoleService {
public
RoleInfo
addRole
(
RoleInfo
roleInfo
)
{
public
RoleInfo
addRole
(
RoleInfo
roleInfo
)
{
RoleEntity
roleEntity
=
BeanUtil
.
copyProperties
(
roleInfo
,
RoleEntity
.
class
);
RoleEntity
roleEntity
=
BeanUtil
.
copyProperties
(
roleInfo
,
RoleEntity
.
class
);
roleEntity
=
roleDao
.
save
(
roleEntity
);
roleEntity
=
roleDao
.
save
(
roleEntity
);
List
<
RoleResourceInfo
>
resourceInfos
=
roleInfo
.
getResourceInfos
();
//
List<RoleResourceInfo> resourceInfos = roleInfo.getResourceInfos();
if
(
CollectionUtils
.
isNotEmpty
(
resourceInfos
))
{
//
if (CollectionUtils.isNotEmpty(resourceInfos)) {
for
(
RoleResourceInfo
resourceInfo
:
resourceInfos
)
{
//
for (RoleResourceInfo resourceInfo : resourceInfos) {
RoleResourceEntity
roleResourceEntity
=
assembleRoleResource
(
roleEntity
.
getId
(),
resourceInfo
.
getResourceId
());
//
RoleResourceEntity roleResourceEntity = assembleRoleResource(roleEntity.getId(), resourceInfo.getResourceId());
roleResourceDao
.
save
(
roleResourceEntity
);
//
roleResourceDao.save(roleResourceEntity);
}
//
}
}
//
}
roleInfo
=
BeanUtil
.
copyProperties
(
roleEntity
,
RoleInfo
.
class
);
roleInfo
=
BeanUtil
.
copyProperties
(
roleEntity
,
RoleInfo
.
class
);
return
roleInfo
;
return
roleInfo
;
}
}
...
...
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