我试图在我的 feign.builder 中添加变量,但它一直在说
未处理的异常:java.net.URISyntaxException、java.io.IOException
抛出异常不起作用既不知道如何解决这个问题?假装生成器:
Interface.DeleteComment deleteComment = Feign.builder()
.client(new OkHttpClient())
.encoder(new JacksonEncoder())
.decoder(new JacksonDecoder())
.logger(new Slf4jLogger(Interface.DeleteComment.class))
.logLevel(Logger.Level.FULL)
.target(Interface.DeleteComment.class,
"http://localhost:3000/comments/" + networkConfigurationProperties.id());
网络配置属性
public class NetworkConfigurationProperties {
public String id() throws URISyntaxException,IOException {
final URI uri = new URI("http://localhost:3000/comments/");
String path = uri.getPath();
String idStr = path.substring(path.lastIndexOf('/') + 1);
return idStr;
}
}
隔江千里
慕运维8079593
相关分类