로그관리 API return 구조 수정
This commit is contained in:
@@ -56,51 +56,104 @@ public class AuditLogDto {
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "AuditList", description = "감사 로그 목록")
|
||||
@Schema(name = "AuditCommon", description = "목록 공통")
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public static class AuditList {
|
||||
public static class AuditCommon {
|
||||
private int readCount;
|
||||
private int cudCount;
|
||||
private int printCount;
|
||||
private int downloadCount;
|
||||
private Long totalCount;
|
||||
}
|
||||
|
||||
private Long accountId;
|
||||
private String loginId;
|
||||
private String username;
|
||||
private LocalDateTime baseDate;
|
||||
private Long menuId;
|
||||
private String menuName;
|
||||
@Schema(name = "DailyAuditList", description = "일자별 목록")
|
||||
@Getter
|
||||
public static class DailyAuditList extends AuditCommon {
|
||||
private final String baseDate;
|
||||
|
||||
public AuditList(
|
||||
LocalDateTime baseDate,
|
||||
int readCount,
|
||||
int cudCount,
|
||||
int printCount,
|
||||
int downloadCount,
|
||||
Long totalCount) {
|
||||
public DailyAuditList(int readCount, int cudCount, int printCount, int downloadCount, Long totalCount, String baseDate) {
|
||||
super(readCount, cudCount, printCount, downloadCount, totalCount);
|
||||
this.baseDate = baseDate;
|
||||
this.readCount = readCount;
|
||||
this.cudCount = cudCount;
|
||||
this.printCount = printCount;
|
||||
this.downloadCount = downloadCount;
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "AuditDetail", description = "감사 로그 상세")
|
||||
@Schema(name = "MenuAuditList", description = "메뉴별 목록")
|
||||
@Getter
|
||||
public static class MenuAuditList extends AuditCommon {
|
||||
private final String menuId;
|
||||
private final String menuName;
|
||||
|
||||
public MenuAuditList(String menuId, String menuName, int readCount, int cudCount, int printCount, int downloadCount, Long totalCount) {
|
||||
super(readCount, cudCount, printCount, downloadCount, totalCount);
|
||||
this.menuId = menuId;
|
||||
this.menuName = menuName;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "UserAuditList", description = "사용자별 목록")
|
||||
@Getter
|
||||
public static class UserAuditList extends AuditCommon {
|
||||
private final Long accountId;
|
||||
private final String loginId;
|
||||
private final String username;
|
||||
|
||||
public UserAuditList(Long accountId, String loginId, String username, int readCount, int cudCount, int printCount, int downloadCount, Long totalCount) {
|
||||
super(readCount, cudCount, printCount, downloadCount, totalCount);
|
||||
this.accountId = accountId;
|
||||
this.loginId = loginId;
|
||||
this.username = username;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "AuditDetail", description = "감사 로그 상세 공통")
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public static class AuditDetail {
|
||||
private Long logId;
|
||||
private LocalDateTime logDateTime;
|
||||
private EventType eventType;
|
||||
private LogDetail detail;
|
||||
}
|
||||
|
||||
private String userName;
|
||||
private String loginId;
|
||||
private String menuName;
|
||||
@Schema(name = "DailyDetail", description = "일자별 로그 상세")
|
||||
@Getter
|
||||
public static class DailyDetail extends AuditDetail {
|
||||
private final String userName;
|
||||
private final String loginId;
|
||||
private final String menuName;
|
||||
|
||||
public DailyDetail(Long logId, String userName, String loginId, String menuName, EventType eventType, LogDetail detail){
|
||||
super(logId, eventType, detail);
|
||||
this.userName = userName;
|
||||
this.loginId = loginId;
|
||||
this.menuName = menuName;
|
||||
}
|
||||
}
|
||||
@Schema(name = "MenuDetail", description = "메뉴별 로그 상세")
|
||||
@Getter
|
||||
public static class MenuDetail extends AuditDetail {
|
||||
private final String logDateTime;
|
||||
private final String userName;
|
||||
private final String loginId;
|
||||
|
||||
public MenuDetail(Long logId, String logDateTime, String userName, String loginId, EventType eventType, LogDetail detail){
|
||||
super(logId, eventType, detail);
|
||||
this.logDateTime = logDateTime;
|
||||
this.userName = userName;
|
||||
this.loginId = loginId;
|
||||
}
|
||||
}
|
||||
@Schema(name = "UserDetail", description = "사용자별 로그 상세")
|
||||
@Getter
|
||||
public static class UserDetail extends AuditDetail {
|
||||
private final String logDateTime;
|
||||
private final String menuNm;
|
||||
|
||||
public UserDetail(Long logId, String logDateTime, String menuNm, EventType eventType, LogDetail detail){
|
||||
super(logId, eventType, detail);
|
||||
this.logDateTime = logDateTime;
|
||||
this.menuNm = menuNm;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@@ -112,22 +165,16 @@ public class AuditLogDto {
|
||||
String menuName;
|
||||
String menuUrl;
|
||||
String menuDescription;
|
||||
int sortOrder;
|
||||
Long sortOrder;
|
||||
boolean used;
|
||||
}
|
||||
|
||||
@Schema(name = "LogDailySearchReq", description = "일자별 로그 검색 요청")
|
||||
@Schema(name = "searchReq", description = "일자별 로그 검색 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class DailySearchReq {
|
||||
|
||||
private LocalDate startDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
// 일자별 로그 검색 조건
|
||||
private LocalDate logDate;
|
||||
public static class searchReq {
|
||||
|
||||
// 페이징 파라미터
|
||||
private int page = 0;
|
||||
@@ -145,41 +192,4 @@ public class AuditLogDto {
|
||||
return PageRequest.of(page, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "MenuUserSearchReq", description = "메뉴별,사용자별 로그 검색 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public static class MenuUserSearchReq {
|
||||
|
||||
// 메뉴별, 사용자별 로그 검색 조건
|
||||
private String searchValue;
|
||||
private String menuUid;
|
||||
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) {
|
||||
this.searchValue = searchValue;
|
||||
this.menuUid = menuUid;
|
||||
this.page = page;
|
||||
this.size = size;
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Pageable toPageable() {
|
||||
if (sort != null && !sort.isEmpty()) {
|
||||
String[] sortParams = sort.split(",");
|
||||
String property = sortParams[0];
|
||||
Sort.Direction direction =
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user