추론관리 > 분석결과 상세 summary, dashboard 추가
This commit is contained in:
@@ -2,6 +2,9 @@ package com.kamco.cd.kamcoback.inference;
|
||||
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Dashboard;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Detail;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SearchReq;
|
||||
import com.kamco.cd.kamcoback.inference.service.InferenceResultService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -10,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -49,9 +53,12 @@ public class InferenceResultApiController {
|
||||
@Parameter(description = "제목", example = "2023_2024년도") @RequestParam(required = false)
|
||||
String title,
|
||||
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
|
||||
int page
|
||||
int page,
|
||||
@Parameter(description = "정렬 조건 (형식: 필드명,방향)", example = "name,asc")
|
||||
@RequestParam(required = false)
|
||||
String sort
|
||||
) {
|
||||
InferenceResultDto.SearchReq searchReq = new InferenceResultDto.SearchReq(statCode, title, page, 20, null);
|
||||
InferenceResultDto.SearchReq searchReq = new InferenceResultDto.SearchReq(statCode, title, page, 20, sort);
|
||||
Page<InferenceResultDto.AnalResList> analResList = inferenceResultService.getInferenceResultList(searchReq);
|
||||
return ApiResponseDto.ok(analResList);
|
||||
}
|
||||
@@ -60,6 +67,18 @@ public class InferenceResultApiController {
|
||||
summary = "추론관리 분석결과 요약정보",
|
||||
description =
|
||||
"분석결과 요약정보를 조회합니다.")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "검색 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = InferenceResultDto.AnalResSummary.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/summary")
|
||||
public ApiResponseDto<InferenceResultDto.AnalResSummary> getInferenceResultSummary(
|
||||
@Parameter(description = "목록 id", example = "1")
|
||||
@@ -68,5 +87,42 @@ public class InferenceResultApiController {
|
||||
}
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "추론관리 분석결과 상세",
|
||||
description =
|
||||
"분석결과 상제 정보 Summary, DashBoard")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "검색 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = InferenceResultDto.Detail.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/detail")
|
||||
public ApiResponseDto<InferenceResultDto.Detail> getInferenceDetail(
|
||||
@Parameter(description = "목록 id", example = "1")
|
||||
@RequestParam Long id) {
|
||||
InferenceResultDto.AnalResSummary summary = inferenceResultService.getInferenceResultSummary(id);
|
||||
List<InferenceResultDto.Dashboard> dashboardList = this.getInferenceResultDashboard(id);
|
||||
|
||||
return ApiResponseDto.ok(new Detail(summary, dashboardList));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 분석결과 상세 대시보드 조회
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private List<Dashboard> getInferenceResultDashboard(Long id) {
|
||||
return inferenceResultService.getInferenceResultBasic(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,10 +3,12 @@ package com.kamco.cd.kamcoback.inference.dto;
|
||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
@@ -110,6 +112,8 @@ public class InferenceResultDto {
|
||||
private String resultUrl;
|
||||
private Long detectingCnt;
|
||||
private Double accuracy;
|
||||
private String analState;
|
||||
private String analStateNm;
|
||||
|
||||
public AnalResSummary(
|
||||
Long id,
|
||||
@@ -123,7 +127,9 @@ public class InferenceResultDto {
|
||||
Long analPredSec,
|
||||
String resultUrl,
|
||||
Long detectingCnt,
|
||||
Double accuracy
|
||||
Double accuracy,
|
||||
String analState,
|
||||
String analStateNm
|
||||
) {
|
||||
this.id = id;
|
||||
this.modelInfo = modelInfo;
|
||||
@@ -137,9 +143,76 @@ public class InferenceResultDto {
|
||||
this.resultUrl = resultUrl;
|
||||
this.detectingCnt = detectingCnt;
|
||||
this.accuracy = accuracy;
|
||||
this.analState = analState;
|
||||
this.analStateNm = analStateNm;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class Dashboard {
|
||||
Integer compareYyyy;
|
||||
Integer targetYyyy;
|
||||
Long mapSheetNum;
|
||||
String classBeforeName;
|
||||
String classAfterName;
|
||||
Long classBeforeCnt;
|
||||
Long classAfterCnt;
|
||||
@JsonFormatDttm
|
||||
ZonedDateTime createdDttm;
|
||||
Long createdUid;
|
||||
@JsonFormatDttm
|
||||
ZonedDateTime updatedDttm;
|
||||
Long updatedUid;
|
||||
Long refMapSheetNum;
|
||||
Long dataUid;
|
||||
|
||||
public Dashboard(
|
||||
Integer compareYyyy,
|
||||
Integer targetYyyy,
|
||||
Long mapSheetNum,
|
||||
String classBeforeName,
|
||||
String classAfterName,
|
||||
Long classBeforeCnt,
|
||||
Long classAfterCnt,
|
||||
ZonedDateTime createdDttm,
|
||||
Long createdUid,
|
||||
ZonedDateTime updatedDttm,
|
||||
Long updatedUid,
|
||||
Long refMapSheetNum,
|
||||
Long dataUid
|
||||
) {
|
||||
this.compareYyyy = compareYyyy;
|
||||
this.targetYyyy = targetYyyy;
|
||||
this.mapSheetNum = mapSheetNum;
|
||||
this.classBeforeName = classBeforeName;
|
||||
this.classAfterName = classAfterName;
|
||||
this.classBeforeCnt = classBeforeCnt;
|
||||
this.classAfterCnt = classAfterCnt;
|
||||
this.createdDttm = createdDttm;
|
||||
this.createdUid = createdUid;
|
||||
this.updatedDttm = updatedDttm;
|
||||
this.updatedUid = updatedUid;
|
||||
this.refMapSheetNum = refMapSheetNum;
|
||||
this.dataUid = dataUid;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class Detail {
|
||||
AnalResSummary summary;
|
||||
List<Dashboard> dashboard;
|
||||
|
||||
public Detail(
|
||||
AnalResSummary summary,
|
||||
List<Dashboard> dashboard
|
||||
) {
|
||||
this.summary = summary;
|
||||
this.dashboard = dashboard;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(name = "InferenceResultSearchReq", description = "분석결과 목록 요청 정보")
|
||||
@Getter
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.kamco.cd.kamcoback.inference.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Basic;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Dashboard;
|
||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -33,6 +35,15 @@ public class InferenceResultService {
|
||||
return inferenceResultCoreService.getInferenceResultSummary(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 분석결과 대시보드 조회
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public List<Dashboard> getInferenceResultBasic(Long id) {
|
||||
return inferenceResultCoreService.getInferenceResultDashboard(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user