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

import org.nest.springwrap.core.tool.api.R;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/11/16 11:32
 * @Description: TODO
 * @Version: 1.0
 */
@Component
public class MonitorDingFeignFallback implements FallbackFactory<MonitorDingFeignServer> {

    @Override
    public MonitorDingFeignServer create(Throwable cause) {
        return new MonitorDingFeignServer() {
            @Override
            public R<Void> pushMessage(String type, String title, String platform, String module, String operation, String details, String at) {

                return R.fail("获取数据失败");
            }
        };
    }
}