package com.multictrl.modules.security.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * mqtt认证返回
 *
 * @author Sdy
 * @since 1.0.0 2026/5/26
 */
@Data
@Accessors(chain = true)
@Schema(name = "mqtt认证参数")
public class MqttAuthVO {

    @Schema(description = "认证结果 allow允许 deny拒绝")
    private String result;

    @Schema(description = "是否是超级用户 true超级用户 false普通用户")
    private Boolean is_superuser;

    @Schema(description = "访问控制列表，" +
            "数组中的每个对象是一条规则，EMQX 会按顺序匹配，一旦匹配到某条规则就停止继续匹配，并使用该规则的 permission 值。")
    private List<Acl> acl;

    @Data
    @Schema(name = "acl")
    public static class Acl {

        @Schema(description = "主题")
        private String topic;

        @Schema(description = "动作 publish subscribe")
        private String action;

        @Schema(description = "权限 allow deny")
        private String permission;
    }
}
