package com.winsun.constant;

/**
 *
 * @datetime 2020-04-20/4/2 17:28
 */
public enum FormState {
    /**
     * 表单状态枚举
     */
    ENABLE("0", "禁用"), DISABLE("10000", "启用");

    FormState(String id, String name) {
        this.id = id;
        this.name = name;
    }

    private String id;

    private String name;

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据ID获取状态枚举
     * @param id    状态ID
     * @return
     */
    public static FormState findById(String id) {
        for(FormState state : values()) {
            if(state.getId().equals(id)) {
                return state;
            }
        }
        return null;
    }
}
