package com.sckw.core.model.enums;

import lombok.Getter;

import java.util.Map;

/**
 * @author czh
 * @desc 合作状态
 * @date 2023/6/15
 */
@Getter
public enum CooperateStatusEnum {

    //审核中
    PROCESS(0, "审核中"),
    //合作中
    OK(1, "合作中"),
    //已解除
    PASS(2, "已解除"),
    //已拒绝
    REFUSE(3, "已驳回"),
    //已撤销
    CANCEL(4, "已撤销");

    private final int code;

    private final String name;

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

    public static String getName(int code) {
        for (CooperateStatusEnum cooperateStatusEnum : values()) {
            if (cooperateStatusEnum.getCode() == code) {
                return cooperateStatusEnum.getName();
            }
        }
        return null;
    }

}
