package com.mvc.constant;

/**
 * 审核结果类型
 */
public enum ReviewResultType {
    UNREVIEW("未审核", "0"),
    IDENT_TRUE("识别正确", "1"),
    REVIEW_REVISE("审核修正", "2"),
    UNRECOGNIZABLE("无法辨别", "3"),
    UNKNOWN_STATE("未知状态", "9");

    private String name;
    private String code;

    ReviewResultType(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static ReviewResultType findReviewResultTypeByCode(String code) {
        for (ReviewResultType type : ReviewResultType.values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
