package com.its.op.dto.its.rse;

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

import java.io.Serializable;

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

    @ApiModel("RseControlResetReq(RSE 제어기 리셋)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class RseControlResetReq {

        @ApiModelProperty("로그인 사용자 ID")
        @JsonProperty("user_id")
        private String userId;

        @ApiModelProperty("장치유형(기본0)")
        @JsonProperty("device")
        private Integer device;

        @ApiModelProperty("제어정보(기본1)")
        @JsonProperty("control")
        private Integer control;

        @Builder
        public RseControlResetReq(String user_id, Integer device, Integer control) {
            this.userId = user_id;
            this.device = device;
            this.control = control;
        }
    }

    @ApiModel("RseControlRes(RSE 제어기 제어 응답)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class RseControlRes {

        @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 RseControlRes(Integer error, String message) {
            this.error = error;
            this.message = message;
        }
    }

}
