package com.its.web.dto.notice;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.its.web.pagination.Pagination;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("NoticeDto(공지사항 DTO)")
public class NoticeDto {
    @ApiModelProperty("공지사항 ID")
    @JsonProperty("board_id")
    private String boardId;

    @ApiModelProperty("공지사항 번호")
    @JsonProperty("board_no")
    private Long boardNo;

    @ApiModelProperty("카테고리 코드")
    @JsonProperty("category_cd")
    private String categoryCd;

    @ApiModelProperty("상위 공지사항 번호")
    @JsonProperty("parent_board_no")
    private Long parentBoardNo;

    @ApiModelProperty("등록 일자")
    @JsonProperty("reg_date")
    private String regDate;

    @ApiModelProperty("공지사항 제목")
    @JsonProperty("b_subject")
    private String bSubject;

    @ApiModelProperty("공지사항 내용")
    @JsonProperty("b_content")
    private String bContent;

    @ApiModelProperty("작성자")
    @JsonProperty("b_writer")
    private String bWriter;

    @ApiModelProperty("첨부파일")
    @JsonProperty("attach_file")
    private String attachFile;

    @ApiModelProperty("첨부파일 ID")
    @JsonProperty("attach_file_id")
    private String attachFileId;

    @ApiModelProperty("공지사항")
    @JsonProperty("b_notice")
    private String bNotice;

    @ApiModelProperty("조회수")
    @JsonProperty("read_count")
    private Integer readCount;

    @ApiModelProperty("비고")
    @JsonProperty("remark")
    private String remark;

    @ApiModelProperty("공지사항 표출 여부")
    @JsonProperty("hmpg_dspl_en")
    private Integer hmpgDsplEn;

    @ApiModelProperty("페이지 정보")
    @JsonProperty("page")
    private Pagination page;

    @ApiModel("NoticeDtoWriteReq(공지사항 작성 파라미터)")
    @Data
    @NoArgsConstructor
    public static class NoticeDtoWriteReq {

        @ApiModelProperty(value = "제목", example = "제목", required = true)
        @JsonProperty("bSubject")
        private String bsubject;

        @ApiModelProperty(value = "내용", example = "내용", required = true)
        @JsonProperty("bContent")
        private String bcontent;

        @ApiModelProperty(value = "1", example = "공지사항 표출 여부", required = true)
        @JsonProperty("hmpgDsplEn")
        private Integer hmpgDsplEn;
    }

    @ApiModel("NoticeDtoUpdateReq(공지사항 수정 파라미터)")
    @Data
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class NoticeDtoUpdateReq {
        @ApiModelProperty(value = "공지사항 번호", example = "1", required = true)
        @JsonProperty("boardNo")
        private String boardNo;

        @ApiModelProperty(value = "공지사항 제목", example = "제목", required = true)
        @JsonProperty("bSubject")
        private String bSubject;

        @ApiModelProperty(value = "공지사항 내용", example = "내용", required = true)
        @JsonProperty("bContent")
        private String bContent;

        @ApiModelProperty(value = "1", example = "공지사항 표출 여부", required = true)
        @JsonProperty("hmpgDsplEn")
        private Integer hmpgDsplEn;

        @ApiModelProperty(value = "첨부파일 명칭", example = "||", required = true)
        @JsonProperty("attachFileNames")
        private String attachFileNames;
    }

}
