package com.cool.store.enums;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Author suzhuhong
 * @Date 2025/4/7 15:01
 * @Version 1.0
 */
public enum OpenStatusEnum {


    OPENSTATUSENUM_1(1,"开通资料收集中"),
    OPENSTATUSENUM_2(2,"资料审核中"),
    OPENSTATUSENUM_3(3,"资料审核失败"),
    OPENSTATUSENUM_4(4,"开通中"),
    OPENSTATUSENUM_5(5,"开通成功"),
    OPENSTATUSENUM_6(6,"开通失败"),
    ;


    private Integer code;

    private String name;


    public static List<Integer> getSpecialList(){
        return Arrays.asList(OPENSTATUSENUM_4.getCode(),OPENSTATUSENUM_5.getCode(),OPENSTATUSENUM_6.getCode());
    }

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

    public Integer getCode() {
        return code;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public static String getByCode(Integer code){
        if (code == null){
            return null;
        }
        for (OpenStatusEnum openStatusEnum : OpenStatusEnum.values()) {
            if(openStatusEnum.getCode().equals(code)){
                return openStatusEnum.getName();
            }
        }
        return null;
    }

}
