package xtools.boot.log.enums;

import xtools.boot.api.enums.BaseEnum;
import xtools.boot.log.interfaces.LogBusType;

/**
 * <p>Title : LogBusBaseType</p>
 * <p>Description : LogBusBaseType</p>
 * <p>DevelopTools : Idea_x64_v2026.1</p>
 * <p>DevelopSystem : macOS Sequoia 15.7.5</p>
 * <p>Company : org.xujun</p>
 *
 * @author : XuJun
 * @version : 5.0.0
 * @date : 2026/2/3 11:26
 */
public enum LogBusBaseType implements LogBusType {

    // 其他
    OTHER(0, "其他"),
    // THREAD
    VIRTUAL_THREAD(1, "虚拟线程"),
    // Redis
    REDIS(10, "Redis"),
    // MyBatis
    MYBATIS(20, "MyBatis"),
    // MQ
    MQ(30, "MQ"),
    // Elasticsearch
    ELASTICSEARCH(40, "Elasticsearch"),
    // Sentinel
    SENTINEL(50, "Sentinel"),
    // Storage
    STORAGE(60, "Storage"),
    // 操作日志
    OPT_LOG(70, "OptLog"),
    // Http
    HTTP(80, "Http工具"),
    HTTP_REQUEST(81, "Http请求"),
    HTTP_RESPONSE(82, "Http响应"),
    // Cloud
    CLOUD_REQUEST(85, "Cloud请求"),
    CLOUD_RESPONSE(86, "Cloud响应"),
    // Controller
    CONTROLLER(90, "Controller"),
    // Task
    TASK(91, "Task"),
    // Job
    JOB(92, "Job"),
    // Risk
    RISK(93, "Risk"),
    ;

    /**
     * 编码
     **/
    private final int code;

    /**
     * 说明
     **/
    private final String desc;

    /**
     * 初始化方法
     *
     * @param code Code
     * @param desc 说明
     */
    LogBusBaseType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 获取所有枚举
     *
     * @return 所有枚举
     */
    @Override
    public BaseEnum[] all() {
        return values();
    }

    /**
     * 获取枚举编码
     *
     * @return 枚举编码
     */
    @Override
    public int code() {
        return code;
    }

    /**
     * 获取枚举说明
     *
     * @return 枚举说明
     */
    @Override
    public String desc() {
        return desc;
    }

}
