하이퍼 파라미터 사용회수 카운트 기능 추가 및 조회 수정
This commit is contained in:
@@ -115,7 +115,7 @@ public class HyperParamDto {
|
||||
@JsonFormatDttm private ZonedDateTime createDttm;
|
||||
@JsonFormatDttm private ZonedDateTime lastUsedDttm;
|
||||
private String memo;
|
||||
private Long totalUseCnt;
|
||||
private Integer totalUseCnt;
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -34,7 +34,6 @@ public class HyperParamCoreService {
|
||||
|
||||
ModelHyperParamEntity entity = new ModelHyperParamEntity();
|
||||
entity.setHyperVer(firstVersion);
|
||||
entity.setTotalUseCnt(entity.getTotalUseCnt() == null ? 1 : entity.getTotalUseCnt() + 1);
|
||||
applyHyperParam(entity, createReq);
|
||||
|
||||
// user
|
||||
|
||||
@@ -104,10 +104,13 @@ public class ModelTrainMngCoreService {
|
||||
if (hyperParamEntity == null || hyperParamEntity.getHyperVer() == null) {
|
||||
throw new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 하이퍼 파라미터 사용회수 업데이트
|
||||
// 하이퍼 파라미터 사용 횟수 업데이트
|
||||
hyperParamEntity.setTotalUseCnt(
|
||||
hyperParamEntity.getTotalUseCnt() == null ? 1 : hyperParamEntity.getTotalUseCnt() + 1);
|
||||
|
||||
// 마지막 사용 시간 업데이트
|
||||
hyperParamEntity.setLastUsedDttm(ZonedDateTime.now());
|
||||
|
||||
String modelVer =
|
||||
String.join(
|
||||
".", addReq.getModelNo(), hyperParamEntity.getHyperVer(), entity.getUuid().toString());
|
||||
|
||||
@@ -129,7 +129,8 @@ public class HyperParamRepositoryImpl implements HyperParamRepositoryCustom {
|
||||
modelHyperParamEntity.hyperVer,
|
||||
modelHyperParamEntity.createdDttm,
|
||||
modelHyperParamEntity.lastUsedDttm,
|
||||
modelHyperParamEntity.memo))
|
||||
modelHyperParamEntity.memo,
|
||||
modelHyperParamEntity.totalUseCnt))
|
||||
.from(modelHyperParamEntity)
|
||||
.where(builder);
|
||||
|
||||
@@ -154,6 +155,11 @@ public class HyperParamRepositoryImpl implements HyperParamRepositoryCustom {
|
||||
asc
|
||||
? modelHyperParamEntity.lastUsedDttm.asc()
|
||||
: modelHyperParamEntity.lastUsedDttm.desc());
|
||||
case "totalUseCnt" ->
|
||||
query.orderBy(
|
||||
asc
|
||||
? modelHyperParamEntity.totalUseCnt.asc()
|
||||
: modelHyperParamEntity.totalUseCnt.desc());
|
||||
|
||||
default -> query.orderBy(modelHyperParamEntity.createdDttm.desc());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user