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

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;

/**
 * CCTV 제어기 상태 DTO Class
 */
@Data
@Builder
@ApiModel("CctvStatusDto(CCTV 상태 정보")
public class CctvStatusDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModel("CctvStatusDtoRes(CCTV 상태 응답)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class CctvStatusDtoRes {

        @ApiModelProperty("제어결과(0: 성공, 기타: 오류")
        @JsonProperty("error")
        private Integer error;

        @ApiModelProperty("제어결과메시지")
        @JsonProperty("message")
        private String message;

        private TbCctvCtlrSttsDto stts;

        public void setResult(Integer error, String message, TbCctvCtlrSttsDto stts) {
            this.error = error;
            this.message = message;
            this.stts = stts;
        }

        @Builder
        public CctvStatusDtoRes(Integer error, String message, TbCctvCtlrSttsDto stts) {
            this.error = error;
            this.message = message;
            this.stts = stts;
        }
    }

    @ApiModel("CctvStatusNotifyDtoRes(CCTV 상태 Notify 응답)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class CctvStatusNotifyDtoRes {

        @ApiModelProperty("제어결과(0: 성공, 기타: 오류")
        @JsonProperty("error")
        private Integer error;

        @ApiModelProperty("제어결과메시지")
        @JsonProperty("message")
        private String message;

        public void setResult(Integer error, String message) {
            this.error = error;
            this.message = message;
        }

        @Builder
        public CctvStatusNotifyDtoRes(Integer error, String message) {
            this.error = error;
            this.message = message;
        }
    }
}
