package com.docus.server.enums;

import com.docus.infrastructure.core.db.enums.IIntegerEnum;

import java.util.Objects;

public enum CollectTypeEnum implements IIntegerEnum {

    /**
     * WS
     */
    WEBSERVICE_XML_DEPT(0, "WEBSERVICE_新增/修改-科室信息", "WEBSERVICE_XML_DEPT"),
    WEBSERVICE_XML_USER(1, "WEBSERVICE_新增/修改-用户信息", "WEBSERVICE_XML_USER"),
    WEBSERVICE_XML_INSERT_BASIC(2, "WEBSERVICE_新增/修改-基础数据", "WEBSERVICE_XML_BASIC"),
    WEBSERVICE_XML_UPDATE_BASIC(2, "WEBSERVICE_新增/修改-基础数据", "WEBSERVICE_XML_BASIC"),
    WEBSERVICE_XML_SA_REPORT(3, "WEBSERVICE_新增-手麻报告信息", "WEBSERVICE_XML_SA_REPORT"),
    WEBSERVICE_XML_ICU_REPORT(4, "WEBSERVICE_新增-重症报告信息", "WEBSERVICE_XML_ICU_REPORT"),
    WEBSERVICE_XML_EXAMINATION_REPORT(5, "WEBSERVICE_新增-检验报告信息", "WEBSERVICE_XML_EXAMINATION_REPORT"),
    WEBSERVICE_XML_INSERT_INSPECTION_REPORT(6, "WEBSERVICE_新增-检查报告的信息", "WEBSERVICE_XML_INSERT_INSPECTION_REPORT"),
    WEBSERVICE_XML_UPDATE_INSPECTION_REPORT(7, "WEBSERVICE_更新-检查报告的信息", "WEBSERVICE_XML_UPDATE_INSPECTION_REPORT"),

    /**
     * HTTP
     */
    HTTP_PASSIVE_USER(8, "HTTP_新增/修改-用户信息", "HTTP_PASSIVE_USER"),
    HTTP_PASSIVE_DEPT(9, "HTTP_新增/修改-科室信息", "HTTP_PASSIVE_DEPT"),
    HTTP_PASSIVE_BASIC(10, "HTTP_新增/修改-基础数据", "HTTP_PASSIVE_BASIC"),

    /**
     * MQ
     */
    JMS_MQ_PASSIVE_INSERT_USER(11, "JMS_MQ_新增-用户信息", "JMS_MQ_PASSIVE_INSERT_USER"),
    JMS_MQ_PASSIVE_UPDATE_USER(12, "JMS_MQ_修改-用户信息", "JMS_MQ_PASSIVE_UPDATE_USER"),
    JMS_MQ_PASSIVE_INSERT_DEPT(13, "JMS_MQ_ 新增-科室信息", "JMS_MQ_PASSIVE_INSERT_DEPT"),
    JMS_MQ_PASSIVE_UPDATE_DEPT(14, "JMS_MQ_修改-科室信息", "JMS_MQ_PASSIVE_UPDATE_DEPT"),
    JMS_MQ_PASSIVE_INSERT_BASIC(15, "JMS_MQ_新增-基础数据", "JMS_MQ_PASSIVE_INSERT_BASIC"),
    JMS_MQ_PASSIVE_UPDATE_BASIC(16, "JMS_MQ_修改-基础数据", "JMS_MQ_PASSIVE_UPDATE_BASIC"),

    ROCKET_MQ_PASSIVE_INSERT_USER(17, "ROCKET_MQ_新增-用户信息", "ROCKET_MQ_PASSIVE_INSERT_USER"),
    ROCKET_MQ_PASSIVE_UPDATE_USER(18, "ROCKET_MQ_修改-用户信息", "ROCKET_MQ_PASSIVE_UPDATE_USER"),
    ROCKET_MQ_PASSIVE_INSERT_DEPT(19, "ROCKET_MQ_新增-科室信息", "ROCKET_MQ_PASSIVE_INSERT_DEPT"),
    ROCKET_MQ_PASSIVE_UPDATE_DEPT(20, "ROCKET_MQ_修改-科室信息", "ROCKET_MQ_PASSIVE_UPDATE_DEPT"),
    ROCKET_MQ_PASSIVE_INSERT_BASIC(21, "ROCKET_MQ_新增-基础数据", "ROCKET_MQ_PASSIVE_INSERT_BASIC"),
    ROCKET_MQ_PASSIVE_UPDATE_BASIC(22, "ROCKET_MQ_修改-基础数据", "ROCKET_MQ_PASSIVE_UPDATE_BASIC"),

    RABBIT_MQ_PASSIVE_INSERT_USER(23, "RABBIT_MQ_新增-用户信息", "RABBIT_MQ_PASSIVE_INSERT_USER"),
    RABBIT_MQ_PASSIVE_UPDATE_USER(24, "RABBIT_MQ_修改-用户信息", "RABBIT_MQ_PASSIVE_UPDATE_USER"),
    RABBIT_MQ_PASSIVE_INSERT_DEPT(25, "RABBIT_MQ_新增-科室信息", "RABBIT_MQ_PASSIVE_INSERT_DEPT"),
    RABBIT_MQ_PASSIVE_UPDATE_DEPT(26, "RABBIT_MQ_修改-科室信息", "RABBIT_MQ_PASSIVE_UPDATE_DEPT"),
    RABBIT_MQ_PASSIVE_INSERT_BASIC(27, "RABBIT_MQ_新增-基础数据", "RABBIT_MQ_PASSIVE_INSERT_BASIC"),
    RABBIT_MQ_PASSIVE_UPDATE_BASIC(28, "RABBIT_MQ_修改-基础数据", "RABBIT_MQ_PASSIVE_UPDATE_BASIC"),

    ;

    private Integer value;
    private String display;
    private String desc;

    CollectTypeEnum(Integer value, String display, String desc) {
        this.value = value;
        this.display = display;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getDisplay() {

        return display;
    }

    public static CollectTypeEnum fromDesc(String desc) {
        for (CollectTypeEnum typeEnum : CollectTypeEnum.values()) {
            if (Objects.equals(desc, typeEnum.getDesc())) {
                return typeEnum;
            }
        }
        throw new IllegalArgumentException("No. enum value 。" + desc + "");
    }

    public static void main(String[] args) {
        CollectTypeEnum[] values = CollectTypeEnum.values();
        System.out.println(values);
    }
}
