[ADD] WorkFlow 부모Project 추가 완료

main
bjkim 10 months ago
parent bfc1b2b891
commit 28b5683227

@ -4,6 +4,7 @@ import jakarta.persistence.*;
import lombok.*; import lombok.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import org.hibernate.annotations.Comment;
@Entity @Entity
@Table(name = "tb_workflows") @Table(name = "tb_workflows")
@ -17,8 +18,9 @@ public class WorkflowEntity {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Schema(description = "워크플로우 ID", example = "null") @Schema(description = "워크플로우 ID22", example = "null", defaultValue = "null")
private Long Id; @Comment("ID")
private Long id;
@Schema(description = "워크플로우 이름", example = "데이터 전처리 워크플로우") @Schema(description = "워크플로우 이름", example = "데이터 전처리 워크플로우")
private String workflowName; private String workflowName;
@ -52,7 +54,6 @@ public class WorkflowEntity {
@Schema(description = "Kubeflow 상태", example = "Running") @Schema(description = "Kubeflow 상태", example = "Running")
private String kubeflowStatus; private String kubeflowStatus;
@ManyToOne(fetch = FetchType.LAZY) @Schema(description = "프로젝트 아이디", example = "1", defaultValue = "0")
@JoinColumn(name = "project_id", referencedColumnName = "id", nullable = false) private Long projectId;
private ProjectEntity project;
} }

@ -1,11 +1,13 @@
package kr.re.etri.autoflow.payload.request; package kr.re.etri.autoflow.payload.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class WorkFlowRequest extends BaseSearchRequest { public class WorkFlowRequest extends BaseSearchRequest {
private String projectId; @Schema(description = "프로젝트 ID", example = "1")
private Long projectId;
} }

@ -61,7 +61,7 @@ public class WorkFlowService {
// projectId가 있으면 조건 추가 (권장) // projectId가 있으면 조건 추가 (권장)
if (request.getProjectId() != null) { if (request.getProjectId() != null) {
spec = spec.and((root, query, cb) -> spec = spec.and((root, query, cb) ->
cb.equal(root.get("project").get("id"), request.getProjectId()) cb.equal(root.get("projectId"), request.getProjectId())
); );
} }

Loading…
Cancel
Save