package com.its.op.dto.its.cctv;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.its.op.entity.its.cctv.TbCctvCptnStup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.PositiveOrZero;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * CCTV 자막 설정 정보 DTO Class
 */
@Data
@Builder
@ApiModel("TbCctvCptnStupDto(CCTV 자막 설정 정보)")
public class TbCctvCptnStupDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("CCTV 관리 번호")  // N NUMBER(10)
    @JsonProperty("cctv_ctlr_nmbr")
    private Long cctvCtlrNmbr;

    @ApiModelProperty("자막 설정 번호")  // N NUMBER(3)
    @JsonProperty("stup_nmbr")
    private Integer stupNmbr;

    @ApiModelProperty("시작 팬 값")  // Y NUMBER(5)
    @JsonProperty("strt_fan_val")
    private Integer strtFanVal;

    @ApiModelProperty("종료 팬 값")  // Y NUMBER(5)
    @JsonProperty("end_fan_val")
    private Integer endFanVal;

    @ApiModelProperty("자막 크기 1")  // Y NUMBER(2)
    @JsonProperty("cptn_size_1")
    private Integer cptnSize1;

    @ApiModelProperty("자막 X 좌표 1")  // Y NUMBER(6)
    @JsonProperty("cptn_x_crdn_1")
    private Integer cptnXCrdn1;

    @ApiModelProperty("자막 Y 좌표 1")  // Y NUMBER(6)
    @JsonProperty("cptn_y_crdn_1")
    private Integer cptnYCrdn1;

    @ApiModelProperty("자막 글꼴 1")  // Y NUMBER(2)
    @JsonProperty("cptn_font_1")
    private Integer cptnFont1;

    @ApiModelProperty("자막 색상 1")  // Y NUMBER(2)
    @JsonProperty("cptn_hue_1")
    private Integer cptnHue1;

    @ApiModelProperty("자막 내용 1")  // Y VARCHAR2(100)
    @JsonProperty("cptn_cont_1")
    private String cptnCont1;

    @ApiModelProperty("자막 크기 2")  // Y NUMBER(2)
    @JsonProperty("cptn_size_2")
    private Integer cptnSize2;

    @ApiModelProperty("자막 X 좌표 2")  // Y NUMBER(6)
    @JsonProperty("cptn_x_crdn_2")
    private Integer cptnXCrdn2;

    @ApiModelProperty("자막 Y 좌표 2")  // Y NUMBER(6)
    @JsonProperty("cptn_y_crdn_2")
    private Integer cptnYCrdn2;

    @ApiModelProperty("자막 글꼴 2")  // Y NUMBER(2)
    @JsonProperty("cptn_font_2")
    private Integer cptnFont2;

    @ApiModelProperty("자막 색상 2")  // Y NUMBER(2)
    @JsonProperty("cptn_hue_2")
    private Integer cptnHue2;

    @ApiModelProperty("자막 내용 2")  // Y VARCHAR2(100)
    @JsonProperty("cptn_cont_2")
    private String cptnCont2;

    // Code Description Field
    @ApiModel("TbCctvCptnStupUpdReq(CCTV 자막 설정 정보 정보변경)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class TbCctvCptnStupUpdReq {

        @ApiModelProperty("CCTV 관리 번호, Nullable = N, NUMBER(10)")  // N NUMBER(10)
        @JsonProperty("cctv_ctlr_nmbr")
        @PositiveOrZero
        private Long cctvCtlrNmbr;

        @ApiModelProperty("자막 설정 번호, Nullable = N, NUMBER(3)")  // N NUMBER(3)
        @JsonProperty("stup_nmbr")
        @PositiveOrZero
        private Integer stupNmbr;

        @ApiModelProperty("시작 팬 값, Nullable = Y, NUMBER(5)")  // Y NUMBER(5)
        @JsonProperty("strt_fan_val")
        @PositiveOrZero
        private Integer strtFanVal;

        @ApiModelProperty("종료 팬 값, Nullable = Y, NUMBER(5)")  // Y NUMBER(5)
        @JsonProperty("end_fan_val")
        @PositiveOrZero
        private Integer endFanVal;

        @ApiModelProperty("자막 크기 1, Nullable = Y, NUMBER(2)")  // Y NUMBER(2)
        @JsonProperty("cptn_size_1")
        @PositiveOrZero
        private Integer cptnSize1;

        @ApiModelProperty("자막 X 좌표 1, Nullable = Y, NUMBER(6)")  // Y NUMBER(6)
        @JsonProperty("cptn_x_crdn_1")
        @PositiveOrZero
        private Integer cptnXCrdn1;

        @ApiModelProperty("자막 Y 좌표 1, Nullable = Y, NUMBER(6)")  // Y NUMBER(6)
        @JsonProperty("cptn_y_crdn_1")
        @PositiveOrZero
        private Integer cptnYCrdn1;

        @ApiModelProperty("자막 글꼴 1, Nullable = Y, NUMBER(2)")  // Y NUMBER(2)
        @JsonProperty("cptn_font_1")
        @PositiveOrZero
        private Integer cptnFont1;

        @ApiModelProperty("자막 색상 1, Nullable = Y, NUMBER(2)")  // Y NUMBER(2)
        @JsonProperty("cptn_hue_1")
        @PositiveOrZero
        private Integer cptnHue1;

        @ApiModelProperty("자막 내용 1, Nullable = Y, VARCHAR2(100)")  // Y VARCHAR2(100)
        @JsonProperty("cptn_cont_1")
        @Size(min=1, max=100)
        private String cptnCont1;

        @ApiModelProperty("자막 크기 2, Nullable = Y, NUMBER(2)")  // Y NUMBER(2)
        @JsonProperty("cptn_size_2")
        @PositiveOrZero
        private Integer cptnSize2;

        @ApiModelProperty("자막 X 좌표 2, Nullable = Y, NUMBER(6)")  // Y NUMBER(6)
        @JsonProperty("cptn_x_crdn_2")
        @PositiveOrZero
        private Integer cptnXCrdn2;

        @ApiModelProperty("자막 Y 좌표 2, Nullable = Y, NUMBER(6)")  // Y NUMBER(6)
        @JsonProperty("cptn_y_crdn_2")
        @PositiveOrZero
        private Integer cptnYCrdn2;

        @ApiModelProperty("자막 글꼴 2, Nullable = Y, NUMBER(2)")  // Y NUMBER(2)
        @JsonProperty("cptn_font_2")
        @PositiveOrZero
        private Integer cptnFont2;

        @ApiModelProperty("자막 색상 2, Nullable = Y, NUMBER(2)")  // Y NUMBER(2)
        @JsonProperty("cptn_hue_2")
        @PositiveOrZero
        private Integer cptnHue2;

        @ApiModelProperty("자막 내용 2, Nullable = Y, VARCHAR2(100)")  // Y VARCHAR2(100)
        @JsonProperty("cptn_cont_2")
        @Size(min=1, max=100)
        private String cptnCont2;

        @Builder
        public TbCctvCptnStupUpdReq(Long cctv_ctlr_nmbr, Integer stup_nmbr, Integer strt_fan_val, Integer end_fan_val, Integer cptn_size_1, Integer cptn_x_crdn_1, Integer cptn_y_crdn_1, Integer cptn_font_1, Integer cptn_hue_1, String cptn_cont_1, Integer cptn_size_2, Integer cptn_x_crdn_2, Integer cptn_y_crdn_2, Integer cptn_font_2, Integer cptn_hue_2, String cptn_cont_2) {
            this.cctvCtlrNmbr = cctv_ctlr_nmbr;
            this.stupNmbr = stup_nmbr;
            this.strtFanVal = strt_fan_val;
            this.endFanVal = end_fan_val;
            this.cptnSize1 = cptn_size_1;
            this.cptnXCrdn1 = cptn_x_crdn_1;
            this.cptnYCrdn1 = cptn_y_crdn_1;
            this.cptnFont1 = cptn_font_1;
            this.cptnHue1 = cptn_hue_1;
            this.cptnCont1 = cptn_cont_1;
            this.cptnSize2 = cptn_size_2;
            this.cptnXCrdn2 = cptn_x_crdn_2;
            this.cptnYCrdn2 = cptn_y_crdn_2;
            this.cptnFont2 = cptn_font_2;
            this.cptnHue2 = cptn_hue_2;
            this.cptnCont2 = cptn_cont_2;
        }

        public TbCctvCptnStup toEntity() {
            return TbCctvCptnStup.builder()
                    .cctvCtlrNmbr(this.cctvCtlrNmbr)
                    .stupNmbr(this.stupNmbr)
                    .strtFanVal(this.strtFanVal)
                    .endFanVal(this.endFanVal)
                    .cptnSize1(this.cptnSize1)
                    .cptnXCrdn1(this.cptnXCrdn1)
                    .cptnYCrdn1(this.cptnYCrdn1)
                    .cptnFont1(this.cptnFont1)
                    .cptnHue1(this.cptnHue1)
                    .cptnCont1(this.cptnCont1)
                    .cptnSize2(this.cptnSize2)
                    .cptnXCrdn2(this.cptnXCrdn2)
                    .cptnYCrdn2(this.cptnYCrdn2)
                    .cptnFont2(this.cptnFont2)
                    .cptnHue2(this.cptnHue2)
                    .cptnCont2(this.cptnCont2)
                    .build();
        }

    }

}
