
package org.jeecg.modules.hikiot.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
@Schema(description = "海康门禁添加用户信息DTO")
@ToString
public class AddUserRequestDTO {
    @Schema(description = "设备序列号")
    private String deviceSerial;

    @Schema(description = "载荷")
    private Payload payload;

    @Data
    @Accessors(chain = true)
    @ToString
    public static class Payload {
        @Schema(description = "用户信息")
        private UserInfo userInfo;
    }

    @Data
    @Accessors(chain = true)
    @ToString
    public static class UserInfo {
        @Schema(description = "员工编号")
        private String employeeNo;

        @Schema(description = "姓名")
        private String name;

        @Schema(description = "用户类型")
        private String userType;

        @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd'T'HH:mm:ss")
        @Schema(description = "启用开始时间")
        private String enableBeginTime;

        @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd'T'HH:mm:ss")
        @Schema(description = "启用结束时间")
        private String enableEndTime;

        @Schema(description = "是否永久有效")
        private boolean permanentValid;

        @Schema(description = "门禁计划列表")
        private List<DoorRightPlan> doorRightPlan;

        @Schema(description = "门编号列表")
        private List<Integer> doorRight;

        @Schema(description = "密码")
        private String password;

        @Schema(description = "最大开门时间（秒）")
        private int maxOpenDoorTime;
    }

    @Data
    @Accessors(chain = true)
    public static class DoorRightPlan {
        @Schema(description = "门编号")
        private int doorNo;

        @Schema(description = "计划模板ID列表")
        private List<Integer> planTemplateId;
    }
}