38 lines
1.5 KiB
Java
38 lines
1.5 KiB
Java
package com.kamco.cd.kamcoback.label;
|
|
|
|
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.TargetInspector;
|
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.TargetUser;
|
|
import com.kamco.cd.kamcoback.label.service.LabelAllocateService;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import java.util.List;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@Slf4j
|
|
@Tag(name = "라벨링 작업 관리", description = "라벨링 작업 관리")
|
|
@RequestMapping({"/api/label"})
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
public class LabelAllocateApiController {
|
|
|
|
private final LabelAllocateService labelAllocateService;
|
|
|
|
// 라벨링 수량 할당하는 로직 테스트
|
|
@PostMapping("/allocate")
|
|
public ApiResponseDto<Void> labelAllocate(@RequestBody LabelAllocateDto dto) {
|
|
|
|
List<TargetUser> targets =
|
|
List.of(new TargetUser("1234567", 1000), new TargetUser("2345678", 400), new TargetUser("3456789", 440));
|
|
List<TargetInspector> inspectors = List.of(new TargetInspector("9876543", 1000), new TargetInspector("8765432", 340), new TargetInspector("98765432", 500));
|
|
labelAllocateService.allocateAsc(targets, inspectors);
|
|
|
|
return ApiResponseDto.ok(null);
|
|
}
|
|
}
|