package com.leromro.common.enums;

/**
 * 订单结算申请审核状态枚举
 * 审核状态 10审核中 20审核通过 30审核未通过 40已取消
 */
public enum AuditorStatusEnum {
    AUDITING("10", "审核中"),
    AUDIT_PASS("20", "审核通过"),
    AUDIT_NOT_PASS("30", "审核未通过"),
    CANCEL("40", "已取消");
    private String code;
    private String message;

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

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static AuditorStatusEnum getEnumByCode(String code) {
        for (AuditorStatusEnum value : AuditorStatusEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public static AuditorStatusEnum getEnumByMessage(String message) {
        for (AuditorStatusEnum value : AuditorStatusEnum.values()) {
            if (value.getMessage().equals(message)) {
                return value;
            }
        }
        return null;
    }

    public static String getMessageByCode(Integer code) {
        for (AuditorStatusEnum value : AuditorStatusEnum.values()) {
            if (value.getCode().equals(code)) {
                return value.getMessage();
            }
        }
        return null;
    }

    public static String getCodeByMessage(String message) {
        for (AuditorStatusEnum value : AuditorStatusEnum.values()) {
            if (value.getMessage().equals(message)) {
                return value.getCode();
            }
        }
        return null;
    }
}
