package com.cf.imes.module.executor.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单导入类型枚举
 * @author Gqr
 * @since 2025/1/8 16:20
 */
@Getter
@AllArgsConstructor
public enum OrderImportTypeEnum {
    EXCEL(0),
    JSON(1),
    XML(2),
    API(3);

    private int type;

    /**
     * 是否匹配
     *
     * @param type
     * @return
     */
    public static OrderImportTypeEnum match(int type) {
        for (OrderImportTypeEnum typeEnum : OrderImportTypeEnum.values()) {
            if (typeEnum.type == type) {
                return typeEnum;
            }
        }
        return null;
    }
}