Merge pull request '[KC-116] shp 파일 다운로드 이력 추가' (#276) from feat/infer_dev_260107 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/276
This commit is contained in:
2026-01-19 17:42:31 +09:00
6 changed files with 41 additions and 19 deletions

View File

@@ -416,7 +416,11 @@ public class InferenceResultApiController {
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@GetMapping(value = "/download/{uuid}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public ResponseEntity<Resource> downloadShp(@PathVariable UUID uuid) throws IOException {
public ResponseEntity<Resource> downloadShp(
@Parameter(description = "uuid", example = "0192efc6-9ec2-43ee-9a90-5b73e763c09f")
@PathVariable
UUID uuid)
throws IOException {
String path;
try {
@@ -445,8 +449,21 @@ public class InferenceResultApiController {
.body((Resource) resource);
}
@Operation(summary = "shp 파일 다운로드 이력", description = "추론관리 분석결과 shp 파일 다운로드 이")
@GetMapping(value = "/download-audit/{uuid}")
public ApiResponseDto<Page<AuditLogDto.Basic>> downloadAudit(
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "검색 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Page.class))),
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
public ApiResponseDto<Page<AuditLogDto.DownloadRes>> downloadAudit(
@Parameter(description = "UUID", example = "0192efc6-9ec2-43ee-9a90-5b73e763c09f")
@PathVariable
UUID uuid,
@@ -457,7 +474,7 @@ public class InferenceResultApiController {
LocalDate strtDttm,
@Parameter(description = "다운로드일 종료", example = "2026-01-01") @RequestParam(required = false)
LocalDate endDttm,
@Parameter(description = "키워드", example = "변화탐지") @RequestParam(required = false)
@Parameter(description = "키워드", example = "관리자") @RequestParam(required = false)
String searchValue,
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
int page,

View File

@@ -569,7 +569,7 @@ public class InferenceResultService {
* @param type 검색 구분
* @param searchValue 키워드
*/
public Page<AuditLogDto.Basic> getDownloadAudit(
public Page<AuditLogDto.DownloadRes> getDownloadAudit(
AuditLogDto.searchReq searchReq, DownloadReq downloadReq) {
return auditLogCoreService.findLogByAccount(searchReq, downloadReq);
}

View File

@@ -253,6 +253,16 @@ public class AuditLogDto {
String requestUri;
}
@Getter
@Setter
@AllArgsConstructor
public static class DownloadRes {
String name;
String employeeNo;
@JsonFormatDttm ZonedDateTime downloadDttm;
}
@CodeExpose
@Getter
@AllArgsConstructor

View File

@@ -46,7 +46,7 @@ public class AuditLogCoreService
return auditLogRepository.findLogByAccount(searchRange, searchValue);
}
public Page<AuditLogDto.Basic> findLogByAccount(
public Page<AuditLogDto.DownloadRes> findLogByAccount(
AuditLogDto.searchReq searchReq, DownloadReq downloadReq) {
return auditLogRepository.findDownloadLog(searchReq, downloadReq);
}

View File

@@ -16,7 +16,8 @@ public interface AuditLogRepositoryCustom {
Page<AuditLogDto.UserAuditList> findLogByAccount(
AuditLogDto.searchReq searchReq, String searchValue);
Page<AuditLogDto.Basic> findDownloadLog(AuditLogDto.searchReq searchReq, DownloadReq downloadReq);
Page<AuditLogDto.DownloadRes> findDownloadLog(
AuditLogDto.searchReq searchReq, DownloadReq downloadReq);
Page<AuditLogDto.DailyDetail> findLogByDailyResult(
AuditLogDto.searchReq searchReq, LocalDate logDate);

View File

@@ -160,7 +160,8 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
}
@Override
public Page<AuditLogDto.Basic> findDownloadLog(AuditLogDto.searchReq searchReq, DownloadReq req) {
public Page<AuditLogDto.DownloadRes> findDownloadLog(
AuditLogDto.searchReq searchReq, DownloadReq req) {
Pageable pageable = searchReq.toPageable();
BooleanBuilder whereBuilder = new BooleanBuilder();
@@ -183,21 +184,14 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
}
}
List<AuditLogDto.Basic> foundContent =
List<AuditLogDto.DownloadRes> foundContent =
queryFactory
.select(
Projections.constructor(
AuditLogDto.Basic.class,
auditLogEntity.id,
auditLogEntity.userUid,
auditLogEntity.eventType,
auditLogEntity.eventStatus,
auditLogEntity.menuUid,
auditLogEntity.ipAddress,
auditLogEntity.requestUri,
auditLogEntity.requestBody,
auditLogEntity.errorLogUid,
auditLogEntity.createdDate))
AuditLogDto.DownloadRes.class,
memberEntity.name,
memberEntity.employeeNo,
auditLogEntity.createdDate.as("downloadDttm")))
.from(auditLogEntity)
.leftJoin(memberEntity)
.on(auditLogEntity.userUid.eq(memberEntity.id))