모델등록 수정
This commit is contained in:
@@ -92,9 +92,8 @@ public class ModelTrainMngApiController {
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping
|
||||
public ApiResponseDto<String> createModelTrain(@Valid @RequestBody ModelTrainMngDto.AddReq req) {
|
||||
modelTrainMngService.createModelTrain(req);
|
||||
return ApiResponseDto.ok("ok");
|
||||
public ApiResponseDto<UUID> createModelTrain(@Valid @RequestBody ModelTrainMngDto.AddReq req) {
|
||||
return ApiResponseDto.ok(modelTrainMngService.createModelTrain(req));
|
||||
}
|
||||
|
||||
@Operation(summary = "모델학습 config 정보 조회", description = "모델학습 config 정보 조회 API")
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ModelTrainMngService {
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
public void createModelTrain(ModelTrainMngDto.AddReq req) {
|
||||
public UUID createModelTrain(ModelTrainMngDto.AddReq req) {
|
||||
HyperParam hyperParam = req.getHyperParam();
|
||||
HyperParamDto.Basic hyper = new HyperParamDto.Basic();
|
||||
|
||||
@@ -81,7 +81,10 @@ public class ModelTrainMngService {
|
||||
}
|
||||
|
||||
// 모델학습 테이블 저장
|
||||
Long modelId = modelTrainMngCoreService.saveModel(req);
|
||||
ModelTrainMngDto.Basic modelDto = modelTrainMngCoreService.saveModel(req);
|
||||
|
||||
Long modelId = modelDto.getId();
|
||||
UUID modelUuid = modelDto.getUuid();
|
||||
|
||||
// 모델학습 데이터셋 저장
|
||||
modelTrainMngCoreService.saveModelDataset(modelId, req);
|
||||
@@ -109,10 +112,7 @@ public class ModelTrainMngService {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// 저장 다 끝난 뒤에 job enqueue
|
||||
if (Boolean.TRUE.equals(req.getIsStart())) {
|
||||
trainJobService.enqueue(modelId); // job 저장 + 이벤트 발행(실행은 AFTER_COMMIT)
|
||||
}
|
||||
return modelUuid;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -78,7 +78,7 @@ public class ModelTrainMngCoreService {
|
||||
* @param addReq
|
||||
* @return
|
||||
*/
|
||||
public Long saveModel(ModelTrainMngDto.AddReq addReq) {
|
||||
public ModelTrainMngDto.Basic saveModel(ModelTrainMngDto.AddReq addReq) {
|
||||
ModelMasterEntity entity = new ModelMasterEntity();
|
||||
ModelHyperParamEntity hyperParamEntity = new ModelHyperParamEntity();
|
||||
|
||||
@@ -117,7 +117,12 @@ public class ModelTrainMngCoreService {
|
||||
|
||||
entity.setCreatedUid(userUtil.getId());
|
||||
ModelMasterEntity resultEntity = modelMngRepository.save(entity);
|
||||
return resultEntity.getId();
|
||||
|
||||
ModelTrainMngDto.Basic result = new ModelTrainMngDto.Basic();
|
||||
result.setId(resultEntity.getId());
|
||||
result.setUuid(resultEntity.getUuid());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user