spotlessApply 적용 #170

Merged
teddy merged 1 commits from feat/training_260324 into develop 2026-03-25 12:33:05 +09:00
3 changed files with 36 additions and 58 deletions

View File

@@ -274,19 +274,20 @@ public class DatasetApiController {
@Operation(summary = "납품 학습데이터셋 등록", description = "납품 학습데이터셋 등록 API") @Operation(summary = "납품 학습데이터셋 등록", description = "납품 학습데이터셋 등록 API")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
responseCode = "200", responseCode = "200",
description = "등록 성공", description = "등록 성공",
content = content =
@Content( @Content(
mediaType = "application/json", mediaType = "application/json",
schema = @Schema(implementation = Page.class))), schema = @Schema(implementation = Page.class))),
@ApiResponse(responseCode = "404", description = "조회 오류", content = @Content), @ApiResponse(responseCode = "404", description = "조회 오류", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
}) })
@PostMapping("/deliveries") @PostMapping("/deliveries")
public ApiResponseDto<ResponseObj> insertDeliveriesDataset(@RequestBody AddDeliveriesReq req) throws IOException { public ApiResponseDto<ResponseObj> insertDeliveriesDataset(@RequestBody AddDeliveriesReq req)
throws IOException {
return ApiResponseDto.createOK(datasetService.insertDeliveriesDataset(req)); return ApiResponseDto.createOK(datasetService.insertDeliveriesDataset(req));
} }
} }

View File

@@ -62,8 +62,7 @@ import org.springframework.transaction.annotation.Transactional;
public class DatasetService { public class DatasetService {
private final DatasetCoreService datasetCoreService; private final DatasetCoreService datasetCoreService;
@PersistenceContext @PersistenceContext private EntityManager em;
private EntityManager em;
private final ObjectMapper mapper = new ObjectMapper(); private final ObjectMapper mapper = new ObjectMapper();
@Value("${file.dataset-dir}") @Value("${file.dataset-dir}")
@@ -615,6 +614,7 @@ public class DatasetService {
/** /**
* 납품 데이터 등록 * 납품 데이터 등록
*
* @param req 폴더경로, 메모 * @param req 폴더경로, 메모
* @return 성공/실패 여부 * @return 성공/실패 여부
*/ */
@@ -627,10 +627,7 @@ public class DatasetService {
DatasetMngRegDto datasetMngRegDto = new DatasetMngRegDto(); DatasetMngRegDto datasetMngRegDto = new DatasetMngRegDto();
String uid = UUID.randomUUID() String uid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
.toString()
.replace("-", "")
.toUpperCase();
datasetMngRegDto.setUid(uid); datasetMngRegDto.setUid(uid);
datasetMngRegDto.setDataType("DELIVER"); datasetMngRegDto.setDataType("DELIVER");
@@ -654,8 +651,7 @@ public class DatasetService {
datasetCoreService.updateDatasetUploadStatus(datasetUid); datasetCoreService.updateDatasetUploadStatus(datasetUid);
log.info("========== 전체 완료. 총 소요시간: {} ms ==========", log.info("========== 전체 완료. 총 소요시간: {} ms ==========", System.currentTimeMillis() - startTime);
System.currentTimeMillis() - startTime);
return new ResponseObj(ApiResponseCode.OK, "업로드 성공하였습니다."); return new ResponseObj(ApiResponseCode.OK, "업로드 성공하였습니다.");
} }
@@ -681,8 +677,11 @@ public class DatasetService {
} }
} }
log.info("[{}] 완료. 총 {}건, 소요시간: {} ms", log.info(
type.toUpperCase(), count, System.currentTimeMillis() - start); "[{}] 완료. 총 {}건, 소요시간: {} ms",
type.toUpperCase(),
count,
System.currentTimeMillis() - start);
} }
@Transactional @Transactional
@@ -733,20 +732,20 @@ public class DatasetService {
root.set("features", features); root.set("features", features);
DatasetObjRegDto objRegDto = DatasetObjRegDto objRegDto =
DatasetObjRegDto.builder() DatasetObjRegDto.builder()
.datasetUid(datasetUid) .datasetUid(datasetUid)
.compareYyyy(Integer.parseInt(compareYyyy)) .compareYyyy(Integer.parseInt(compareYyyy))
.compareClassCd(compareClassCd) .compareClassCd(compareClassCd)
.targetYyyy(Integer.parseInt(targetYyyy)) .targetYyyy(Integer.parseInt(targetYyyy))
.targetClassCd(targetClassCd) .targetClassCd(targetClassCd)
.comparePath(comparePath) .comparePath(comparePath)
.targetPath(targetPath) .targetPath(targetPath)
.labelPath(labelPath) .labelPath(labelPath)
.mapSheetNum(mapSheetNum) .mapSheetNum(mapSheetNum)
.geojson(root) .geojson(root)
.geojsonPath(geojsonPath) .geojsonPath(geojsonPath)
.fileName(fileName) .fileName(fileName)
.build(); .build();
// insert // insert
if (subDir.equals("train")) { if (subDir.equals("train")) {
@@ -766,24 +765,3 @@ public class DatasetService {
} }
} }
} }

View File

@@ -24,7 +24,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronizationManager;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor