package com.tuoheng.admin.enums;

import lombok.Getter;

/**
 * @Author: 吴彬
 * @CreateTime: 2023-05-18  19:09
 * @Description: MQTT topic 枚举。将所有和MQTT交互的topic统一维护
 *      %S：设备编号占位符；qos：为传输等级定义的时候自行指定；desc：描述信息方便记录日志等
 * @Version: 1.0
 */
public enum MQTTTopicEnum {

    TOPIC_DATA_DOORMOTOR("/v1/%s/data/DoorMotor", 0, ""),
    TOPIC_DATA_LIFTMOTOR("/v1/%s/data/LiftMotor", 0, ""),
    TOPIC_DATA_FIXEDMOTOR("/v1/%s/data/FixedMotor", 0, ""),
    TOPIC_DATA_DRONEGOAWAY("/v1/%s/data/DroneGoAway", 0, ""),
    TOPIC_DATA_DRONEGOHOME("/v1/%s/data/DroneGoHome", 0, ""),
    TOPIC_DATA_DRONEGOSTOP("/v1/%s/data/DroneGoStop", 0, ""),
    TOPIC_DATA_DRONESTOP("/v1/%s/data/DroneStop", 0, ""),
    TOPIC_CONFIRM_DOORMOTOR("/v1/%s/confirm/DoorMotor", 0, ""),
    TOPIC_CONFIRM_LIFTMOTOR("/v1/%s/confirm/LiftMotor", 0, ""),
    TOPIC_CONFIRM_FIXEDMOTOR1("/v1/%s/confirm/FixedMotor1", 0, ""),
    TOPIC_CONFIRM_FIXEDMOTOR2("/v1/%s/confirm/FixedMotor2", 0, ""),
    TOPIC_CONFIRM_DRONEGOAWAY("/v1/%s/confirm/DroneGoAway", 0, ""),
    TOPIC_CONFIRM_DRONEGOHOME("/v1/%s/confirm/DroneGoHome", 0, ""),
    TOPIC_CONFIRM_DRONEGOSTOP("/v1/%s/confirm/DroneGoStop", 0, ""),
    TOPIC_CONFIRM_DRONESTOP("/v1/%s/confirm/DroneStop", 0, ""),
    TOPIC_CONFIRM_EDGE("/v1/%s/confirm/Edge", 0, ""),
    TOPIC_CONFIRM_CHGR("/v1/%s/confirm/CHGR", 0, ""),
    TOPIC_CONFIRM_LIGHT("/v1/%s/confirm/Light", 0, ""),
    TOPIC_CONTROL_DOORMOTOR("/v1/%s/control/DoorMotor", 0, ""),
    TOPIC_CONTROL_LIFTMOTOR("/v1/%s/control/LiftMotor", 0, ""),
    TOPIC_CONTROL_FIXEDMOTOR("/v1/%s/control/FixedMotor", 0, ""),
    TOPIC_CONTROL_DRONEGOAWAY("/v1/%s/control/DroneGoAway", 0, ""),
    TOPIC_CONTROL_DRONEGOHOME("/v1/%s/control/DroneGoHome", 0, ""),
    TOPIC_CONTROL_DRONEGOSTOP("/v1/%s/control/DroneGoStop", 0, ""),
    TOPIC_CONTROL_DRONESTOP("/v1/%s/control/DroneStop", 0, ""),
    TOPIC_CONTROL_CHGR("/v1/%s/control/CHGR", 0, ""),
    TOPIC_CONTROL_LIGHT("/v1/%s/control/Light", 0, ""),
    TOPIC_DATA_TAH("/v1/%s/data/TAH", 0, ""),
    TOPIC_DATA_WTH("/v1/%s/data/WTH", 0, ""),
    TOPIC_DATA_ACD("/v1/%s/data/ACD", 0, ""),
    TOPIC_DATA_UPS("/v1/%s/data/UPS", 0, ""),
    TOPIC_DATA_CHGR("/v1/%s/data/CHGR", 0, ""),
    TOPIC_DATA_LIGHT("/v1/%s/data/Light", 0, ""),
    TOPIC_ALARM_TAH("/v1/%s/alarm/TAH", 0, ""),
    TOPIC_ALARM_WTH("/v1/%s/alarm/WTH", 0, ""),
    TOPIC_ALARM_ACD("/v1/%s/alarm/ACD", 0, ""),
    TOPIC_ALARM_UPS("/v1/%s/alarm/UPS", 0, ""),
    TOPIC_PULL_WTH("/v1/%s/pull/WTH", 0, ""),
    TOPIC_POST_WTH("/v1/%s/post/WTH", 0, "");

    MQTTTopicEnum(String topic, int qos, String desc) {
        this.topic = topic;
        this.qos = qos;
        this.desc = desc;
    }

    /**
     * MQTT topic
     */
    @Getter
    private String topic;

    /**
     * 对应qos等级 0-至多一次；1-至少一次；2-确保只有一次
     */
    @Getter
    private int qos;

    /**
     * 描述
     */
    @Getter
    private String desc;

}
