package com.sckw.core.model.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.EnumSet;

/**
 * Author: donglang
 * Time: 2025-12-10
 * Des: 派车方式枚举
 * Version: 1.0
 */

@Getter
@AllArgsConstructor
public enum DispatchWayEnums {

    /**
     * 手动派单
     */
    MANUAL_DISPATCH(1,  "手动派单"),

    /**
     * 自动派单
     */
    AUTO_DISPATCH(2, "自动派单"),

    ;

    private final Integer code;

    private final String desc;


    public static String getDesc(Integer code) {
        if (code == null) {
            return null;
        }
        for (DispatchWayEnums dispatchWayEnums : EnumSet.allOf(DispatchWayEnums.class)) {
            if (dispatchWayEnums.code.equals(code)) {
                return dispatchWayEnums.desc;
            }
        }
        return null;
    }

}
