Refactor: 이미지 Title -> ImageUrl

This commit is contained in:
김용수 2024-09-03 17:06:03 +09:00
parent 3d8d766a04
commit 971c3fb6fd
3 changed files with 23 additions and 6 deletions

View File

@ -38,4 +38,19 @@ public class LabelController {
return SuccessResponse.empty(); return SuccessResponse.empty();
} }
@Operation(summary = "이미지 단위 레이블링", description = "진행한 레이블링을 저장합니다.")
@SwaggerApiSuccess(description = "해당 이미지에 대한 레이블링을 저장합니다.")
@SwaggerApiError({ErrorCode.EMPTY_REQUEST_PARAMETER, ErrorCode.SERVER_ERROR})
@PostMapping("/image/{image_id}")
public BaseResponse<Void> imageLabeling(
@CurrentUser final Integer memberId,
@PathVariable("project_id") final Integer projectId,
@PathVariable("image_id") final Integer imageId
) {
labelService.save(imageId);
return SuccessResponse.empty();
}
} }

View File

@ -20,16 +20,15 @@ public class ImageRequest {
@NotEmpty(message = "이미지 PK를 입력하세요") @NotEmpty(message = "이미지 PK를 입력하세요")
private Long id; private Long id;
// TODO: Title 들어가야 @Schema(description = "이미지 url", example = "image.png")
// @Schema(description = "이미지 PK", example = "2") @NotEmpty(message = "이미지 url을 입력하세요")
// @NotEmpty(message = "이미지 PK를 입력하세요") private String imageUrl;
// private String title;
@Schema(description = "프로젝트 유형", example = "classification") @Schema(description = "프로젝트 유형", example = "classification")
@NotNull(message = "카테고리를 입력하세요.") @NotNull(message = "카테고리를 입력하세요.")
private ProjectType projectType; private ProjectType projectType;
public static ImageRequest of(Image image, ProjectType projectType){ public static ImageRequest of(Image image, ProjectType projectType){
return new ImageRequest(image.getId(), projectType); return new ImageRequest(image.getId(), image.getImageUrl(), projectType);
} }
} }

View File

@ -113,4 +113,7 @@ public class LabelService {
throw new CustomException(ErrorCode.PARTICIPANT_UNAUTHORIZED); throw new CustomException(ErrorCode.PARTICIPANT_UNAUTHORIZED);
} }
} }
public void save(final Integer imageId) {
}
} }