Merge pull request '모델학습 설정 dto 수정' (#14) from feat/training_260202 into develop
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
@@ -47,7 +47,7 @@ public class DatasetApiController {
|
||||
example = "",
|
||||
schema = @Schema(allowableValues = {"DELIVER", "PRODUCTION"}))
|
||||
@RequestParam(required = false)
|
||||
String groupTitle,
|
||||
String dataType,
|
||||
@Parameter(description = "제목", example = "") @RequestParam(required = false) String title,
|
||||
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
|
||||
int page,
|
||||
@@ -55,7 +55,7 @@ public class DatasetApiController {
|
||||
int size) {
|
||||
DatasetDto.SearchReq searchReq = new DatasetDto.SearchReq();
|
||||
searchReq.setTitle(title);
|
||||
searchReq.setGroupTitle(groupTitle);
|
||||
searchReq.setDataType(dataType);
|
||||
searchReq.setPage(page);
|
||||
searchReq.setSize(size);
|
||||
return ApiResponseDto.ok(datasetService.searchDatasets(searchReq));
|
||||
|
||||
@@ -33,8 +33,6 @@ public class DatasetDto {
|
||||
|
||||
private Long id;
|
||||
private UUID uuid;
|
||||
private String groupTitle;
|
||||
private String groupTitleCd;
|
||||
private String title;
|
||||
private Long roundNo;
|
||||
private Integer compareYyyy;
|
||||
@@ -50,7 +48,6 @@ public class DatasetDto {
|
||||
public Basic(
|
||||
Long id,
|
||||
UUID uuid,
|
||||
String groupTitle,
|
||||
String title,
|
||||
Long roundNo,
|
||||
Integer compareYyyy,
|
||||
@@ -63,8 +60,6 @@ public class DatasetDto {
|
||||
String dataType) {
|
||||
this.id = id;
|
||||
this.uuid = uuid;
|
||||
this.groupTitle = getGroupTitle(groupTitle);
|
||||
this.groupTitleCd = groupTitle;
|
||||
this.title = title;
|
||||
this.roundNo = roundNo;
|
||||
this.compareYyyy = compareYyyy;
|
||||
@@ -84,11 +79,6 @@ public class DatasetDto {
|
||||
return String.format("%.2fG", giga);
|
||||
}
|
||||
|
||||
public String getGroupTitle(String groupTitleCd) {
|
||||
LearnDataType type = Enums.fromId(LearnDataType.class, groupTitleCd);
|
||||
return type == null ? null : type.getText();
|
||||
}
|
||||
|
||||
public String getStatus(String status) {
|
||||
LearnDataRegister type = Enums.fromId(LearnDataRegister.class, status);
|
||||
return type == null ? null : type.getText();
|
||||
@@ -130,7 +120,7 @@ public class DatasetDto {
|
||||
public static class SearchReq {
|
||||
|
||||
@Schema(description = "구분")
|
||||
private String groupTitle;
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "제목 (부분 검색)", example = "1차")
|
||||
private String title;
|
||||
|
||||
@@ -108,7 +108,7 @@ public class DatasetCoreService
|
||||
DatasetEntity entity = new DatasetEntity();
|
||||
entity.setTitle(registerReq.getTitle());
|
||||
// entity.setYear(registerReq.getYear());
|
||||
entity.setGroupTitle(LearnDataType.PRODUCTION.getId());
|
||||
entity.setDataType(LearnDataType.PRODUCTION.getId());
|
||||
entity.setCompareYyyy(registerReq.getCompareYear());
|
||||
entity.setTargetYyyy(registerReq.getTargetYyyy());
|
||||
entity.setRoundNo(registerReq.getRoundNo() != null ? registerReq.getRoundNo() : 1L);
|
||||
@@ -207,7 +207,6 @@ public class DatasetCoreService
|
||||
return ModelMngDto.DatasetInfo.builder()
|
||||
.id(entity.getId())
|
||||
.title(entity.getTitle())
|
||||
.groupTitle(entity.getGroupTitle())
|
||||
.totalItems(entity.getTotalItems())
|
||||
.totalSize(totalSizeStr)
|
||||
.classCounts(classCounts)
|
||||
|
||||
@@ -30,11 +30,6 @@ public class DatasetEntity {
|
||||
@Column(name = "dataset_uid", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Size(max = 200)
|
||||
@NotNull
|
||||
@Column(name = "group_title", nullable = false, length = 200)
|
||||
private String groupTitle;
|
||||
|
||||
@Column(name = "compare_yyyy", nullable = false)
|
||||
private Integer compareYyyy;
|
||||
|
||||
@@ -134,7 +129,6 @@ public class DatasetEntity {
|
||||
return new DatasetDto.Basic(
|
||||
this.id,
|
||||
this.uuid,
|
||||
this.groupTitle,
|
||||
this.title,
|
||||
this.roundNo,
|
||||
this.compareYyyy,
|
||||
|
||||
@@ -46,8 +46,8 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
}
|
||||
|
||||
// 구분
|
||||
if (StringUtils.isNotBlank(searchReq.getGroupTitle())) {
|
||||
builder.and(dataset.groupTitle.eq(searchReq.getGroupTitle()));
|
||||
if (StringUtils.isNotBlank(searchReq.getDataType())) {
|
||||
builder.and(dataset.dataType.eq(searchReq.getDataType()));
|
||||
}
|
||||
|
||||
// Entity 직접 조회 (Projections 사용 지양)
|
||||
@@ -85,7 +85,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
BooleanBuilder builder = new BooleanBuilder();
|
||||
|
||||
if (StringUtils.isNotBlank(selectType) && !"CURRENT".equals(selectType)) {
|
||||
builder.and(dataset.groupTitle.eq(selectType));
|
||||
builder.and(dataset.dataType.eq(selectType));
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
@@ -94,7 +94,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
SelectDataSet.class,
|
||||
dataset.id,
|
||||
dataset.uuid,
|
||||
dataset.groupTitle,
|
||||
dataset.dataType,
|
||||
dataset.title,
|
||||
dataset.roundNo,
|
||||
dataset.memo,
|
||||
@@ -115,7 +115,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
.groupBy(
|
||||
dataset.id,
|
||||
dataset.uuid,
|
||||
dataset.groupTitle,
|
||||
dataset.dataType,
|
||||
dataset.title,
|
||||
dataset.roundNo,
|
||||
dataset.memo)
|
||||
@@ -146,7 +146,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(selectType) && !"CURRENT".equals(selectType)) {
|
||||
builder.and(dataset.groupTitle.eq(selectType));
|
||||
builder.and(dataset.dataType.eq(selectType));
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
@@ -155,7 +155,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
SelectDataSet.class,
|
||||
dataset.id,
|
||||
dataset.uuid,
|
||||
dataset.groupTitle,
|
||||
dataset.dataType,
|
||||
dataset.title,
|
||||
dataset.roundNo,
|
||||
dataset.memo,
|
||||
@@ -167,7 +167,7 @@ public class DatasetRepositoryImpl implements DatasetRepositoryCustom {
|
||||
.groupBy(
|
||||
dataset.id,
|
||||
dataset.uuid,
|
||||
dataset.groupTitle,
|
||||
dataset.dataType,
|
||||
dataset.title,
|
||||
dataset.roundNo,
|
||||
dataset.memo)
|
||||
|
||||
Reference in New Issue
Block a user