From 15afebd57915de71cbb94b8a281caec8c6cc12d3 Mon Sep 17 00:00:00 2001 From: teddy Date: Thu, 15 Jan 2026 11:26:56 +0900 Subject: [PATCH] =?UTF-8?q?[KC-103]=20=EA=B2=B0=EA=B3=BC=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inference/dto/InferenceResultDto.java | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java b/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java index fdbb0b8d..6e36615a 100644 --- a/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java @@ -200,7 +200,7 @@ public class InferenceResultDto { long m = (s % 3600) / 60; long sec = s % 60; - return String.format("%dH %dM %dS", h, m, sec); + return String.format("%d시간 %d분 %d초", h, m, sec); } } @@ -465,6 +465,42 @@ public class InferenceResultDto { private String getMapSheetScope() { return MapSheetScope.getDescByCode(this.mapSheetScope); } + + @Schema(description = "M1 사용시간") + @JsonProperty("m1ElapsedTim") + public String getM1ElapsedTime() { + return formatElapsedTime(this.m1ModelStartDttm, this.m1ModelEndDttm); + } + + @Schema(description = "M2 사용시간") + @JsonProperty("m2ElapsedTim") + public String getM2ElapsedTime() { + return formatElapsedTime(this.m2ModelStartDttm, this.m2ModelEndDttm); + } + + @Schema(description = "M3 사용시간") + @JsonProperty("m3ElapsedTim") + public String getM3ElapsedTime() { + return formatElapsedTime(this.m3ModelStartDttm, this.m3ModelEndDttm); + } + + private String formatElapsedTime(ZonedDateTime start, ZonedDateTime end) { + if (start == null || end == null) { + return null; + } + + Duration d = Duration.between(start, end); + if (d.isNegative()) { + d = d.negated(); + } + + long s = d.getSeconds(); + long h = s / 3600; + long m = (s % 3600) / 60; + long sec = s % 60; + + return String.format("%d시간 %d분 %d초", h, m, sec); + } } @Getter