modify userInfo
This commit is contained in:
parent
1e3e66a1a6
commit
6dac497391
|
|
@ -2,8 +2,11 @@ package com.wj.manager.dto;
|
|||
|
||||
import com.wj.manager.entity.AccountEntity;
|
||||
import com.wj.manager.enums.CollegeTypeEnum;
|
||||
import com.wj.manager.enums.RoleTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AccountInfoDTO {
|
||||
private Long userId;
|
||||
|
|
@ -14,6 +17,7 @@ public class AccountInfoDTO {
|
|||
private String birthday;
|
||||
private String phone;
|
||||
private String college;
|
||||
private List<String> roles;
|
||||
|
||||
public AccountInfoDTO(AccountEntity entity) {
|
||||
this.userId = entity.getId();
|
||||
|
|
@ -24,5 +28,6 @@ public class AccountInfoDTO {
|
|||
this.birthday = entity.getBirthday();
|
||||
this.phone = entity.getPhone();
|
||||
this.college = CollegeTypeEnum.getNameByType(entity.getCollege());
|
||||
this.roles = List.of(RoleTypeEnum.getByCode(entity.getRole()).getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import lombok.Getter;
|
|||
@AllArgsConstructor
|
||||
public enum RoleTypeEnum {
|
||||
UNKNOWN(0, "未知"),
|
||||
ADMIN(1, "管理员"),
|
||||
TEACHER(2, "教师"),
|
||||
STUDENT(3, "学生"),
|
||||
ADMIN(1, "admin"),
|
||||
TEACHER(2, "teacher"),
|
||||
STUDENT(3, "student"),
|
||||
;
|
||||
private final Integer code;
|
||||
private final String message;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user