feat: format error
This commit is contained in:
@@ -43,7 +43,15 @@ public class AuditLogEntity extends CommonCreateEntity {
|
||||
@Column(name = "error_log_uid")
|
||||
private Long errorLogUid;
|
||||
|
||||
public AuditLogEntity(Long userUid, EventType eventType, EventStatus eventStatus, String menuUid, String ipAddress, String requestUri, String requestBody, Long errorLogUid) {
|
||||
public AuditLogEntity(
|
||||
Long userUid,
|
||||
EventType eventType,
|
||||
EventStatus eventStatus,
|
||||
String menuUid,
|
||||
String ipAddress,
|
||||
String requestUri,
|
||||
String requestBody,
|
||||
Long errorLogUid) {
|
||||
this.userUid = userUid;
|
||||
this.eventType = eventType;
|
||||
this.eventStatus = eventStatus;
|
||||
@@ -56,29 +64,37 @@ public class AuditLogEntity extends CommonCreateEntity {
|
||||
|
||||
public AuditLogDto.Basic toDto() {
|
||||
return new AuditLogDto.Basic(
|
||||
this.id,
|
||||
this.userUid,
|
||||
this.eventType,
|
||||
this.eventStatus,
|
||||
this.menuUid,
|
||||
this.ipAddress,
|
||||
this.requestUri,
|
||||
this.requestBody,
|
||||
this.errorLogUid,
|
||||
super.getCreatedDate());
|
||||
this.id,
|
||||
this.userUid,
|
||||
this.eventType,
|
||||
this.eventStatus,
|
||||
this.menuUid,
|
||||
this.ipAddress,
|
||||
this.requestUri,
|
||||
this.requestBody,
|
||||
this.errorLogUid,
|
||||
super.getCreatedDate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(this.id).append("\n")
|
||||
.append(this.userUid).append("\n")
|
||||
.append(this.eventType).append("\n")
|
||||
.append(this.eventStatus).append("\n")
|
||||
.append(this.menuUid).append("\n")
|
||||
.append(this.ipAddress).append("\n")
|
||||
.append(this.requestUri).append("\n")
|
||||
.append(this.requestBody).append("\n")
|
||||
sb.append(this.id)
|
||||
.append("\n")
|
||||
.append(this.userUid)
|
||||
.append("\n")
|
||||
.append(this.eventType)
|
||||
.append("\n")
|
||||
.append(this.eventStatus)
|
||||
.append("\n")
|
||||
.append(this.menuUid)
|
||||
.append("\n")
|
||||
.append(this.ipAddress)
|
||||
.append("\n")
|
||||
.append(this.requestUri)
|
||||
.append("\n")
|
||||
.append(this.requestBody)
|
||||
.append("\n")
|
||||
.append(this.errorLogUid);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -61,7 +61,8 @@ public class CommonCodeEntity extends CommonDateEntity {
|
||||
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
|
||||
private List<CommonCodeEntity> children = new ArrayList<>();
|
||||
|
||||
public CommonCodeEntity(String code, String name, String description, Integer order, Boolean used) {
|
||||
public CommonCodeEntity(
|
||||
String code, String name, String description, Integer order, Boolean used) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
@@ -69,7 +70,8 @@ public class CommonCodeEntity extends CommonDateEntity {
|
||||
this.used = used;
|
||||
}
|
||||
|
||||
public CommonCodeEntity(Long id, String name, String description, Integer order, Boolean used, Boolean deleted) {
|
||||
public CommonCodeEntity(
|
||||
Long id, String name, String description, Integer order, Boolean used, Boolean deleted) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
@@ -80,19 +82,18 @@ public class CommonCodeEntity extends CommonDateEntity {
|
||||
|
||||
public CommonCodeDto.Basic toDto() {
|
||||
return new CommonCodeDto.Basic(
|
||||
this.id,
|
||||
this.code,
|
||||
this.description,
|
||||
this.name,
|
||||
this.order,
|
||||
this.used,
|
||||
this.deleted,
|
||||
this.children.stream().map(CommonCodeEntity::toDto).toList(),
|
||||
super.getCreatedDate(),
|
||||
super.getModifiedDate());
|
||||
this.id,
|
||||
this.code,
|
||||
this.description,
|
||||
this.name,
|
||||
this.order,
|
||||
this.used,
|
||||
this.deleted,
|
||||
this.children.stream().map(CommonCodeEntity::toDto).toList(),
|
||||
super.getCreatedDate(),
|
||||
super.getModifiedDate());
|
||||
}
|
||||
|
||||
|
||||
public void addParent(CommonCodeEntity parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@@ -4,13 +4,11 @@ import com.kamco.cd.kamcoback.log.dto.ErrorLogDto;
|
||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
||||
import com.kamco.cd.kamcoback.postgres.CommonCreateEntity;
|
||||
import jakarta.persistence.*;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@@ -30,14 +28,22 @@ public class ErrorLogEntity extends CommonCreateEntity {
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private ErrorLogDto.LogErrorLevel errorLevel;
|
||||
|
||||
private String errorCode;
|
||||
private String errorMessage;
|
||||
private String stackTrace;
|
||||
private Long handlerUid;
|
||||
private ZonedDateTime handledDttm;
|
||||
|
||||
public ErrorLogEntity(String requestId, EventType errorType, ErrorLogDto.LogErrorLevel errorLevel, String errorCode, String errorMessage, String stackTrace
|
||||
, Long handlerUid, ZonedDateTime handledDttm) {
|
||||
public ErrorLogEntity(
|
||||
String requestId,
|
||||
EventType errorType,
|
||||
ErrorLogDto.LogErrorLevel errorLevel,
|
||||
String errorCode,
|
||||
String errorMessage,
|
||||
String stackTrace,
|
||||
Long handlerUid,
|
||||
ZonedDateTime handledDttm) {
|
||||
this.requestId = requestId;
|
||||
this.errorType = errorType;
|
||||
this.errorLevel = errorLevel;
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
||||
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.log.dto.ErrorLogDto;
|
||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
||||
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
|
||||
import jakarta.persistence.*;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@@ -27,15 +24,14 @@ public class UserEntity extends CommonDateEntity {
|
||||
private String userId;
|
||||
|
||||
@Column(name = "pswd")
|
||||
private String pswd; //TODO: 암호화
|
||||
private String pswd; // TODO: 암호화
|
||||
|
||||
//@Enumerated(EnumType.STRING)
|
||||
private String state; //TODO: 추후 enum -> ACTIVE : 정상, LOCKED : 잠김, EXPIRED : 만료, WITHDRAWAL : 탈퇴
|
||||
// @Enumerated(EnumType.STRING)
|
||||
private String state; // TODO: 추후 enum -> ACTIVE : 정상, LOCKED : 잠김, EXPIRED : 만료, WITHDRAWAL : 탈퇴
|
||||
|
||||
private ZonedDateTime dateWithdrawal;
|
||||
|
||||
private String userEmail;
|
||||
private Long createdUid;
|
||||
private Long updatedUid;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user