Merge pull request 'feat/dev_251201' (#109) from feat/dev_251201 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/109
This commit is contained in:
@@ -45,8 +45,7 @@ public class MenuDto {
|
||||
Long updatedUid,
|
||||
List<MenuDto.Basic> children,
|
||||
ZonedDateTime createdDttm,
|
||||
ZonedDateTime updatedDttm,
|
||||
String menuApiUrl) {
|
||||
ZonedDateTime updatedDttm) {
|
||||
this.menuUid = menuUid;
|
||||
this.menuNm = menuNm;
|
||||
this.menuUrl = menuUrl;
|
||||
@@ -59,7 +58,6 @@ public class MenuDto {
|
||||
this.children = children;
|
||||
this.createdDttm = createdDttm;
|
||||
this.updatedDttm = updatedDttm;
|
||||
this.menuApiUrl = menuApiUrl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +68,6 @@ public class MenuDto {
|
||||
private String menuUid;
|
||||
private String menuNm;
|
||||
private String menuUrl;
|
||||
private String menuApiUri;
|
||||
private String roles; // "ROLE_A,ROLE_B"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,12 @@ import jakarta.transaction.Transactional;
|
||||
import java.time.LocalDate;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "모델 관리", description = "모델 관리 API")
|
||||
@RequiredArgsConstructor
|
||||
|
||||
@@ -16,15 +16,34 @@ import org.springframework.data.domain.Sort;
|
||||
|
||||
public class ModelMngDto {
|
||||
|
||||
@CodeExpose
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ModelType implements EnumType {
|
||||
M1("모델 M1"),
|
||||
M2("모델 M2"),
|
||||
M3("모델 M3");
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "ModelMgmtDto Basic", description = "모델관리 엔티티 기본 정보")
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
public static class Basic {
|
||||
|
||||
private Long modelUid;
|
||||
private String modelVer;
|
||||
private String hyperVer;
|
||||
private String epochVer;
|
||||
private String dockerFileNm;
|
||||
|
||||
@JsonFormatDttm private ZonedDateTime createCompleteDttm;
|
||||
@JsonFormatDttm private ZonedDateTime recentUseDttm;
|
||||
@@ -35,22 +54,27 @@ public class ModelMngDto {
|
||||
@JsonFormatDttm private ZonedDateTime updatedDttm;
|
||||
private Long updatedUid;
|
||||
|
||||
private String modelType;
|
||||
private String filePath;
|
||||
private String fileName;
|
||||
private String memo;
|
||||
|
||||
public Basic(
|
||||
Long modelUid,
|
||||
String modelVer,
|
||||
String hyperVer,
|
||||
String epochVer,
|
||||
String dockerFileNm,
|
||||
ZonedDateTime createCompleteDttm,
|
||||
ZonedDateTime recentUseDttm,
|
||||
Boolean deleted,
|
||||
ZonedDateTime createdDttm,
|
||||
Long createdUid,
|
||||
ZonedDateTime updatedDttm,
|
||||
Long updatedUid) {
|
||||
Long updatedUid,
|
||||
String modelType,
|
||||
String filePath,
|
||||
String fileName,
|
||||
String memo) {
|
||||
this.modelUid = modelUid;
|
||||
this.modelVer = modelVer;
|
||||
this.hyperVer = hyperVer;
|
||||
this.epochVer = epochVer;
|
||||
this.dockerFileNm = dockerFileNm;
|
||||
this.createCompleteDttm = createCompleteDttm;
|
||||
this.recentUseDttm = recentUseDttm;
|
||||
this.deleted = deleted;
|
||||
@@ -58,6 +82,10 @@ public class ModelMngDto {
|
||||
this.createdUid = createdUid;
|
||||
this.updatedDttm = updatedDttm;
|
||||
this.updatedUid = updatedUid;
|
||||
this.modelType = modelType;
|
||||
this.filePath = filePath;
|
||||
this.fileName = fileName;
|
||||
this.memo = memo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,17 +95,18 @@ public class ModelMngDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ModelList {
|
||||
|
||||
private Integer rowNum;
|
||||
private String modelVer;
|
||||
private String fileName;
|
||||
private String modelType;
|
||||
private String createCompleteDttm;
|
||||
private String recentUseDttm;
|
||||
private BigDecimal f1Score;
|
||||
private BigDecimal precision;
|
||||
private BigDecimal recall;
|
||||
private BigDecimal accuracy;
|
||||
private BigDecimal iou;
|
||||
private String memo;
|
||||
private Boolean deleted;
|
||||
}
|
||||
|
||||
@@ -118,25 +147,4 @@ public class ModelMngDto {
|
||||
return PageRequest.of(page, size);
|
||||
}
|
||||
}
|
||||
|
||||
@CodeExpose
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ModelType implements EnumType {
|
||||
M1("모델 M1"),
|
||||
M2("모델 M2"),
|
||||
M3("모델 M3");
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,15 @@ package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.menu.dto.MenuDto;
|
||||
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -15,6 +23,7 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@Table(name = "tb_menu")
|
||||
public class MenuEntity extends CommonDateEntity {
|
||||
|
||||
@Id
|
||||
@Column(name = "menu_uid")
|
||||
private String menuUid;
|
||||
@@ -49,9 +58,6 @@ public class MenuEntity extends CommonDateEntity {
|
||||
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
|
||||
private List<MenuEntity> children = new ArrayList<>();
|
||||
|
||||
@Column(name = "menu_api_uri")
|
||||
private String menuApiUri;
|
||||
|
||||
public MenuDto.Basic toDto() {
|
||||
return new MenuDto.Basic(
|
||||
this.menuUid,
|
||||
@@ -65,7 +71,6 @@ public class MenuEntity extends CommonDateEntity {
|
||||
this.updatedUid,
|
||||
this.children.stream().map(MenuEntity::toDto).toList(),
|
||||
this.getCreatedDate(),
|
||||
this.getModifiedDate(),
|
||||
this.menuApiUri);
|
||||
this.getModifiedDate());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -11,6 +16,7 @@ import lombok.Setter;
|
||||
@Entity
|
||||
@Table(name = "tb_model_mng")
|
||||
public class ModelMngEntity extends CommonDateEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "model_uid")
|
||||
@@ -43,6 +49,9 @@ public class ModelMngEntity extends CommonDateEntity {
|
||||
@Column(name = "file_name")
|
||||
private String fileName;
|
||||
|
||||
@Column(name = "memo")
|
||||
private String memo;
|
||||
|
||||
public void deleted() {
|
||||
this.deleted = true;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,10 @@ import com.kamco.cd.kamcoback.postgres.entity.ModelMngEntity;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Expression;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.core.types.dsl.*;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.core.types.dsl.NumberPath;
|
||||
import com.querydsl.core.types.dsl.StringExpression;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -71,13 +74,12 @@ public class ModelMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
modelMngEntity.modelType,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD')", modelMngEntity.createCompleteDttm),
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD')", modelMngEntity.recentUseDttm),
|
||||
roundNumericToPercent(modelResultMetricEntity.f1Score),
|
||||
roundNumericToPercent(modelResultMetricEntity.precision),
|
||||
roundNumericToPercent(modelResultMetricEntity.recall),
|
||||
roundNumericToPercent(modelResultMetricEntity.loss),
|
||||
roundNumericToPercent(modelResultMetricEntity.iou),
|
||||
modelMngEntity.memo,
|
||||
modelMngEntity.deleted))
|
||||
.from(modelMngEntity)
|
||||
.innerJoin(modelResultMetricEntity)
|
||||
|
||||
Reference in New Issue
Block a user