사용자등록 추가, 추론결과 dashboard 수정
This commit is contained in:
@@ -2,8 +2,6 @@ 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.service.InferenceResultService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -96,12 +94,7 @@ public class InferenceResultApiController {
|
||||
@GetMapping("/detail")
|
||||
public ApiResponseDto<InferenceResultDto.Detail> getInferenceDetail(
|
||||
@Parameter(description = "목록 id", example = "1") @RequestParam Long id) {
|
||||
// summary
|
||||
InferenceResultDto.AnalResSummary summary =
|
||||
inferenceResultService.getInferenceResultSummary(id);
|
||||
// dashBoard
|
||||
List<InferenceResultDto.Dashboard> dashboardList = this.getInferenceResultDashboard(id);
|
||||
return ApiResponseDto.ok(new Detail(summary, dashboardList));
|
||||
return ApiResponseDto.ok(inferenceResultService.getDetail(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "추론관리 분석결과 상세 목록", description = "추론관리 분석결과 상세 목록 geojson 데이터 조회")
|
||||
@@ -139,14 +132,4 @@ public class InferenceResultApiController {
|
||||
inferenceResultService.getInferenceResultGeomList(searchGeoReq);
|
||||
return ApiResponseDto.ok(geomList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 분석결과 상세 대시보드 조회
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private List<Dashboard> getInferenceResultDashboard(Long id) {
|
||||
return inferenceResultService.getInferenceResultBasic(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,10 +188,12 @@ public class InferenceResultDto {
|
||||
public static class Detail {
|
||||
AnalResSummary summary;
|
||||
List<Dashboard> dashboard;
|
||||
Long totalCnt;
|
||||
|
||||
public Detail(AnalResSummary summary, List<Dashboard> dashboard) {
|
||||
public Detail(AnalResSummary summary, List<Dashboard> dashboard, Long totalCnt) {
|
||||
this.summary = summary;
|
||||
this.dashboard = dashboard;
|
||||
this.totalCnt = totalCnt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.inference.service;
|
||||
|
||||
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.postgres.core.InferenceResultCoreService;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -57,4 +58,21 @@ public class InferenceResultService {
|
||||
InferenceResultDto.SearchGeoReq searchGeoReq) {
|
||||
return inferenceResultCoreService.getInferenceResultGeomList(searchGeoReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 분석결과 상제 정보 Summary, DashBoard
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public Detail getDetail(Long id) {
|
||||
// summary
|
||||
InferenceResultDto.AnalResSummary summary = this.getInferenceResultSummary(id);
|
||||
// 탐지건수 dashBoard
|
||||
List<InferenceResultDto.Dashboard> dashboardList = this.getInferenceResultBasic(id);
|
||||
// 전체 탐지건수
|
||||
Long totalCnt = dashboardList.stream().mapToLong(Dashboard::getClassAfterCnt).sum();
|
||||
|
||||
return new Detail(summary, dashboardList, totalCnt);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user