package com.njcn.msgpush.module.push.client.channel.mail.factory;

import cn.hutool.core.util.StrUtil;
import com.njcn.msgpush.module.push.client.channel.mail.MailClient;
import com.njcn.msgpush.module.push.client.channel.mail.impl.AliYunMailClient;
import com.njcn.msgpush.module.push.client.constant.ClientConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author caozehui
 * @data 2026-02-11
 */
@Component
public class MailFactory {

    @Autowired
    private AliYunMailClient aliYunMailClient;

    public MailClient getClient(String mailProviderTypeName) throws RuntimeException {
        if (StrUtil.equals(ClientConstant.ALI_YUN, mailProviderTypeName)) {
            return aliYunMailClient;
        } else {
            throw new RuntimeException("暂时不提供" + mailProviderTypeName + "邮件服务提供商");
        }
    }
}
