package com.hw.dms.api.factory;

import com.hw.common.core.domain.R;
import com.hw.dms.api.RemoteDmsService;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @ClassName : RemoteDmsFallbackFactory
 * @Description :ZHOUHY
 * @Author :
 * @Date: 2024-01-30 15:53
 */
public class RemoteDmsFallbackFactory implements FallbackFactory<RemoteDmsService> {
    @Override
    public RemoteDmsService create(Throwable throwable) {
       return new RemoteDmsService(){

           @Override
           public R<?> getDmsRepairInstance(String source) {
               return R.fail("调用失败:" + throwable.getMessage());
           }
       };
    }
}
