package com.njcn.prepare.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

@Getter
public enum TicketTypeEnum {


    ALARM_TICKET("alarm_ticket", "预/告警单"),
    FEEDBACK("feedback", "反馈单"),
    TEST_REPORT("test_report", "测试报告"),
    REVISE_NOTICE("revise_notice", "整改通知单"),
    REVISE_FEEDBACK("revise_feedback", "整改通知反馈单");

    private final String code;

    private final String message;

    TicketTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static TicketTypeEnum getTicketTypeEnumByCode(String code) {
        for (TicketTypeEnum ticketTypeEnum : TicketTypeEnum.values()) {
            if (StringUtils.equals(code, ticketTypeEnum.getCode())) {
                return ticketTypeEnum;
            }
        }
        return null;
    }

}
