Merge pull request 'feat: add add_imagery_data_api_v2' (#92) from feat/dean/add_imagery_data_api_v2 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/92
This commit is contained in:
@@ -16,7 +16,14 @@ import java.util.List;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.http.MediaType;
|
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;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@Tag(name = "영상 관리", description = "영상 관리 API")
|
@Tag(name = "영상 관리", description = "영상 관리 API")
|
||||||
@@ -105,25 +112,6 @@ public class MapSheetMngApiController {
|
|||||||
return ApiResponseDto.ok(mapSheetMngService.mngComplete(mngYyyy));
|
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 = "영상 데이터 관리 오류 목록")
|
@Operation(summary = "영상 데이터 관리 오류 목록", description = "영상 데이터 관리 오류 목록")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
|
|||||||
@@ -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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import com.kamco.cd.kamcoback.common.utils.enums.Enums;
|
|||||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
|
import java.util.List;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -238,6 +239,7 @@ public class MapSheetMngDto {
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public static class SyncCheckStateReqUpdateDto {
|
public static class SyncCheckStateReqUpdateDto {
|
||||||
|
|
||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
private String filePath;
|
private String filePath;
|
||||||
private String syncCheckTfwFileName;
|
private String syncCheckTfwFileName;
|
||||||
@@ -304,4 +306,17 @@ public class MapSheetMngDto {
|
|||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
private Long fileSize;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user