feat: myinfo
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.kamco.cd.kamcoback.members.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.kamco.cd.kamcoback.common.enums.RoleType;
|
||||
import com.kamco.cd.kamcoback.common.enums.StatusType;
|
||||
import com.kamco.cd.kamcoback.common.utils.enums.Enums;
|
||||
@@ -181,4 +182,84 @@ public class MembersDto {
|
||||
private String employeeNo;
|
||||
private String role;
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class RoleEntity {
|
||||
|
||||
private final RoleType type;
|
||||
private final String name;
|
||||
|
||||
public RoleEntity(RoleType status) {
|
||||
this.type = status;
|
||||
this.name = status.getText();
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class StatusEntity {
|
||||
|
||||
private final StatusType type;
|
||||
private final String name;
|
||||
|
||||
public StatusEntity(StatusType status) {
|
||||
this.type = status;
|
||||
this.name = status.getText();
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class EntityData {
|
||||
|
||||
@JsonIgnore private Long id;
|
||||
private UUID uuid;
|
||||
private String name;
|
||||
private String employeeNo;
|
||||
private RoleEntity role;
|
||||
private StatusEntity status;
|
||||
@JsonFormatDttm private ZonedDateTime createdDttm;
|
||||
@JsonFormatDttm private ZonedDateTime firstLoginDttm;
|
||||
@JsonFormatDttm private ZonedDateTime lastLoginDttm;
|
||||
@JsonFormatDttm private ZonedDateTime statusChgDttm;
|
||||
|
||||
private Boolean isReset;
|
||||
|
||||
public EntityData(
|
||||
Long id,
|
||||
UUID uuid,
|
||||
RoleType role,
|
||||
String name,
|
||||
String employeeNo,
|
||||
StatusType status,
|
||||
ZonedDateTime createdDttm,
|
||||
ZonedDateTime firstLoginDttm,
|
||||
ZonedDateTime lastLoginDttm,
|
||||
ZonedDateTime statusChgDttm,
|
||||
Boolean isReset) {
|
||||
this.id = id;
|
||||
this.uuid = uuid;
|
||||
this.name = name;
|
||||
this.employeeNo = employeeNo;
|
||||
this.status = new StatusEntity(status);
|
||||
this.createdDttm = createdDttm;
|
||||
this.firstLoginDttm = firstLoginDttm;
|
||||
this.lastLoginDttm = lastLoginDttm;
|
||||
this.statusChgDttm = statusChgDttm;
|
||||
this.isReset = isReset;
|
||||
this.role = new RoleEntity(role);
|
||||
}
|
||||
|
||||
private String getUserRoleName(String roleId) {
|
||||
RoleType type = Enums.fromId(RoleType.class, roleId);
|
||||
return type.getText();
|
||||
}
|
||||
|
||||
private String getStatusName(String status, Boolean pwdResetYn) {
|
||||
StatusType type = Enums.fromId(StatusType.class, status);
|
||||
pwdResetYn = pwdResetYn != null && pwdResetYn;
|
||||
if (type.equals(StatusType.PENDING) && pwdResetYn) {
|
||||
type = StatusType.ACTIVE;
|
||||
}
|
||||
return type.getText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user