{"id":1694,"date":"2023-03-25T22:50:53","date_gmt":"2023-03-25T14:50:53","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1694"},"modified":"2023-04-23T21:44:03","modified_gmt":"2023-04-23T13:44:03","slug":"summary-of-spring-boot-tips","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/summary-of-spring-boot-tips\/","title":{"rendered":"Spring Boot\u5c0f\u6280\u5de7\u603b\u7ed3"},"content":{"rendered":"<h2>Feign\u5ba2\u6237\u7aef\u76f4\u63a5\u6307\u5b9aIP\u8c03\u7528\u670d\u52a1<\/h2>\n<pre><code class=\"language-java\">@FeignClient(value = &quot;appblog-provider-channel-core&quot;, url=&quot;192.168.1.10:8888&quot;)\npublic interface ChannelPayApi extends IChannelPayApi {\n\n}<\/code><\/pre>\n<p><!-- more --><\/p>\n<h2>\u83b7\u53d6\u8bf7\u6c42Header<\/h2>\n<pre><code class=\"language-java\">public Result&lt;Response&gt; query(@PathVariable(&quot;id&quot;) String id, @RequestHeader(&quot;token&quot;) String token) {\n\n}<\/code><\/pre>\n<h2>RequestContext\u8bf7\u6c42\u4e0a\u4e0b\u6587\u8bbe\u7f6e\u4e0e\u83b7\u53d6<\/h2>\n<pre><code class=\"language-java\">public class GatewayPreFilter extends ZuulFilter {\n\n    @Override\n    public Object run() throws ZuulException {\n        RequestContext.getCurrentContext().set(String key, Object value);<\/code><\/pre>\n<pre><code class=\"language-java\">public class GatewayPostFilter extends ZuulFilter {\n\n    @Override\n    public Object run() throws ZuulException {\n        RequestContext requestContext = RequestContext.getCurrentContext();\n        Object value = (String) requestContext.get(String key);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Feign\u5ba2\u6237\u7aef\u76f4\u63a5\u6307\u5b9aIP\u8c03\u7528\u670d\u52a1 @FeignClient(value = &quot;appblog-p [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[251],"class_list":["post-1694","post","type-post","status-publish","format-standard","hentry","category-spring-boot","tag-feign"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1694"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1694\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}