feature #1

Merged
XiaoLFeng merged 3 commits from feature into master 2024-01-24 22:14:03 +08:00
4 changed files with 7 additions and 1 deletions
Showing only changes of commit dca36684d5 - Show all commits

View File

@ -12,7 +12,7 @@ public interface RoleMapper {
@Insert("insert into organize_oa.oa_role_user (uid, rid) VALUE (#{uid},#{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);
@Delete("delete from organize_oa.oa_role_user where uid=#{uid}")

View File

@ -10,6 +10,8 @@ import javax.validation.constraints.Pattern;
@Data
public class UserEditVO {
@NotNull
private Long rid;
@NotNull
private Long id;

View File

@ -74,6 +74,9 @@ public class AuthServiceImpl implements AuthService {
// 插入数据
if (userMapper.insertUser(userDO)) {
userDO.setPassword(null);
//默认角色为学生
UserDO userDO1 = userMapper.getUserByUserNum(userDO.getUsername());
roleDAO.addRoleUser(userDO1.getId(), 2L);
return ResultUtil.success("注册成功", userDO);
} else {
return ResultUtil.error(ErrorCode.DATABASE_INSERT_ERROR);

View File

@ -249,6 +249,7 @@ public class UserServiceImpl implements UserService {
.setAccountNoLocked(userEditVO.getIsLocked());
//向数据库中修改属性
userDAO.userEdit(userDO);
roleDAO.roleChangeUser(userEditVO.getId(),userEditVO.getRid());
return ResultUtil.success("用户信息修改成功");
}