라벨 할당,이관 리턴형식 수정

This commit is contained in:
2026-01-05 08:54:01 +09:00
parent dc2b9286f4
commit d87048b4c6
5 changed files with 114 additions and 104 deletions

View File

@@ -10,11 +10,11 @@ import com.kamco.cd.kamcoback.label.service.LabelAllocateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
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 jakarta.validation.Valid;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -109,63 +109,24 @@ public class LabelAllocateApiController {
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Long.class),
examples = {
@ExampleObject(
name = "라벨러 할당 예시",
description = "라벨러 할당 예시",
value =
"""
{
"autoType": "AUTO",
"stage": 4,
"labelers": [
{
"userId": "123456",
"demand": 1000
},
{
"userId": "010222297501",
"demand": 400
},
{
"userId": "01022223333",
"demand": 440
}
],
"inspectors": [
{
"inspectorUid": "K20251216001",
"userCount": 1000
},
{
"inspectorUid": "01022225555",
"userCount": 340
},
{
"inspectorUid": "K20251212001",
"userCount": 500
}
]
}
""")
})),
schema = @Schema(implementation = Long.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/allocate")
public ApiResponseDto<Void> labelAllocate(@RequestBody LabelAllocateDto.AllocateDto dto) {
labelAllocateService.allocateAsc(
dto.getAutoType(),
dto.getStage(),
dto.getLabelers(),
dto.getInspectors(),
dto.getCompareYyyy(),
dto.getTargetYyyy());
public ApiResponseDto<ApiResponseDto.ResponseObj> labelAllocate(
@RequestBody @Valid LabelAllocateDto.AllocateDto dto) {
return ApiResponseDto.ok(null);
return ApiResponseDto.okObject(
labelAllocateService.allocateAsc(
dto.getLabelerAutoType(),
dto.getInspectorAutoType(),
dto.getStage(),
dto.getLabelers(),
dto.getInspectors(),
dto.getCompareYyyy(),
dto.getTargetYyyy()));
}
@Operation(summary = "추론 상세 조회", description = "분석 ID에 해당하는 추론 상세 정보를 조회합니다.")
@@ -208,35 +169,13 @@ public class LabelAllocateApiController {
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Long.class),
examples = {
@ExampleObject(
name = "라벨러 할당 예시",
description = "라벨러 할당 예시",
value =
"""
{
"autoType": "AUTO",
"stage": 4,
"labelers": [
{
"userId": "123456",
"demand": 10
},
{
"userId": "010222297501",
"demand": 5
}
]
}
""")
})),
schema = @Schema(implementation = Long.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/allocate-move")
public ApiResponseDto<Void> labelAllocateMove(
public ApiResponseDto<ApiResponseDto.ResponseObj> labelAllocateMove(
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "라벨링 이관",
required = true,
@@ -247,13 +186,12 @@ public class LabelAllocateApiController {
@RequestBody
LabelAllocateDto.AllocateMoveDto dto) {
labelAllocateService.allocateMove(
dto.getAutoType(),
dto.getStage(),
dto.getLabelers(),
dto.getCompareYyyy(),
dto.getTargetYyyy());
return ApiResponseDto.ok(null);
return ApiResponseDto.okObject(
labelAllocateService.allocateMove(
dto.getAutoType(),
dto.getStage(),
dto.getLabelers(),
dto.getCompareYyyy(),
dto.getTargetYyyy()));
}
}