package com.yuchen.saas.manage.system.api.feign;

import com.yuchen.saas.manage.system.api.entity.NestApplyManage;
import com.yuchen.saas.manage.system.api.entity.applet.SaasApplyPushMessageConfig;
import com.yuchen.saas.manage.system.api.vo.applet.PushTempDataVO;
import com.yuchen.saas.manage.system.api.vo.applet.SaasApplyInfoDataVO;
import com.yuchen.saas.payment.api.dto.setting.req.ApplyWalletSettingReqDTO;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/11/25 13:37
 * @Description: TODO
 * @Version: 1.0
 */
@Component
public class ApplyManageFeignFallback implements FallbackFactory<ApplyManageFeignServer> {

    @Override
    public ApplyManageFeignServer create(Throwable cause) {

        return new ApplyManageFeignServer() {
            @Override
            public R listByIds(List<Long> ids) {
                return R.error("远程调用失败");
            }

            @Override
            public R<List<NestApplyManage>> listInfoByPayment(ApplyWalletSettingReqDTO reqDTO) {
                return R.error("远程调用失败");
            }

            @Override
            public R<NestApplyManage> getDetail(Long id) {
                return R.error("远程调用失败");
            }

            @Override
            public R<SaasApplyPushMessageConfig> getApplyBindDataByApplyId(Long applyId) {
                return R.error("远程调用失败");
            }

            @Override
            public R<List<SaasApplyInfoDataVO>> findApplyInfoDataList(Integer type, Long siteId) {
                return R.error("远程调用失败");
            }

            @Override
            public R<List<SaasApplyInfoDataVO>> getApplyInfoDataList() {
                return R.error("远程调用失败");
            }

            @Override
            public R<PushTempDataVO> getPushTempDataVOByApplyId(Long applyId) {
                return R.error("远程调用失败");
            }

            @Override
            public R<NestApplyManage> getApplyByAppId(String appId) {
                return R.error("远程调用失败");
            }
        };
    }
}