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