package com.yuchen.saas.message.api.feign.email;

import com.yuchen.saas.message.api.vo.InvoiceMailVo;
import org.nest.springwrap.core.tool.api.R;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/11/16 14:24
 * @Description: TODO
 * @Version: 1.0
 */
@Component
public class SendMailFallback implements FallbackFactory<SendMailFeignServer> {

    @Override
    public SendMailFeignServer create(Throwable cause) {
        return new SendMailFeignServer() {
            @Override
            public R sendInvoiceMail(InvoiceMailVo invoiceMailVo) {
                return R.error("发送邮件异常");
            }
        };
    }
}