package com.fs.store.strategy;

import com.fs.store.strategy.impl.CountBasedStrategy;
import com.fs.store.strategy.impl.VolumeBasedStrategy;
import com.fs.store.strategy.impl.WeightBasedStrategy;

/**
 * 策略工厂，创建计费策略
 */
public class ShippingStrategyFactory {
    public static FeeCalculationStrategy createStrategy(String strategyType) {
        switch (strategyType) {
            case "count":
                return new CountBasedStrategy();
            case "weight":
                return new WeightBasedStrategy();
            case "volume":
                return new VolumeBasedStrategy();
            default:
                throw new IllegalArgumentException("不支持的计费方式: " + strategyType);
        }
    }
}
