You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
autoflow-server-mgmt/src/main/java/kr/re/etri/autoflow/entity/MinioAttachmentEntity.java

95 lines
3.1 KiB

package kr.re.etri.autoflow.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.Comment;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.LocalDateTime;
@Schema(description = "MinIO 첨부파일 (Dataset/TrainingScript 통합)")
@Comment("MinIO 첨부파일")
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "tb_minio_attachment")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class MinioAttachmentEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Schema(description = "첨부파일 ID", example = "1")
@Comment("첨부파일 ID")
private Long id;
@Schema(description = "연관 엔티티 ID", example = "1")
@Comment("연관 엔티티 ID")
@Column(nullable = false)
private Long refId;
@Schema(description = "첨부파일 종류 (DATASET / SCRIPT)", example = "DATASET")
@Comment("첨부파일 종류")
@Column(nullable = false, length = 50)
private String refType; // 구분자 (예: WORKFLOW_STEP,DATASET, TRAINING_SCRIPT)
@Schema(description = "원본 파일명", example = "step1.yaml")
@Comment("원본 파일명")
@Column(nullable = false, length = 255)
private String originalName;
@Schema(description = "저장된 파일명(UUID + ver)", example = "a1b2c3d4-step1-ver.1.yaml")
@Comment("저장된 파일명")
@Column(nullable = false, length = 255)
private String storedName;
@Schema(description = "MIME 타입", example = "application/x-yaml")
@Comment("MIME 타입")
@Column(nullable = false, length = 100)
private String contentType;
@Schema(description = "파일 크기(byte)", example = "2048")
@Comment("파일 크기")
@Column(nullable = false)
private Long size;
@Schema(description = "스토리지 경로", example = "/uploads/step1-ver.1.yaml")
@Comment("스토리지 경로")
@Column(nullable = false, length = 500)
private String storagePath;
@Schema(description = "업로더 ID", example = "admin")
@Comment("업로더 ID")
@Column(nullable = false, length = 50)
private String regUserId;
@Schema(description = "업로드 일시", example = "2025-09-17T15:00:00")
@CreatedDate
@Comment("업로드 일시")
@Column(nullable = false, updatable = false)
private LocalDateTime regDt;
@Schema(description = "파일 제목", example = "자율주행차량 데이터 셋")
@Comment("파일 제목")
@Column(length = 200)
private String title;
@Schema(description = "파일 버전", example = "1")
@Comment("파일 버전")
@Column(nullable = false)
private Integer version;
@Schema(description = "파일 설명", example = "자율주행차량 데이터 모음집입니다.")
@Comment("파일 설명")
@Column(length = 1000)
private String description;
@Schema(description = "프로젝트 아이디", example = "1", defaultValue = "0")
@Column(nullable = false)
private Long projectId;
}