修改完善CRUD

This commit is contained in:
longbinbin
2024-11-29 11:39:42 +08:00
parent abf7bf9bda
commit 33b7cd630c
7 changed files with 38 additions and 56 deletions

View File

@ -60,8 +60,8 @@ public class AdminUserServiceImpl implements AdminUserService {
String id = addOrUpdateAdminUserReqVO.getId();
if (StringUtils.isBlank(id)) {
addOrUpdateAdminUserReqVO.setId(SnowFlakeUtil.getId());
String password = addOrUpdateAdminUserReqVO.getPassword();
addOrUpdateAdminUserReqVO.setPassword(password);
// String password = addOrUpdateAdminUserReqVO.getPassword();
// addOrUpdateAdminUserReqVO.setPassword(password);
int add = adminUserMapper.add(addOrUpdateAdminUserReqVO);
if (add > 0) {
return ApiResponse.buildSuccessResponse(null);

View File

@ -37,9 +37,9 @@ public class RoleServiceImpl implements RoleService {
@Override
public ApiResponse list(RoleListReqVO roleListReqVO) {
PageHelper.startPage(roleListReqVO.getPage(),roleListReqVO.getPageSize());
if(roleListReqVO.getType()==null){
roleListReqVO.setType(0);
}
// if(roleListReqVO.getType()==null){
// roleListReqVO.setType(0);
// }
List<RoleListRespVO> list = roleMapper.list(roleListReqVO);
PageInfo<RoleListRespVO> pageInfo = new PageInfo(list);
return ApiResponse.buildSuccessResponse(pageInfo);
@ -52,7 +52,9 @@ public class RoleServiceImpl implements RoleService {
String roleId = SnowFlakeUtil.getId();
addOrUpdateRoleReqVO.setId(roleId);
if(roleMapper.add(addOrUpdateRoleReqVO)>0){
menuMapper.addRoleMenu(roleId,addOrUpdateRoleReqVO.getMenuIdList());
if(addOrUpdateRoleReqVO.getMenuIdList()!=null&addOrUpdateRoleReqVO.getMenuIdList().size()>0) {
menuMapper.addRoleMenu(roleId, addOrUpdateRoleReqVO.getMenuIdList());
}
return ApiResponse.buildSuccessResponse(null);
}
}else {