./gradlew :spotlessApply 실행
This commit is contained in:
@@ -3,7 +3,6 @@ package com.kamco.cd.kamcoback.log;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
||||
import com.kamco.cd.kamcoback.log.service.AuditLogService;
|
||||
import com.kamco.cd.kamcoback.postgres.core.AuditLogCoreService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import java.time.LocalDate;
|
||||
@@ -29,8 +28,7 @@ public class AuditLogApiController {
|
||||
@RequestParam(required = false) LocalDate endDate,
|
||||
@RequestParam int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
AuditLogDto.searchReq searchReq = new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
|
||||
Page<AuditLogDto.DailyAuditList> result =
|
||||
auditLogService.getLogByDaily(searchReq, startDate, endDate);
|
||||
@@ -44,10 +42,8 @@ public class AuditLogApiController {
|
||||
@RequestParam LocalDate logDate,
|
||||
@RequestParam int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.DailyDetail> result =
|
||||
auditLogService.getLogByDailyResult(searchReq, logDate);
|
||||
AuditLogDto.searchReq searchReq = new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.DailyDetail> result = auditLogService.getLogByDailyResult(searchReq, logDate);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
@@ -58,8 +54,7 @@ public class AuditLogApiController {
|
||||
@RequestParam(required = false) String searchValue,
|
||||
@RequestParam int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
AuditLogDto.searchReq searchReq = new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.MenuAuditList> result = auditLogService.getLogByMenu(searchReq, searchValue);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
@@ -71,10 +66,8 @@ public class AuditLogApiController {
|
||||
@RequestParam String menuId,
|
||||
@RequestParam int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.MenuDetail> result =
|
||||
auditLogService.getLogByMenuResult(searchReq, menuId);
|
||||
AuditLogDto.searchReq searchReq = new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.MenuDetail> result = auditLogService.getLogByMenuResult(searchReq, menuId);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
@@ -85,8 +78,7 @@ public class AuditLogApiController {
|
||||
@RequestParam(required = false) String searchValue,
|
||||
@RequestParam int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
AuditLogDto.searchReq searchReq = new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.UserAuditList> result =
|
||||
auditLogService.getLogByAccount(searchReq, searchValue);
|
||||
|
||||
@@ -99,10 +91,8 @@ public class AuditLogApiController {
|
||||
@RequestParam Long userUid,
|
||||
@RequestParam int page,
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.UserDetail> result =
|
||||
auditLogService.getLogByAccountResult(searchReq, userUid);
|
||||
AuditLogDto.searchReq searchReq = new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.UserDetail> result = auditLogService.getLogByAccountResult(searchReq, userUid);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.log.dto.ErrorLogDto;
|
||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
||||
import com.kamco.cd.kamcoback.log.service.ErrorLogService;
|
||||
import com.kamco.cd.kamcoback.postgres.core.ErrorLogCoreService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@@ -3,8 +3,6 @@ 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;
|
||||
@@ -72,7 +70,13 @@ public class AuditLogDto {
|
||||
public static class DailyAuditList extends AuditCommon {
|
||||
private final String baseDate;
|
||||
|
||||
public DailyAuditList(int readCount, int cudCount, int printCount, int downloadCount, Long totalCount, String baseDate) {
|
||||
public DailyAuditList(
|
||||
int readCount,
|
||||
int cudCount,
|
||||
int printCount,
|
||||
int downloadCount,
|
||||
Long totalCount,
|
||||
String baseDate) {
|
||||
super(readCount, cudCount, printCount, downloadCount, totalCount);
|
||||
this.baseDate = baseDate;
|
||||
}
|
||||
@@ -84,7 +88,14 @@ public class AuditLogDto {
|
||||
private final String menuId;
|
||||
private final String menuName;
|
||||
|
||||
public MenuAuditList(String menuId, String menuName, int readCount, int cudCount, int printCount, int downloadCount, Long totalCount) {
|
||||
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;
|
||||
@@ -98,7 +109,15 @@ public class AuditLogDto {
|
||||
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) {
|
||||
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;
|
||||
@@ -122,13 +141,20 @@ public class AuditLogDto {
|
||||
private final String loginId;
|
||||
private final String menuName;
|
||||
|
||||
public DailyDetail(Long logId, String userName, String loginId, String menuName, EventType eventType, LogDetail detail){
|
||||
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 {
|
||||
@@ -136,20 +162,28 @@ public class AuditLogDto {
|
||||
private final String userName;
|
||||
private final String loginId;
|
||||
|
||||
public MenuDetail(Long logId, String logDateTime, String userName, String loginId, EventType eventType, LogDetail detail){
|
||||
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){
|
||||
public UserDetail(
|
||||
Long logId, String logDateTime, String menuNm, EventType eventType, LogDetail detail) {
|
||||
super(logId, eventType, detail);
|
||||
this.logDateTime = logDateTime;
|
||||
this.menuNm = menuNm;
|
||||
|
||||
@@ -2,13 +2,12 @@ package com.kamco.cd.kamcoback.log.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.AuditLogCoreService;
|
||||
import java.time.LocalDate;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
@@ -16,34 +15,32 @@ public class AuditLogService {
|
||||
private final AuditLogCoreService auditLogCoreService;
|
||||
|
||||
public Page<AuditLogDto.DailyAuditList> getLogByDaily(
|
||||
AuditLogDto.searchReq searchRange, LocalDate startDate, LocalDate endDate) {
|
||||
AuditLogDto.searchReq searchRange, LocalDate startDate, LocalDate endDate) {
|
||||
return auditLogCoreService.getLogByDaily(searchRange, startDate, endDate);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.MenuAuditList> getLogByMenu(
|
||||
AuditLogDto.searchReq searchRange, String searchValue) {
|
||||
AuditLogDto.searchReq searchRange, String searchValue) {
|
||||
return auditLogCoreService.getLogByMenu(searchRange, searchValue);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.UserAuditList> getLogByAccount(
|
||||
AuditLogDto.searchReq searchRange, String searchValue) {
|
||||
AuditLogDto.searchReq searchRange, String searchValue) {
|
||||
return auditLogCoreService.getLogByAccount(searchRange, searchValue);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.DailyDetail> getLogByDailyResult(
|
||||
AuditLogDto.searchReq searchRange, LocalDate logDate) {
|
||||
AuditLogDto.searchReq searchRange, LocalDate logDate) {
|
||||
return auditLogCoreService.getLogByDailyResult(searchRange, logDate);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.MenuDetail> getLogByMenuResult(
|
||||
AuditLogDto.searchReq searchRange, String menuId) {
|
||||
AuditLogDto.searchReq searchRange, String menuId) {
|
||||
return auditLogCoreService.getLogByMenuResult(searchRange, menuId);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.UserDetail> getLogByAccountResult(
|
||||
AuditLogDto.searchReq searchRange, Long accountId) {
|
||||
AuditLogDto.searchReq searchRange, Long accountId) {
|
||||
return auditLogCoreService.getLogByAccountResult(searchRange, accountId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user