package com.sonic.lion.service.impl;

import com.sonic.common.exception.SysException;
import com.sonic.lion.enums.PayChannel;
import com.sonic.lion.service.PayChannelRouterService;
import com.sonic.lion.service.PayChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service;

import static com.sonic.lion.enums.PayChannel.STRIPE;


/**
 * @author: code
 * @date: 2025/06/01
 * @Description:
 * @version: 1.0.0
 */
@Service
public class PayChannelRouterServiceImpl implements PayChannelRouterService {

    @Autowired
    @Qualifier("stripeService")
    private PayChannelService stripeService;


    @Override
    public PayChannelService getPayChannelService(@NonNull PayChannel payChannel) {
        if (payChannel == STRIPE) {
            return stripeService;
        } else {
            //不支持的支付渠道
            throw new SysException("", "");
        }
    }

}
