package com.bonus.common.biz.enums;

import lombok.Getter;

/**
 * 审批结果枚举
 * 
 * @author syruan
 */
@Getter
public enum ApprovalResultEnum {

    /**
     * 通过
     */
    PASS("1", "通过"),

    /**
     * 驳回
     */
    REJECT("2", "驳回");

    private final String code;
    private final String desc;

    ApprovalResultEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 根据code获取枚举
     */
    public static ApprovalResultEnum getByCode(String code) {
        for (ApprovalResultEnum result : values()) {
            if (result.getCode().equals(code)) {
                return result;
            }
        }
        return null;
    }
}

