角色修改
This commit is contained in:
parent
eb37df945c
commit
dca36684d5
@ -12,7 +12,7 @@ public interface RoleMapper {
|
|||||||
@Insert("insert into organize_oa.oa_role_user (uid, rid) VALUE (#{uid},#{rid})")
|
@Insert("insert into organize_oa.oa_role_user (uid, rid) VALUE (#{uid},#{rid})")
|
||||||
void roleAddUser(Long uid, Long rid);
|
void roleAddUser(Long uid, Long rid);
|
||||||
|
|
||||||
@Select("INSERT INTO organize_oa.oa_role (role_name) VALUES (#{roleName})")
|
@Select("INSERT INTO organize_oa.oa_role (role_name,display_name) VALUES (#{roleName,display_name})")
|
||||||
void roleAdd(RoleDO roleDO);
|
void roleAdd(RoleDO roleDO);
|
||||||
|
|
||||||
@Delete("delete from organize_oa.oa_role_user where uid=#{uid}")
|
@Delete("delete from organize_oa.oa_role_user where uid=#{uid}")
|
||||||
|
@ -10,6 +10,8 @@ import javax.validation.constraints.Pattern;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class UserEditVO {
|
public class UserEditVO {
|
||||||
|
@NotNull
|
||||||
|
private Long rid;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private Long id;
|
private Long id;
|
||||||
|
@ -74,6 +74,9 @@ public class AuthServiceImpl implements AuthService {
|
|||||||
// 插入数据
|
// 插入数据
|
||||||
if (userMapper.insertUser(userDO)) {
|
if (userMapper.insertUser(userDO)) {
|
||||||
userDO.setPassword(null);
|
userDO.setPassword(null);
|
||||||
|
//默认角色为学生
|
||||||
|
UserDO userDO1 = userMapper.getUserByUserNum(userDO.getUsername());
|
||||||
|
roleDAO.addRoleUser(userDO1.getId(), 2L);
|
||||||
return ResultUtil.success("注册成功", userDO);
|
return ResultUtil.success("注册成功", userDO);
|
||||||
} else {
|
} else {
|
||||||
return ResultUtil.error(ErrorCode.DATABASE_INSERT_ERROR);
|
return ResultUtil.error(ErrorCode.DATABASE_INSERT_ERROR);
|
||||||
|
@ -249,6 +249,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
.setAccountNoLocked(userEditVO.getIsLocked());
|
.setAccountNoLocked(userEditVO.getIsLocked());
|
||||||
//向数据库中修改属性
|
//向数据库中修改属性
|
||||||
userDAO.userEdit(userDO);
|
userDAO.userEdit(userDO);
|
||||||
|
roleDAO.roleChangeUser(userEditVO.getId(),userEditVO.getRid());
|
||||||
|
|
||||||
return ResultUtil.success("用户信息修改成功");
|
return ResultUtil.success("用户信息修改成功");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user