api scene
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.kamco.cd.kamcoback.scene;
|
||||
|
||||
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto;
|
||||
import com.kamco.cd.kamcoback.common.enums.CommonUseStatus;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.scene.dto.MapInkxMngDto;
|
||||
import com.kamco.cd.kamcoback.scene.service.MapInkxMngService;
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "도엽 관리", description = "도엽 관리 API")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/v2/scene")
|
||||
public class MapInkxMngApiV2Controller {
|
||||
|
||||
private final MapInkxMngService mapInkxMngService;
|
||||
|
||||
@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)
|
||||
})
|
||||
@GetMapping
|
||||
public ApiResponseDto<Page<MapInkxMngDto.MapListEntity>> findMapInkxMngList(
|
||||
@RequestParam(defaultValue = "0") int page,
|
||||
@RequestParam(defaultValue = "20") int size,
|
||||
@RequestParam(required = false) CommonUseStatus useInference,
|
||||
@RequestParam(required = false) String searchVal) {
|
||||
MapInkxMngDto.searchReq searchReq = new MapInkxMngDto.searchReq(page, size, "");
|
||||
return ApiResponseDto.ok(
|
||||
mapInkxMngService.findMapInkxMngLists(useInference, searchVal, searchReq));
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
package com.kamco.cd.kamcoback.scene.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.kamco.cd.kamcoback.common.enums.ApiConfigEnum.EnumDto;
|
||||
import com.kamco.cd.kamcoback.common.enums.CommonUseStatus;
|
||||
import com.kamco.cd.kamcoback.common.utils.enums.CodeExpose;
|
||||
import com.kamco.cd.kamcoback.common.utils.enums.EnumType;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
@@ -19,25 +21,26 @@ import org.springframework.data.domain.Sort;
|
||||
|
||||
public class MapInkxMngDto {
|
||||
|
||||
@CodeExpose
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum UseInferenceType implements EnumType {
|
||||
USE("사용중"),
|
||||
EXCEPT("영구 추론제외");
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
// CommonUseStatus class로 통합 20251230
|
||||
// @CodeExpose
|
||||
// @Getter
|
||||
// @AllArgsConstructor
|
||||
// public enum UseInferenceType implements EnumType {
|
||||
// USE("사용중"),
|
||||
// EXCEPT("영구 추론제외");
|
||||
//
|
||||
// private final String desc;
|
||||
//
|
||||
// @Override
|
||||
// public String getId() {
|
||||
// return name();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getText() {
|
||||
// return desc;
|
||||
// }
|
||||
// }
|
||||
|
||||
@Schema(name = "Basic", description = "Basic")
|
||||
@Getter
|
||||
@@ -55,6 +58,46 @@ public class MapInkxMngDto {
|
||||
private ZonedDateTime updatedDttm;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Schema(name = "MapListEntity", description = "목록 항목")
|
||||
public static class MapListEntity {
|
||||
|
||||
private InferenceResultDto.MapSheet scene50k;
|
||||
private InferenceResultDto.MapSheet scene5k;
|
||||
private CommonUseStatus useInference;
|
||||
|
||||
@JsonFormat(
|
||||
shape = JsonFormat.Shape.STRING,
|
||||
pattern = "yyyy-MM-dd'T'HH:mm:ssXXX",
|
||||
timezone = "Asia/Seoul")
|
||||
private ZonedDateTime createdDttm;
|
||||
|
||||
@JsonFormat(
|
||||
shape = JsonFormat.Shape.STRING,
|
||||
pattern = "yyyy-MM-dd'T'HH:mm:ssXXX",
|
||||
timezone = "Asia/Seoul")
|
||||
private ZonedDateTime updatedDttm;
|
||||
|
||||
public EnumDto<CommonUseStatus> getUseInference() {
|
||||
EnumDto<CommonUseStatus> enumDto = useInference.getEnumDto();
|
||||
return enumDto;
|
||||
}
|
||||
|
||||
@Builder
|
||||
public MapListEntity(
|
||||
InferenceResultDto.MapSheet scene50k,
|
||||
InferenceResultDto.MapSheet scene5k,
|
||||
CommonUseStatus useInference,
|
||||
ZonedDateTime createdDttm,
|
||||
ZonedDateTime updatedDttm) {
|
||||
this.scene50k = scene50k;
|
||||
this.scene5k = scene5k;
|
||||
this.useInference = useInference;
|
||||
this.createdDttm = createdDttm;
|
||||
this.updatedDttm = updatedDttm;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "MapList", description = "목록 항목")
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
@@ -25,11 +25,18 @@ public class MapInkxMngService {
|
||||
|
||||
private final MapInkxMngCoreService mapInkxMngCoreService;
|
||||
|
||||
// 도엽의 리스트 조회
|
||||
public Page<MapList> findMapInkxMngList(
|
||||
MapInkxMngDto.searchReq searchReq, CommonUseStatus useInference, String searchVal) {
|
||||
return mapInkxMngCoreService.findMapInkxMngList(searchReq, useInference, searchVal);
|
||||
}
|
||||
|
||||
// 도엽의 리스트 조회
|
||||
public Page<MapInkxMngDto.MapListEntity> findMapInkxMngLists(
|
||||
CommonUseStatus useInference, String searchVal, MapInkxMngDto.searchReq searchReq) {
|
||||
return mapInkxMngCoreService.getSceneListByPage(useInference, searchVal, searchReq);
|
||||
}
|
||||
|
||||
public ResponseObj saveMapInkx5k(@Valid MapInkxMngDto.AddMapReq req) {
|
||||
|
||||
String[] coordinates = req.getCoordinates().split("\\r?\\n");
|
||||
|
||||
Reference in New Issue
Block a user