[ADD] WorkFlow 부모Project 추가 완료

main
bjkim 10 months ago
parent bfc1b2b891
commit 28b5683227

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

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

@ -61,7 +61,7 @@ public class WorkFlowService {
// projectId가 있으면 조건 추가 (권장)
if (request.getProjectId() != null) {
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