dataset 테이블 수정, 모델학습 설정 dto 추가
This commit is contained in:
@@ -109,7 +109,8 @@ public class DatasetCoreService
|
||||
entity.setTitle(registerReq.getTitle());
|
||||
// entity.setYear(registerReq.getYear());
|
||||
entity.setGroupTitle(LearnDataType.PRODUCTION.getId());
|
||||
entity.setDataYear(registerReq.getYear());
|
||||
entity.setCompareYyyy(registerReq.getCompareYear());
|
||||
entity.setTargetYyyy(registerReq.getTargetYyyy());
|
||||
entity.setRoundNo(registerReq.getRoundNo() != null ? registerReq.getRoundNo() : 1L);
|
||||
entity.setMemo(registerReq.getMemo());
|
||||
entity.setStatus(LearnDataRegister.READY.getId());
|
||||
|
||||
@@ -5,7 +5,8 @@ import com.kamco.cd.training.common.exception.CustomApiException;
|
||||
import com.kamco.cd.training.common.exception.NotFoundException;
|
||||
import com.kamco.cd.training.common.utils.UserUtil;
|
||||
import com.kamco.cd.training.model.dto.ModelMngDto;
|
||||
import com.kamco.cd.training.model.dto.ModelMngDto.Basic;
|
||||
import com.kamco.cd.training.model.dto.ModelTrainDto;
|
||||
import com.kamco.cd.training.model.dto.ModelTrainDto.Basic;
|
||||
import com.kamco.cd.training.postgres.entity.ModelDatasetMappEntity;
|
||||
import com.kamco.cd.training.postgres.entity.ModelMasterEntity;
|
||||
import com.kamco.cd.training.postgres.repository.model.ModelDatasetMappRepository;
|
||||
@@ -31,7 +32,7 @@ public class ModelMngCoreService {
|
||||
* @param searchReq 검색 조건
|
||||
* @return 페이징 처리된 모델 목록
|
||||
*/
|
||||
public Page<Basic> findByModelList(ModelMngDto.SearchReq searchReq) {
|
||||
public Page<Basic> findByModelList(ModelTrainDto.SearchReq searchReq) {
|
||||
Page<ModelMasterEntity> entityPage = modelMngRepository.findByModels(searchReq);
|
||||
return entityPage.map(ModelMasterEntity::toDto);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.Instant;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@@ -29,16 +30,16 @@ public class DatasetEntity {
|
||||
@Column(name = "dataset_uid", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "uuid", nullable = false)
|
||||
private UUID uuid;
|
||||
|
||||
@Size(max = 200)
|
||||
@Column(name = "group_title", length = 200)
|
||||
@NotNull
|
||||
@Column(name = "group_title", nullable = false, length = 200)
|
||||
private String groupTitle;
|
||||
|
||||
@Size(max = 10)
|
||||
@Column(name = "data_year", length = 10)
|
||||
private String dataYear;
|
||||
@Column(name = "compare_yyyy", nullable = false)
|
||||
private Integer compareYyyy;
|
||||
|
||||
@Column(name = "target_yyyy", nullable = false)
|
||||
private Integer targetYyyy;
|
||||
|
||||
@Size(max = 50)
|
||||
@ColumnDefault("'CREATE'")
|
||||
@@ -65,6 +66,25 @@ public class DatasetEntity {
|
||||
@Column(name = "status", length = 20)
|
||||
private String status;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "reg_user_id", length = 50)
|
||||
private String regUserId;
|
||||
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "reg_dttm")
|
||||
private Instant regDttm;
|
||||
|
||||
@Column(name = "mod_dttm")
|
||||
private Instant modDttm;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id1;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "created_by", length = 50)
|
||||
private String createdBy;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "created_dttm", nullable = false)
|
||||
@@ -82,13 +102,34 @@ public class DatasetEntity {
|
||||
@Column(name = "total_items")
|
||||
private Long totalItems;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "updated_by", length = 50)
|
||||
private String updatedBy;
|
||||
|
||||
@Column(name = "updated_dttm")
|
||||
private ZonedDateTime updatedDttm;
|
||||
|
||||
@Column(name = "class_counts", columnDefinition = "jsonb")
|
||||
@NotNull
|
||||
@ColumnDefault("uuid_generate_v4()")
|
||||
@Column(name = "uuid", nullable = false)
|
||||
private UUID uuid;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "total_object_count")
|
||||
private Long totalObjectCount;
|
||||
|
||||
@Size(max = 1000)
|
||||
@Column(name = "dataset_path", length = 1000)
|
||||
private String datasetPath;
|
||||
|
||||
@Column(name = "class_counts")
|
||||
@JdbcTypeCode(SqlTypes.JSON)
|
||||
private Map<String, Integer> classCounts;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "uid")
|
||||
private String uid;
|
||||
|
||||
public DatasetDto.Basic toDto() {
|
||||
return new DatasetDto.Basic(
|
||||
this.id,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.kamco.cd.training.postgres.entity;
|
||||
|
||||
import com.kamco.cd.training.model.dto.ModelMngDto;
|
||||
import com.kamco.cd.training.model.dto.ModelTrainDto;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
@@ -90,8 +90,8 @@ public class ModelMasterEntity {
|
||||
@Column(name = "train_type")
|
||||
private String trainType;
|
||||
|
||||
public ModelMngDto.Basic toDto() {
|
||||
return new ModelMngDto.Basic(
|
||||
public ModelTrainDto.Basic toDto() {
|
||||
return new ModelTrainDto.Basic(
|
||||
this.id,
|
||||
this.uuid,
|
||||
this.modelVer,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.kamco.cd.training.postgres.repository.model;
|
||||
|
||||
import com.kamco.cd.training.model.dto.ModelMngDto;
|
||||
import com.kamco.cd.training.model.dto.ModelTrainDto;
|
||||
import com.kamco.cd.training.postgres.entity.ModelMasterEntity;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
@@ -14,7 +14,7 @@ public interface ModelMngRepositoryCustom {
|
||||
* @param searchReq
|
||||
* @return
|
||||
*/
|
||||
Page<ModelMasterEntity> findByModels(ModelMngDto.SearchReq searchReq);
|
||||
Page<ModelMasterEntity> findByModels(ModelTrainDto.SearchReq searchReq);
|
||||
|
||||
Optional<ModelMasterEntity> findByUuid(UUID uuid);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.kamco.cd.training.postgres.repository.model;
|
||||
|
||||
import static com.kamco.cd.training.postgres.entity.QModelMasterEntity.modelMasterEntity;
|
||||
|
||||
import com.kamco.cd.training.model.dto.ModelMngDto;
|
||||
import com.kamco.cd.training.model.dto.ModelTrainDto;
|
||||
import com.kamco.cd.training.postgres.entity.ModelMasterEntity;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
@@ -28,7 +28,7 @@ public class ModelMngRepositoryImpl implements ModelMngRepositoryCustom {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<ModelMasterEntity> findByModels(ModelMngDto.SearchReq req) {
|
||||
public Page<ModelMasterEntity> findByModels(ModelTrainDto.SearchReq req) {
|
||||
Pageable pageable = req.toPageable();
|
||||
BooleanBuilder builder = new BooleanBuilder();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user