package com.sckw.core.model.enums;

import lombok.Getter;

/**
 * @author czh
 * @desc 合作类型
 * @date 2023/6/15
 */
@Getter
public enum CooperateTypeEnum {

    //供应商
    SUPPLIER(1, "供应商"),
    //采购商
    PURCHASER(2, "采购商"),
    //托运商
    CONSIGN(3, "托运商"),
    //承运商
    CARRIAGE(4, "承运商");

    private final int code;

    private final String name;

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

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

}
