[KC-168] 라벨링 툴 > 목록, 기본 페이징 API 지정uuid 페이징 계산 추가
This commit is contained in:
@@ -20,9 +20,8 @@ public class TrainingDataLabelCoreService {
|
|||||||
|
|
||||||
private final TrainingDataLabelRepository trainingDataLabelRepository;
|
private final TrainingDataLabelRepository trainingDataLabelRepository;
|
||||||
|
|
||||||
public Page<LabelingListDto> findLabelingAssignedList(
|
public Page<LabelingListDto> findLabelingAssignedList(searchReq searchReq, String userId) {
|
||||||
searchReq searchReq, String userId, String status) {
|
return trainingDataLabelRepository.findLabelingAssignedList(searchReq, userId);
|
||||||
return trainingDataLabelRepository.findLabelingAssignedList(searchReq, userId, status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LabelingGeometryInfo findLabelingAssignedGeom(String assignmentUid) {
|
public LabelingGeometryInfo findLabelingAssignedGeom(String assignmentUid) {
|
||||||
@@ -77,7 +76,7 @@ public class TrainingDataLabelCoreService {
|
|||||||
return trainingDataLabelRepository.getDetail(assignmentUid);
|
return trainingDataLabelRepository.getDetail(assignmentUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultPaging getDefaultPagingNumber(String userId, Integer size) {
|
public DefaultPaging getDefaultPagingNumber(String userId, Integer size, String assignmentUid) {
|
||||||
return trainingDataLabelRepository.getDefaultPagingNumber(userId, size);
|
return trainingDataLabelRepository.getDefaultPagingNumber(userId, size, assignmentUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.springframework.data.domain.Page;
|
|||||||
|
|
||||||
public interface TrainingDataLabelRepositoryCustom {
|
public interface TrainingDataLabelRepositoryCustom {
|
||||||
|
|
||||||
Page<LabelingListDto> findLabelingAssignedList(searchReq searchReq, String userId, String status);
|
Page<LabelingListDto> findLabelingAssignedList(searchReq searchReq, String userId);
|
||||||
|
|
||||||
LabelingGeometryInfo findLabelingAssignedGeom(String assignmentUid);
|
LabelingGeometryInfo findLabelingAssignedGeom(String assignmentUid);
|
||||||
|
|
||||||
@@ -30,5 +30,5 @@ public interface TrainingDataLabelRepositoryCustom {
|
|||||||
|
|
||||||
DetailRes getDetail(UUID assignmentUid);
|
DetailRes getDetail(UUID assignmentUid);
|
||||||
|
|
||||||
DefaultPaging getDefaultPagingNumber(String userId, Integer size);
|
DefaultPaging getDefaultPagingNumber(String userId, Integer size, String assignmentUid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<LabelingListDto> findLabelingAssignedList(
|
public Page<LabelingListDto> findLabelingAssignedList(searchReq searchReq, String userId) {
|
||||||
searchReq searchReq, String userId, String status) {
|
|
||||||
|
|
||||||
// 완료된 라벨은 오늘만, 나머지는 전체 조회
|
// 완료된 라벨은 오늘만, 나머지는 전체 조회
|
||||||
LocalDate today = LocalDate.now(ZoneId.of("Asia/Seoul"));
|
LocalDate today = LocalDate.now(ZoneId.of("Asia/Seoul"));
|
||||||
@@ -106,9 +105,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
.orderBy(
|
.orderBy(
|
||||||
labelingAssignmentEntity.createdDate.asc(),
|
labelingAssignmentEntity.createdDate.asc(),
|
||||||
labelingAssignmentEntity.inferenceGeomUid
|
labelingAssignmentEntity.inferenceGeomUid.asc())
|
||||||
.asc() // 008288b5-5911-41d5-b8fc-b8c8f33d5434 / 362
|
|
||||||
)
|
|
||||||
.fetch();
|
.fetch();
|
||||||
|
|
||||||
Long count =
|
Long count =
|
||||||
@@ -560,7 +557,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DefaultPaging getDefaultPagingNumber(String userId, Integer size) {
|
public DefaultPaging getDefaultPagingNumber(String userId, Integer size, String assignmentUid) {
|
||||||
|
|
||||||
ZoneId KST = ZoneId.of("Asia/Seoul");
|
ZoneId KST = ZoneId.of("Asia/Seoul");
|
||||||
ZonedDateTime todayStart = ZonedDateTime.now(KST).toLocalDate().atStartOfDay(KST);
|
ZonedDateTime todayStart = ZonedDateTime.now(KST).toLocalDate().atStartOfDay(KST);
|
||||||
@@ -588,7 +585,9 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.where(
|
.where(
|
||||||
labelingAssignmentEntity.workerUid.eq(userId),
|
labelingAssignmentEntity.workerUid.eq(userId),
|
||||||
stateCondition,
|
stateCondition,
|
||||||
labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId()))
|
assignmentUid == null
|
||||||
|
? labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId())
|
||||||
|
: labelingAssignmentEntity.assignmentUid.eq(UUID.fromString(assignmentUid)))
|
||||||
.orderBy(
|
.orderBy(
|
||||||
labelingAssignmentEntity.createdDate.asc(),
|
labelingAssignmentEntity.createdDate.asc(),
|
||||||
labelingAssignmentEntity.inferenceGeomUid.asc())
|
labelingAssignmentEntity.inferenceGeomUid.asc())
|
||||||
|
|||||||
@@ -49,11 +49,9 @@ public class TrainingDataLabelApiController {
|
|||||||
public ApiResponseDto<Page<LabelingListDto>> findLabelingAssignedList(
|
public ApiResponseDto<Page<LabelingListDto>> findLabelingAssignedList(
|
||||||
@RequestParam(defaultValue = "0") int page,
|
@RequestParam(defaultValue = "0") int page,
|
||||||
@RequestParam(defaultValue = "20") int size,
|
@RequestParam(defaultValue = "20") int size,
|
||||||
@RequestParam(defaultValue = "01022223333") String userId,
|
@RequestParam(defaultValue = "01022223333") String userId) {
|
||||||
@RequestParam(defaultValue = "ASSIGNED,SKIP,DONE", required = false) String status) {
|
|
||||||
TrainingDataLabelDto.searchReq searchReq = new TrainingDataLabelDto.searchReq(page, size, "");
|
TrainingDataLabelDto.searchReq searchReq = new TrainingDataLabelDto.searchReq(page, size, "");
|
||||||
return ApiResponseDto.ok(
|
return ApiResponseDto.ok(trainingDataLabelService.findLabelingAssignedList(searchReq, userId));
|
||||||
trainingDataLabelService.findLabelingAssignedList(searchReq, userId, status));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Hidden
|
@Hidden
|
||||||
@@ -177,7 +175,11 @@ public class TrainingDataLabelApiController {
|
|||||||
public ApiResponseDto<TrainingDataLabelDto.DefaultPaging> getDefaultPagingNumber(
|
public ApiResponseDto<TrainingDataLabelDto.DefaultPaging> getDefaultPagingNumber(
|
||||||
@Parameter(description = "사번", example = "01022223333") @RequestParam String userId,
|
@Parameter(description = "사번", example = "01022223333") @RequestParam String userId,
|
||||||
@Parameter(description = "페이징 사이즈", example = "20") @RequestParam(defaultValue = "20")
|
@Parameter(description = "페이징 사이즈", example = "20") @RequestParam(defaultValue = "20")
|
||||||
Integer size) {
|
Integer size,
|
||||||
return ApiResponseDto.ok(trainingDataLabelService.getDefaultPagingNumber(userId, size));
|
@Parameter(description = "개별 UUID", example = "79bcdbbe-6ed4-4caa-b4a4-22f3cf2f9d25")
|
||||||
|
@RequestParam(required = false)
|
||||||
|
String assignmentUid) {
|
||||||
|
return ApiResponseDto.ok(
|
||||||
|
trainingDataLabelService.getDefaultPagingNumber(userId, size, assignmentUid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,8 @@ public class TrainingDataLabelService {
|
|||||||
this.trainingDataLabelCoreService = trainingDataLabelCoreService;
|
this.trainingDataLabelCoreService = trainingDataLabelCoreService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<LabelingListDto> findLabelingAssignedList(
|
public Page<LabelingListDto> findLabelingAssignedList(searchReq searchReq, String userId) {
|
||||||
searchReq searchReq, String userId, String status) {
|
return trainingDataLabelCoreService.findLabelingAssignedList(searchReq, userId);
|
||||||
return trainingDataLabelCoreService.findLabelingAssignedList(searchReq, userId, status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LabelingGeometryInfo findLabelingAssignedGeom(String assignmentUid) {
|
public LabelingGeometryInfo findLabelingAssignedGeom(String assignmentUid) {
|
||||||
@@ -85,7 +84,7 @@ public class TrainingDataLabelService {
|
|||||||
return trainingDataLabelCoreService.getDetail(assignmentUid);
|
return trainingDataLabelCoreService.getDetail(assignmentUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultPaging getDefaultPagingNumber(String userId, Integer size) {
|
public DefaultPaging getDefaultPagingNumber(String userId, Integer size, String assignmentUid) {
|
||||||
return trainingDataLabelCoreService.getDefaultPagingNumber(userId, size);
|
return trainingDataLabelCoreService.getDefaultPagingNumber(userId, size, assignmentUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user