package com.ruoyi.logistics.service.factory;

import com.ruoyi.logistics.service.LogisticsService;
import com.ruoyi.logistics.service.impl.JDLogisticsService;
import com.ruoyi.logistics.service.impl.SFLogisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class LogisticsFactory {
    @Autowired
    private SFLogisticsService sfLogisticsService;
    @Autowired
    private JDLogisticsService jdLogisticsService;

    public LogisticsService getLogisticsService(String companyCode) {
        switch (companyCode) {
            case "SF":
                return sfLogisticsService;
            case "JD":
                return jdLogisticsService;
            default:
                throw new IllegalArgumentException("不支持的物流公司");
        }
    }
}
