모델관리 기본 구조 파일 커밋, 로그관리 수정
This commit is contained in:
@@ -2,6 +2,7 @@ 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;
|
||||
@@ -16,10 +17,10 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Tag(name = "감사 로그", description = "감사 로그 관리 API")
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping({"/api/log/audit"})
|
||||
@RequestMapping("/api/log/audit")
|
||||
public class AuditLogApiController {
|
||||
|
||||
private final AuditLogCoreService auditLogCoreService;
|
||||
private final AuditLogService auditLogService;
|
||||
|
||||
@Operation(summary = "일자별 로그 조회")
|
||||
@GetMapping("/daily")
|
||||
@@ -32,7 +33,7 @@ public class AuditLogApiController {
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
|
||||
Page<AuditLogDto.DailyAuditList> result =
|
||||
auditLogCoreService.getLogByDaily(searchReq, startDate, endDate);
|
||||
auditLogService.getLogByDaily(searchReq, startDate, endDate);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
@@ -46,7 +47,7 @@ public class AuditLogApiController {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.DailyDetail> result =
|
||||
auditLogCoreService.getLogByDailyResult(searchReq, logDate);
|
||||
auditLogService.getLogByDailyResult(searchReq, logDate);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
@@ -59,7 +60,7 @@ public class AuditLogApiController {
|
||||
@RequestParam(defaultValue = "20") int size) {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.MenuAuditList> result = auditLogCoreService.getLogByMenu(searchReq, searchValue);
|
||||
Page<AuditLogDto.MenuAuditList> result = auditLogService.getLogByMenu(searchReq, searchValue);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
@@ -73,7 +74,7 @@ public class AuditLogApiController {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.MenuDetail> result =
|
||||
auditLogCoreService.getLogByMenuResult(searchReq, menuId);
|
||||
auditLogService.getLogByMenuResult(searchReq, menuId);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
@@ -87,7 +88,7 @@ public class AuditLogApiController {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.UserAuditList> result =
|
||||
auditLogCoreService.getLogByAccount(searchReq, searchValue);
|
||||
auditLogService.getLogByAccount(searchReq, searchValue);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
@@ -101,7 +102,7 @@ public class AuditLogApiController {
|
||||
AuditLogDto.searchReq searchReq =
|
||||
new AuditLogDto.searchReq(page, size, "created_dttm,desc");
|
||||
Page<AuditLogDto.UserDetail> result =
|
||||
auditLogCoreService.getLogByAccountResult(searchReq, userUid);
|
||||
auditLogService.getLogByAccountResult(searchReq, userUid);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.log;
|
||||
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;
|
||||
@@ -20,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping({"/api/log/error"})
|
||||
public class ErrorLogApiController {
|
||||
|
||||
private final ErrorLogCoreService errorLogCoreService;
|
||||
private final ErrorLogService errorLogService;
|
||||
|
||||
@Operation(summary = "에러로그 조회")
|
||||
@GetMapping("/error")
|
||||
@@ -34,7 +35,7 @@ public class ErrorLogApiController {
|
||||
ErrorLogDto.ErrorSearchReq searchReq =
|
||||
new ErrorLogDto.ErrorSearchReq(
|
||||
logErrorLevel, eventType, startDate, endDate, page, size, "created_dttm,desc");
|
||||
Page<ErrorLogDto.Basic> result = errorLogCoreService.findLogByError(searchReq);
|
||||
Page<ErrorLogDto.Basic> result = errorLogService.findLogByError(searchReq);
|
||||
|
||||
return ApiResponseDto.ok(result);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.kamco.cd.kamcoback.log.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.AuditLogCoreService;
|
||||
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)
|
||||
public class AuditLogService {
|
||||
private final AuditLogCoreService auditLogCoreService;
|
||||
|
||||
public Page<AuditLogDto.DailyAuditList> getLogByDaily(
|
||||
AuditLogDto.searchReq searchRange, LocalDate startDate, LocalDate endDate) {
|
||||
return auditLogCoreService.getLogByDaily(searchRange, startDate, endDate);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.MenuAuditList> getLogByMenu(
|
||||
AuditLogDto.searchReq searchRange, String searchValue) {
|
||||
return auditLogCoreService.getLogByMenu(searchRange, searchValue);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.UserAuditList> getLogByAccount(
|
||||
AuditLogDto.searchReq searchRange, String searchValue) {
|
||||
return auditLogCoreService.getLogByAccount(searchRange, searchValue);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.DailyDetail> getLogByDailyResult(
|
||||
AuditLogDto.searchReq searchRange, LocalDate logDate) {
|
||||
return auditLogCoreService.getLogByDailyResult(searchRange, logDate);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.MenuDetail> getLogByMenuResult(
|
||||
AuditLogDto.searchReq searchRange, String menuId) {
|
||||
return auditLogCoreService.getLogByMenuResult(searchRange, menuId);
|
||||
}
|
||||
|
||||
public Page<AuditLogDto.UserDetail> getLogByAccountResult(
|
||||
AuditLogDto.searchReq searchRange, Long accountId) {
|
||||
return auditLogCoreService.getLogByAccountResult(searchRange, accountId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.kamco.cd.kamcoback.log.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.log.dto.ErrorLogDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.ErrorLogCoreService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
public class ErrorLogService {
|
||||
private final ErrorLogCoreService errorLogCoreService;
|
||||
|
||||
public Page<ErrorLogDto.Basic> findLogByError(ErrorLogDto.ErrorSearchReq searchReq) {
|
||||
return errorLogCoreService.findLogByError(searchReq);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user