package com.cool.store.enums.point;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangchenbiao
 * @FileName: PointRecommendStatus
 * @Description:
 * @date 2024-04-01 14:38
 */
public enum PointRecommendStatusEnum {

    //状态 1.待选择 2.已选择 3.已被他人选择 4.已签约 5.已拒绝 6.已失效
    POINT_RECOMMEND_STATUS_1(1, "待选择"),
    POINT_RECOMMEND_STATUS_2(2, "已选择"),
    POINT_RECOMMEND_STATUS_3(3, "已被他人选择"),
    POINT_RECOMMEND_STATUS_4(4, "已签约"),
    POINT_RECOMMEND_STATUS_5(5, "已拒绝"),
    POINT_RECOMMEND_STATUS_6(6, "已失效"),
    ;

    private Integer code;

    private String desc;

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

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static PointRecommendStatusEnum getByCode(Integer code) {
        for (PointRecommendStatusEnum pointRecommendStatusEnum : PointRecommendStatusEnum.values()) {
            if (pointRecommendStatusEnum.getCode().equals(code)) {
                return pointRecommendStatusEnum;
            }
        }
        return null;
    }

    public static String getDescByCode(Integer code) {
        for (PointRecommendStatusEnum pointRecommendStatusEnum : PointRecommendStatusEnum.values()) {
            if (pointRecommendStatusEnum.getCode().equals(code)) {
                return pointRecommendStatusEnum.getDesc();
            }
        }
        return null;
    }

    public static List<Integer> getSelectStatus(){
        List<Integer> resultList = new ArrayList<>();
        resultList.add(POINT_RECOMMEND_STATUS_2.code);
        resultList.add(POINT_RECOMMEND_STATUS_4.code);
        return resultList;
    }


}
