feat: myinfo

This commit is contained in:
2025-12-24 12:37:32 +09:00
parent 08aa35f9e8
commit 5d297ba456
6 changed files with 198 additions and 0 deletions

View File

@@ -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();
}
}
}