package com.sckw.core.model.enums;

import lombok.Getter;

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

    /**
     * 托运企业
     */
    CONSIGN(1, "托运企业"),

    /**
     * 承运企业
     */
    CARRIAGE(2, "承运企业");

    private final int code;

    private final String name;

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

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

}
