feat: add add_imagery_data_api_v2

This commit is contained in:
2025-12-22 19:25:48 +09:00
parent 78cfc2df48
commit b8bc14bb17
3 changed files with 77 additions and 20 deletions

View File

@@ -16,7 +16,14 @@ import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@Tag(name = "영상 관리", description = "영상 관리 API")
@@ -105,25 +112,6 @@ public class MapSheetMngApiController {
return ApiResponseDto.ok(mapSheetMngService.mngComplete(mngYyyy));
}
@Operation(summary = "영상 데이터 관리 년도 목록", description = "영상 데이터 관리 년도 목록")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "조회 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = CommonCodeDto.Basic.class))),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/mng-year-list")
public ApiResponseDto<List<Integer>> findMapSheetMngYyyyList() {
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngYyyyList());
}
@Operation(summary = "영상 데이터 관리 오류 목록", description = "영상 데이터 관리 오류 목록")
@ApiResponses(
value = {

View File

@@ -0,0 +1,54 @@
package com.kamco.cd.kamcoback.mapsheet;
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto;
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
import com.kamco.cd.kamcoback.mapsheet.service.MapSheetMngService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
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.time.Year;
import java.util.List;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "영상 관리", description = "영상 관리 API")
@RestController
@RequiredArgsConstructor
@RequestMapping({"/api/v2/mapsheet"})
public class MapSheetMngApiV2Controller {
private final MapSheetMngService mapSheetMngService;
@Operation(summary = "영상 데이터 관리 년도 목록", description = "영상 데이터 관리 년도 목록")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "조회 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = CommonCodeDto.Basic.class))),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/mng-year-list")
public ApiResponseDto<MapSheetMngDto.ResisterYearList> findMapSheetMngYyyyList() {
List<Integer> years = mapSheetMngService.findMapSheetMngYyyyList();
// 현재 년도 가져온다
int currentYear = Year.now().getValue();
// 현재년도와 같거나 큰 년도를 가져온다.
Optional<Integer> result = years.stream().filter(y -> y >= currentYear).min(Integer::compareTo);
return ApiResponseDto.ok(new MapSheetMngDto.ResisterYearList(result.orElse(null), years));
}
}

View File

@@ -6,6 +6,7 @@ import com.kamco.cd.kamcoback.common.utils.enums.Enums;
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;
@@ -238,6 +239,7 @@ public class MapSheetMngDto {
@Getter
@Setter
public static class SyncCheckStateReqUpdateDto {
private Long hstUid;
private String filePath;
private String syncCheckTfwFileName;
@@ -304,4 +306,17 @@ public class MapSheetMngDto {
private Long hstUid;
private Long fileSize;
}
@Schema(name = "ResisterYearList", description = "영상파일 등록을 위한 연도 list")
@Getter
public static class ResisterYearList {
private Integer currnet;
private List<Integer> years;
public ResisterYearList(Integer currnet, List<Integer> years) {
this.currnet = currnet;
this.years = years;
}
}
}