修改添加连接池

master
lwj 2024-09-10 02:38:09 +08:00
parent b59596d4ba
commit 587f61aab5
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,16 @@
package com.muyu.remote;
import com.muyu.common.core.domain.Result;
import com.muyu.domain.Source;
import com.muyu.remote.factory.SourceFactory;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@EnableFeignClients
@FeignClient(value = "cloud-etl-datasources",fallbackFactory = SourceFactory.class )
public interface SourceRemote {
@GetMapping("datasources/{id}")
public Result<Source> queryById(@PathVariable("id") Long id);
}

View File

@ -0,0 +1,20 @@
package com.muyu.remote.factory;
import com.muyu.common.core.domain.Result;
import com.muyu.domain.Source;
import com.muyu.remote.SourceRemote;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
@Component
public class SourceFactory implements FallbackFactory<SourceRemote> {
@Override
public SourceRemote create(Throwable cause) {
return new SourceRemote() {
@Override
public Result<Source> queryById(Long id) {
return null;
}
};
}
}