package com.dbnt.sims.publicBoard.model;

import com.dbnt.sims.config.BaseModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.List;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "public_board")
public class PublicBoard  extends BaseModel {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "public_key")
  private Integer publicKey;
  @Column(name = "public_type")
  private String publicType;
  @Column(name = "title")
  private String title;
  @Column(name = "content")
  private String content;
  @Column(name = "wrt_organ")
  private String wrtOrgan;
  @Column(name = "wrt_part")
  private String wrtPart;
  @Column(name = "wrt_user_seq")
  private Integer wrtUserSeq;
  @Column(name = "wrt_user_nm")
  private String wrtUserNm;
  @Column(name = "wrt_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
  private LocalDateTime wrtDt;
  @Column(name = "organ_chk")
  private String organChk;
  @Column(name = "tab_status")
  private String tabStatus;

  @Transient
  private Integer fileCnt;
  @Transient
  private Integer commentCnt;
  @Transient
  private List<PublicFile> fileList;
  @Transient
  private List<PublicComment> commentList;
  @Transient
  private List<MultipartFile> multipartFileList;
}
