feat: format error
This commit is contained in:
@@ -3,6 +3,9 @@ package com.kamco.cd.kamcoback.log.dto;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -11,18 +14,13 @@ import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
public class AuditLogDto {
|
||||
|
||||
@Schema(name = "AuditLogBasic", description = "감사로그 기본 정보")
|
||||
@Getter
|
||||
public static class Basic {
|
||||
|
||||
@JsonIgnore
|
||||
private final Long id;
|
||||
@JsonIgnore private final Long id;
|
||||
private final Long userUid;
|
||||
private final EventType eventType;
|
||||
private final EventStatus eventStatus;
|
||||
@@ -32,30 +30,29 @@ public class AuditLogDto {
|
||||
private final String requestBody;
|
||||
private final Long errorLogUid;
|
||||
|
||||
@JsonFormatDttm
|
||||
private final ZonedDateTime createdDttm;
|
||||
@JsonFormatDttm private final ZonedDateTime createdDttm;
|
||||
|
||||
public Basic(
|
||||
Long id,
|
||||
Long userUid,
|
||||
EventType eventType,
|
||||
EventStatus eventStatus,
|
||||
String menuUid,
|
||||
String ipAddress,
|
||||
String requestUri,
|
||||
String requestBody,
|
||||
Long errorLogUid,
|
||||
ZonedDateTime createdDttm) {
|
||||
this.id = id;
|
||||
this.userUid = userUid;
|
||||
this.eventType = eventType;
|
||||
this.eventStatus = eventStatus;
|
||||
this.menuUid = menuUid;
|
||||
this.ipAddress = ipAddress;
|
||||
this.requestUri = requestUri;
|
||||
this.requestBody = requestBody;
|
||||
this.errorLogUid = errorLogUid;
|
||||
this.createdDttm = createdDttm;
|
||||
Long id,
|
||||
Long userUid,
|
||||
EventType eventType,
|
||||
EventStatus eventStatus,
|
||||
String menuUid,
|
||||
String ipAddress,
|
||||
String requestUri,
|
||||
String requestBody,
|
||||
Long errorLogUid,
|
||||
ZonedDateTime createdDttm) {
|
||||
this.id = id;
|
||||
this.userUid = userUid;
|
||||
this.eventType = eventType;
|
||||
this.eventStatus = eventStatus;
|
||||
this.menuUid = menuUid;
|
||||
this.ipAddress = ipAddress;
|
||||
this.requestUri = requestUri;
|
||||
this.requestBody = requestBody;
|
||||
this.errorLogUid = errorLogUid;
|
||||
this.createdDttm = createdDttm;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +73,13 @@ public class AuditLogDto {
|
||||
private Long menuId;
|
||||
private String menuName;
|
||||
|
||||
public AuditList(LocalDateTime baseDate, int readCount, int cudCount, int printCount, int downloadCount, Long totalCount){
|
||||
public AuditList(
|
||||
LocalDateTime baseDate,
|
||||
int readCount,
|
||||
int cudCount,
|
||||
int printCount,
|
||||
int downloadCount,
|
||||
Long totalCount) {
|
||||
this.baseDate = baseDate;
|
||||
this.readCount = readCount;
|
||||
this.cudCount = cudCount;
|
||||
@@ -103,7 +106,7 @@ public class AuditLogDto {
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public static class LogDetail{
|
||||
public static class LogDetail {
|
||||
String serviceName;
|
||||
String parentMenuName;
|
||||
String menuName;
|
||||
@@ -152,14 +155,15 @@ public class AuditLogDto {
|
||||
// 메뉴별, 사용자별 로그 검색 조건
|
||||
private String searchValue;
|
||||
private String menuUid;
|
||||
private Long userUid; //menuId, userUid 조회
|
||||
private Long userUid; // menuId, userUid 조회
|
||||
|
||||
// 페이징 파라미터
|
||||
private int page = 0;
|
||||
private int size = 20;
|
||||
private String sort;
|
||||
|
||||
public MenuUserSearchReq(String searchValue, String menuUid, Long userUid, int page, int size, String sort) {
|
||||
public MenuUserSearchReq(
|
||||
String searchValue, String menuUid, Long userUid, int page, int size, String sort) {
|
||||
this.searchValue = searchValue;
|
||||
this.menuUid = menuUid;
|
||||
this.page = page;
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||
import com.kamco.cd.kamcoback.config.enums.EnumType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -12,18 +14,13 @@ import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
public class ErrorLogDto {
|
||||
|
||||
@Schema(name = "ErrorLogBasic", description = "에러로그 기본 정보")
|
||||
@Getter
|
||||
public static class Basic {
|
||||
|
||||
@JsonIgnore
|
||||
private final Long id;
|
||||
@JsonIgnore private final Long id;
|
||||
private final String requestId;
|
||||
private final EventType errorType;
|
||||
private final LogErrorLevel errorLevel;
|
||||
@@ -32,23 +29,21 @@ public class ErrorLogDto {
|
||||
private final String stackTrace;
|
||||
private final Long handlerUid;
|
||||
|
||||
@JsonFormatDttm
|
||||
private final ZonedDateTime handledDttm;
|
||||
@JsonFormatDttm private final ZonedDateTime handledDttm;
|
||||
|
||||
@JsonFormatDttm
|
||||
private final ZonedDateTime createdDttm;
|
||||
@JsonFormatDttm private final ZonedDateTime createdDttm;
|
||||
|
||||
public Basic(
|
||||
Long id,
|
||||
String requestId,
|
||||
EventType errorType,
|
||||
LogErrorLevel errorLevel,
|
||||
String errorCode,
|
||||
String errorMessage,
|
||||
String stackTrace,
|
||||
Long handlerUid,
|
||||
ZonedDateTime handledDttm,
|
||||
ZonedDateTime createdDttm) {
|
||||
Long id,
|
||||
String requestId,
|
||||
EventType errorType,
|
||||
LogErrorLevel errorLevel,
|
||||
String errorCode,
|
||||
String errorMessage,
|
||||
String stackTrace,
|
||||
Long handlerUid,
|
||||
ZonedDateTime handledDttm,
|
||||
ZonedDateTime createdDttm) {
|
||||
this.id = id;
|
||||
this.requestId = requestId;
|
||||
this.errorType = errorType;
|
||||
@@ -79,7 +74,13 @@ public class ErrorLogDto {
|
||||
private int size = 20;
|
||||
private String sort;
|
||||
|
||||
public ErrorSearchReq(LogErrorLevel errorLevel, EventType eventType, LocalDate startDate, LocalDate endDate, int page, int size) {
|
||||
public ErrorSearchReq(
|
||||
LogErrorLevel errorLevel,
|
||||
EventType eventType,
|
||||
LocalDate startDate,
|
||||
LocalDate endDate,
|
||||
int page,
|
||||
int size) {
|
||||
this.errorLevel = errorLevel;
|
||||
this.eventType = eventType;
|
||||
this.startDate = startDate;
|
||||
@@ -93,7 +94,7 @@ public class ErrorLogDto {
|
||||
String[] sortParams = sort.split(",");
|
||||
String property = sortParams[0];
|
||||
Sort.Direction direction =
|
||||
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
|
||||
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
|
||||
return PageRequest.of(page, size, Sort.by(direction, property));
|
||||
}
|
||||
return PageRequest.of(page, size);
|
||||
@@ -112,10 +113,13 @@ public class ErrorLogDto {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() { return name(); }
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() { return desc; }
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,8 +13,12 @@ public enum EventStatus implements EnumType {
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public String getId() { return name(); }
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() { return desc; }
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,12 @@ public enum EventType implements EnumType {
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public String getId() { return name(); }
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() { return desc; }
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user