package kr.wisestone.owl.domain; import kr.wisestone.owl.domain.enumType.AttachedType; import kr.wisestone.owl.domain.enumType.FileType; import javax.persistence.*; import java.io.Serializable; @Entity public class AttachedFile extends BaseEntity implements Serializable { private static final long serialVersionUID = 847376294732544822L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String path; private Long size; private String contentType; private String awsKey; @Enumerated(EnumType.STRING) private FileType fileType; @Enumerated(EnumType.STRING) private AttachedType attachedType; @ManyToOne(fetch= FetchType.EAGER) @JoinColumn(name="issue_id") private Issue issue; // 파일 다운로드 오류 해결 @ManyToOne(fetch= FetchType.EAGER) @JoinColumn(name="workspace_id") private Workspace workspace; public AttachedFile() { } public AttachedFile(String name, Long size, String contentType, String path) { this.name = name; this.path = path; this.size = size; this.contentType = contentType; } public AttachedFile(String name, Long size, String contentType, String path, String awsKey, Issue issue, Workspace workspace, FileType fileType, AttachedType attachedType) { this.name = name; this.size = size; this.contentType = contentType; this.path = path; this.awsKey = awsKey; this.issue = issue; this.workspace = workspace; this.fileType = fileType; this.attachedType = attachedType; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public Long getSize() { return size; } public void setSize(Long size) { this.size = size; } public String getContentType() { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public Issue getIssue() { return issue; } public void setIssue(Issue issue) { this.issue = issue; } public Workspace getWorkspace() { return workspace; } public void setWorkspace(Workspace workspace) { this.workspace = workspace; } public FileType getFileType() { return fileType; } public void setFileType(FileType fileType) { this.fileType = fileType; } public String getAwsKey() { return awsKey; } public void setAwsKey(String awsKey) { this.awsKey = awsKey; } public AttachedType getAttachedType() { return attachedType; } public void setAttachedType(AttachedType attachedType) { this.attachedType = attachedType; } }