{"id":1817,"date":"2026-01-01T00:11:11","date_gmt":"2025-12-31T16:11:11","guid":{"rendered":"https:\/\/eve2333.top\/?p=1817"},"modified":"2026-01-01T17:27:25","modified_gmt":"2026-01-01T09:27:25","slug":"%e5%8a%a8%e6%80%81%e7%ba%bf%e7%a8%8b%e6%b1%a0onethread%e7%b3%bb%e7%bb%9f-%e7%ac%ac%e5%8d%81%e4%b8%83%e9%83%a8%e5%88%86-banner%e8%87%aa%e5%ae%9a%e4%b9%89%e5%92%8c%e5%bc%80%e5%8f%91nacos","status":"publish","type":"post","link":"https:\/\/eve2333.top\/?p=1817","title":{"rendered":"\u52a8\u6001\u7ebf\u7a0b\u6c60oneThread\u7cfb\u7edf \u2014 \u7b2c\u5341\u4e03\u90e8\u5206\u00a0Banner\u81ea\u5b9a\u4e49\u548c\u5f00\u53d1Nacos\u63a7\u5236\u53f0"},"content":{"rendered":"\n<p>Banner\u5c31\u662f\u63a7\u5236\u53f0\u6253\u5370\u7684\u4e1c\u897f\uff0c\u6bd4\u5982\u8bf4springboot<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>  .   ____          _            __ _ _\n \/\\\\ \/ ___'_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\n( ( )\\___ | '_ | '_| | '_ \\\/ _` | \\ \\ \\ \\\n \\\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\n  '  |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/\n =========|_|==============|___\/=\/_\/_\/_\/\n :: Spring Boot ::                (v3.0.7)<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>\u6bd4\u5982\u8bf4claude code\uff0c\u53ef\u60dc\u73b0\u5728\u53d8\u6210\u8fd9\u6837\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"363\" height=\"272\" src=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767193327-image.png\" alt=\"\" class=\"wp-image-1820\" srcset=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767193327-image.png 363w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767193327-image-300x225.png 300w\" sizes=\"auto, (max-width: 363px) 100vw, 363px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>\n * \u2590\u259b\u2588\u2588\u2588\u259c\u258c *   Claude Code v2.0.76\n* \u259d\u259c\u2588\u2588\u2588\u2588\u2588\u259b\u2598 *  Sonnet 4.5 \u00b7 API Usage Billing\n *  \u2598\u2598 \u259d\u259d  *   ~\\Desktop\\<\/code><\/pre>\n\n\n\n<p>oneThread \u7684 Banner \u7ec4\u4ef6\u91c7\u7528\u4e86\u6a21\u5757\u5316\u8bbe\u8ba1\uff0c\u901a\u8fc7\u81ea\u52a8\u914d\u7f6e\u673a\u5236\u5b9e\u73b0\u65e0\u4fb5\u5165\u96c6\u6210\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"423\" height=\"425\" src=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767193517-image.png\" alt=\"\" class=\"wp-image-1823\" style=\"width:359px;height:auto\" srcset=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767193517-image.png 423w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767193517-image-300x300.png 300w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767193517-image-150x150.png 150w\" sizes=\"auto, (max-width: 423px) 100vw, 423px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/patorjk.com\/software\/taag\/#p=display&amp;f=Graffiti&amp;t=Type+Something+&amp;x=none&amp;v=4&amp;h=4&amp;w=80&amp;we=false\" target=\"_blank\"  rel=\"nofollow\" >Text to ASCII Art Generator (TAAG)<\/a>\u5b9e\u73b0banner\u5b9e\u73b0<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"385\" src=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767194288-image-1024x385.png\" alt=\"\" class=\"wp-image-1825\" style=\"aspect-ratio:2.6598060558084304;width:588px;height:auto\" srcset=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767194288-image-1024x385.png 1024w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767194288-image-300x113.png 300w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767194288-image-768x289.png 768w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767194288-image.png 1482w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5165\u53e3\u70b9<\/strong>\uff1aCommonAutoConfiguration\uff08\u901a\u7528\u81ea\u52a8\u914d\u7f6e\u7c7b\uff09\u3002\u8fd9\u662f Spring Boot \u81ea\u52a8\u88c5\u914d\u7684\u673a\u5236\uff0c\u8d1f\u8d23\u5c06 Banner \u7ec4\u4ef6\u6ce8\u518c\u5230 Spring \u5bb9\u5668\u4e2d\u3002<\/li>\n\n\n\n<li><strong>\u6838\u5fc3\u7c7b<\/strong>\uff1aOneThreadBannerHandler\u3002\n<ul class=\"wp-block-list\">\n<li>\u5b83\u5b9e\u73b0\u4e86&nbsp;InitializingBean&nbsp;\u63a5\u53e3\u3002\u8fd9\u610f\u5473\u7740\u5f53 Bean \u7684\u5c5e\u6027\u8bbe\u7f6e\u5b8c\u6210\u540e\uff0cSpring \u4f1a\u81ea\u52a8\u8c03\u7528&nbsp;afterPropertiesSet()&nbsp;\u65b9\u6cd5\u3002Banner \u7684\u6253\u5370\u903b\u8f91\u5c31\u5199\u5728\u8fd9\u4e2a\u65b9\u6cd5\u91cc\uff0c\u786e\u4fdd\u5728\u5e94\u7528\u542f\u52a8\u65e9\u671f\u6267\u884c\u3002<\/li>\n\n\n\n<li>\u5b83\u4f9d\u8d56&nbsp;BuildProperties\u3002\u8fd9\u662f\u4e00\u4e2a Spring Boot \u63d0\u4f9b\u7684\u7c7b\uff0c\u7528\u4e8e\u8bfb\u53d6\u6784\u5efa\u4fe1\u606f\uff08\u5982\u7248\u672c\u53f7\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u65b0\u5efa&nbsp;OneThreadBannerHandler.java&nbsp;\u7c7b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.nageoffer.onethread.spring.config;\n\nimport cn.hutool.core.util.StrUtil;\nimport org.springframework.boot.ansi.AnsiColor;\nimport org.springframework.boot.ansi.AnsiOutput;\nimport org.springframework.boot.ansi.AnsiStyle;\nimport org.springframework.boot.info.BuildProperties;\nimport org.springframework.beans.factory.InitializingBean;\n\npublic class OneThreadBannerHandler implements InitializingBean {\n    private static final String ONE_THREAD_DASHBOARD = \"Dashboard\"; \/\/ \u793a\u4f8b\n    private static final String ONE_THREAD_SITE = \"Site\"; \/\/ \u793a\u4f8b\n    private static final String DYNAMIC_THREAD_POOL = \"Dynamic Thread Pool\";\n    private static final int STRAP_LINE_SIZE = 50; \/\/ \u6839\u636e\u5b9e\u9645Banner\u5bbd\u5ea6\u8c03\u6574\n\n    private final String version;\n\n    public OneThreadBannerHandler(BuildProperties buildProperties) {\n        this.version = buildProperties != null ? buildProperties.getVersion() : \"\";\n    }\n\n    @Override\n    public void afterPropertiesSet() throws Exception {\n        String banner = \"\"\"\n                           \u2591\u2588\u2588\u2591\u2588\u2588           \u2591\u2588\u2588                                                       \u2591\u2588\u2588           \u2591\u2588\u2588\n                                                                                                                      \\s\n                 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588  \u2591\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588  \u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\n                \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588\u2591\u2588\u2588      \u2591\u2588\u2588  \u2591\u2588\u2588\u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588      \u2591\u2588\u2588  \u2591\u2588\u2588\n                \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588  \u2591\u2588\u2588\u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588  \u2591\u2588\u2588\n                \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588\u2591\u2588\u2588\u2591\u2588\u2588   \u2591\u2588\u2588  \u2591\u2588\u2588\u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588    \u2591\u2588\u2588 \u2591\u2588\u2588\u2591\u2588\u2588   \u2591\u2588\u2588  \u2591\u2588\u2588\n                 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588  \u2591\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588   \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588  \u2591\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588 \u2591\u2588\u2588\n                                                                                                                      \\s\n                                                                                                                      \\s\n                                                                                                                      \\s\n        \"\"\"; \/\/ \u6b64\u5904\u586b\u5165\u6587\u6863\u4e2d\u7684 ASCII \u5b57\u7b26\n\n        String bannerVersion = StrUtil.isNotEmpty(version) ? \" (v\" + version + \")\" : \"no version.\";\n\n        \/\/ \u8ba1\u7b97 Padding\n        StringBuilder padding = new StringBuilder();\n        while (padding.length() &lt; STRAP_LINE_SIZE - (bannerVersion.length() + DYNAMIC_THREAD_POOL.length())) {\n            padding.append(\" \");\n        }\n\n        System.out.println(AnsiOutput.toString(\n                AnsiColor.GREEN, banner,\n                AnsiColor.DEFAULT, DYNAMIC_THREAD_POOL,\n                AnsiColor.DEFAULT, padding.toString(),\n                AnsiStyle.FAINT, bannerVersion,\n                \"\\n\" \/\/ \u6839\u636e\u9700\u8981\u6dfb\u52a0\u6362\u884c\u6216\u94fe\u63a5\n        ));\n    }\n}<\/code><\/pre>\n\n\n\n<p>pomxml\u91cc\u9762\u52a0\u8fd9\u4e2a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;build&gt;\n        &lt;plugins&gt;\n            &lt;plugin&gt;\n                &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\n                &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\n                &lt;version&gt;3.11.0&lt;\/version&gt;\n                &lt;configuration&gt;\n                    &lt;source&gt;17&lt;\/source&gt;\n                    &lt;target&gt;17&lt;\/target&gt;\n                    &lt;annotationProcessorPaths&gt;\n                        &lt;path&gt;\n                            &lt;groupId&gt;org.projectlombok&lt;\/groupId&gt;\n                            &lt;artifactId&gt;lombok&lt;\/artifactId&gt;\n                            &lt;version&gt;1.18.34&lt;\/version&gt;\n                        &lt;\/path&gt;\n                    &lt;\/annotationProcessorPaths&gt;\n                &lt;\/configuration&gt;\n            &lt;\/plugin&gt;\n            &lt;!-- 2. \u65b0\u589e\uff1aSpring Boot \u63d2\u4ef6\uff08\u53ea\u7528\u4e8e\u751f\u6210\u6784\u5efa\u4fe1\u606f\uff09 --&gt;\n            &lt;plugin&gt;\n                &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n                &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\n                &lt;version&gt;3.2.0&lt;\/version&gt;\n                &lt;executions&gt;\n                    &lt;execution&gt;\n                        &lt;goals&gt;\n                            &lt;!-- \u6838\u5fc3\u914d\u7f6e\uff1a\u751f\u6210 META-INF\/build-info.properties --&gt;\n                            &lt;goal&gt;build-info&lt;\/goal&gt;\n                        &lt;\/goals&gt;\n                    &lt;\/execution&gt;\n                &lt;\/executions&gt;\n            &lt;\/plugin&gt;\n        &lt;\/plugins&gt;\n     &lt;\/build&gt;\n\n&lt;\/project&gt;<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u57fa\u4e8eNacos\u5f00\u53d1oneThread\u63a7\u5236\u53f0\u6a21\u5757<\/h1>\n\n\n\n<p>\u5728\u6df1\u5165\u4e86\u89e3 DashBoard-Dev \u7684\u8bbe\u8ba1\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u6765\u5206\u6790\u4e00\u4e0b\u5e02\u573a\u4e0a\u52a8\u6001\u7ebf\u7a0b\u6c60\u7684\u4e24\u79cd\u4e3b\u6d41\u67b6\u6784\u6a21\u5f0f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1\">1. \u914d\u7f6e\u4e2d\u5fc3\u6a21\u5f0f<\/h3>\n\n\n\n<p>\u914d\u7f6e\u4e2d\u5fc3\u6a21\u5f0f\u662f\u4e00\u79cd\u76f8\u5bf9\u8f7b\u91cf\u7684\u67b6\u6784\u65b9\u6848\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"923\" src=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196219-image-1024x923.png\" alt=\"\" class=\"wp-image-1830\" srcset=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196219-image-1024x923.png 1024w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196219-image-300x270.png 300w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196219-image-768x692.png 768w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196219-image.png 1159w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2\">2. \u72ec\u7acb\u670d\u52a1\u6a21\u5f0f<\/h3>\n\n\n\n<p>\u72ec\u7acb\u670d\u52a1\u6a21\u5f0f\u63d0\u4f9b\u4e86\u66f4\u5f3a\u7684\u529f\u80fd\u6027\uff0c\u4f46\u67b6\u6784\u76f8\u5bf9\u590d\u6742\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"897\" src=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196207-image-1024x897.png\" alt=\"\" class=\"wp-image-1829\" srcset=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196207-image-1024x897.png 1024w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196207-image-300x263.png 300w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196207-image-768x673.png 768w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196207-image.png 1319w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-one-thread\">3. oneThread \u6df7\u5408\u67b6\u6784<\/h3>\n\n\n\n<p>oneThread \u91c7\u7528\u4e86\u4e00\u79cd\u521b\u65b0\u7684\u6df7\u5408\u67b6\u6784\uff0c\u65e2\u4fdd\u6301\u4e86\u914d\u7f6e\u4e2d\u5fc3\u6a21\u5f0f\u7684\u8f7b\u91cf\u7279\u6027\uff0c\u53c8\u63d0\u4f9b\u4e86\u72ec\u7acb\u670d\u52a1\u6a21\u5f0f\u7684\u53ef\u89c6\u5316\u80fd\u529b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"862\" src=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196199-image-1024x862.png\" alt=\"\" class=\"wp-image-1828\" srcset=\"https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196199-image-1024x862.png 1024w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196199-image-300x253.png 300w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196199-image-768x647.png 768w, https:\/\/eve2333.top\/wp-content\/uploads\/2025\/12\/1767196199-image.png 1374w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u8fd9\u79cd\u6df7\u5408\u67b6\u6784\u7684\u6838\u5fc3\u4f18\u52bf\u5728\u4e8e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6570\u636e\u6e90\u7edf\u4e00<\/strong> \uff1a\u6240\u6709\u914d\u7f6e\u53d8\u66f4\u90fd\u901a\u8fc7\u914d\u7f6e\u4e2d\u5fc3\u8fdb\u884c\uff0c\u4fdd\u8bc1\u6570\u636e\u4e00\u81f4\u6027\u3002<\/li>\n\n\n\n<li><strong>\u4f9d\u8d56\u6700\u5c0f\u5316<\/strong> \uff1a\u4e1a\u52a1\u5e94\u7528\u53ea\u9700\u4f9d\u8d56\u914d\u7f6e\u4e2d\u5fc3\uff0c\u65e0\u9700\u989d\u5916\u4e2d\u95f4\u4ef6\u3002<\/li>\n\n\n\n<li><strong>\u53ef\u89c6\u5316\u589e\u5f3a<\/strong> \uff1aDashBoard-Dev \u63d0\u4f9b\u53cb\u597d\u7684\u7ba1\u7406\u754c\u9762\u3002<\/li>\n\n\n\n<li><strong>\u67b6\u6784\u7075\u6d3b<\/strong> \uff1a\u53ef\u4ee5\u9009\u62e9\u6027\u90e8\u7f72 Dashboard\uff0c\u4e0d\u5f71\u54cd\u6838\u5fc3\u529f\u80fd\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nacos-api\">\u62bd\u8c61 Nacos API \u64cd\u4f5c<\/h2>\n\n\n\n<p>\u5728 oneThread \u6846\u67b6\u4e2d\uff0cNacos \u4ee3\u7406\u5ba2\u6237\u7aef\uff08NacosProxyClient\uff09\u626e\u6f14\u7740\u5173\u952e\u89d2\u8272\u3002\u5b83\u8d1f\u8d23\u4e0e Nacos \u670d\u52a1\u7aef\u8fdb\u884c\u4ea4\u4e92\uff0c\u5b9e\u73b0\u914d\u7f6e\u7684\u67e5\u8be2\u3001\u66f4\u65b0\u548c\u670d\u52a1\u5b9e\u4f8b\u7684\u53d1\u73b0\u3002<strong>\u901a\u8fc7\u5c01\u88c5Nacos\u7684RESTAPI\uff0cNacosProxyClient\u63d0\u4f9b\u4e86\u4e00\u7ec4\u9762\u5411\u4e1a\u52a1\u7684\u9ad8\u5c42\u63a5\u53e3<\/strong> \uff0c\u4f7f\u5f97\u6846\u67b6\u7684\u5176\u4ed6\u5c42\u80fd\u591f\u4ee5\u7edf\u4e00\u7684\u65b9\u5f0f\u64cd\u4f5c Nacos\uff0c\u800c\u65e0\u9700\u5173\u5fc3\u5e95\u5c42\u5b9e\u73b0\u7ec6\u8282\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>com.nageoffer.onethread.dashboard.dev.server.remote.client.NacosProxyClient<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"1024\" src=\"https:\/\/eve2333.top\/wp-content\/uploads\/2026\/01\/1767197468-image-883x1024.png\" alt=\"\" class=\"wp-image-1833\" style=\"aspect-ratio:0.8623123315796227;width:420px;height:auto\" srcset=\"https:\/\/eve2333.top\/wp-content\/uploads\/2026\/01\/1767197468-image-883x1024.png 883w, https:\/\/eve2333.top\/wp-content\/uploads\/2026\/01\/1767197468-image-259x300.png 259w, https:\/\/eve2333.top\/wp-content\/uploads\/2026\/01\/1767197468-image-768x891.png 768w, https:\/\/eve2333.top\/wp-content\/uploads\/2026\/01\/1767197468-image.png 908w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1\">1. \u6838\u5fc3\u65b9\u6cd5\u8bbe\u8ba1<\/h3>\n\n\n\n<p>NacosProxyClient \u5305\u542b\u56db\u4e2a\u6838\u5fc3\u65b9\u6cd5\uff0c\u5206\u522b\u5bf9\u5e94\u4e0d\u540c\u7684 Nacos REST API \u64cd\u4f5c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>listConfig\u65b9\u6cd5<\/strong> \uff1a\u67e5\u8be2\u547d\u540d\u7a7a\u95f4\u4e0b\u914d\u7f6e\u6587\u4ef6\u96c6\u5408\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>publicList&lt;NacosConfigRespDTO&gt;listConfig(String namespace){\/\/ ... \u7701\u7565\u5b9e\u73b0\u7ec6\u8282}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>getConfig\u65b9\u6cd5<\/strong> \uff1a\u67e5\u8be2\u914d\u7f6e\u660e\u7ec6\u4fe1\u606f\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>publicNacosConfigDetailRespDTOgetConfig(String namespace,String dataId,String group){\/\/ ... \u7701\u7565\u5b9e\u73b0\u7ec6\u8282}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>publishConfig\u65b9\u6cd5<\/strong> \uff1a\u53d1\u5e03\u914d\u7f6e\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>publicvoidpublishConfig(String namespace,String dataId,String group,StringMD5,String id,String content,String type){\/\/ ... \u7701\u7565\u5b9e\u73b0\u7ec6\u8282}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>service\u65b9\u6cd5<\/strong> \uff1a\u67e5\u8be2\u670d\u52a1\u660e\u7ec6\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>publicNacosServiceListRespDTOservice(String namespace,String service){\/\/ ... \u7701\u7565\u5b9e\u73b0\u7ec6\u8282}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2\">2. \u53c2\u6570\u5904\u7406\u4e0e\u547d\u540d\u7a7a\u95f4\u9694\u79bb<\/h3>\n\n\n\n<p>NacosProxyClient \u5728\u5904\u7406\u53c2\u6570\u65f6\uff0c\u7279\u522b\u6ce8\u610f\u4e86\u547d\u540d\u7a7a\u95f4\u7684\u9694\u79bb\u95ee\u9898\u3002\u5728 Nacos \u4e2d\uff0c\u547d\u540d\u7a7a\u95f4\u662f\u7528\u4e8e\u533a\u5206\u4e0d\u540c\u73af\u5883\uff08\u5982\u5f00\u53d1\u3001\u6d4b\u8bd5\u3001\u751f\u4ea7\uff09\u7684\u9694\u79bb\u5355\u5143\u3002<strong>\u901a\u8fc7\u5224\u65adnamespace\u662f\u5426\u4e3a\"public\"\uff0cNacosProxyClient\u80fd\u591f\u6b63\u786e\u5904\u7406\u4e0d\u540c\u547d\u540d\u7a7a\u95f4\u4e0b\u7684\u914d\u7f6e\u8bf7\u6c42<\/strong> \u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u5728listConfig\u65b9\u6cd5\u4e2dform(\"tenant\",Objects.equals(namespace,\"public\")?\"\": namespace)\n\u200b\n\/\/ \u5728 service\u65b9\u6cd5\u4e2dform(\"namespaceId\",Objects.equals(namespace,\"public\")?\"\": namespace)<\/code><\/pre>\n\n\n\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u4f7f\u5f97 oneThread \u6846\u67b6\u80fd\u591f<strong>\u652f\u6301\u591a\u73af\u5883\u90e8\u7f72\uff0c\u5b9e\u73b0\u914d\u7f6e\u7684\u73af\u5883\u9694\u79bb<\/strong> \uff0c\u5927\u5927\u63d0\u9ad8\u4e86\u6846\u67b6\u7684\u7075\u6d3b\u6027\u548c\u5b89\u5168\u6027\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u5982\u679c\u662f public \u9700\u8981\u4f20\u9012\u7a7a\u5b57\u7b26\u4e32\uff0c\u4e3a\u4e86\u9002\u914d Nacos \u7684\u63a5\u53e3\u53c2\u6570\u5904\u7406\u3002<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-yaml\">3. YAML \u914d\u7f6e\u89e3\u6790\u4e0e\u7ed1\u5b9a<\/h3>\n\n\n\n<p>NacosProxyClient \u5728\u67e5\u8be2\u914d\u7f6e\u540e\uff0c\u9700\u8981\u5c06\u914d\u7f6e\u5185\u5bb9\u89e3\u6790\u4e3a Java \u5bf9\u8c61\u3002<strong>oneThread\u6846\u67b6\u4f7f\u7528YAML\u683c\u5f0f\u5b58\u50a8\u7ebf\u7a0b\u6c60\u914d\u7f6e\uff0c\u901a\u8fc7yamlConfigParser\u8fdb\u884c\u89e3\u6790\uff0c\u518d\u901a\u8fc7Spring\u7684Binder\u7ed1\u5b9a\u5230DashBoardConfigProperties\u5bf9\u8c61<\/strong> \u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u5728 threadPoolManagerService \u4e2dMap&lt;Object, Object&gt; configInfoMap = yamlConfigParser.doParse(config.getContent());ConfigurationPropertySource sources =newMapConfigurationPropertySource(configInfoMap);Binder binder =newBinder(sources);DashBoardConfigProperties refresherProperties = binder.bind(\"onethread\",Bindable.of(DashBoardConfigProperties.class)).orElseThrow(()-&gt;newIllegalArgumentException(\"\u914d\u7f6e\u7ed1\u5b9a\u5931\u8d25\"));<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"dash-board-dev\">DashBoard-Dev \u670d\u52a1\u7684\u529f\u80fd\u4e0e\u5b9e\u73b0\u673a\u5236<\/h2>\n\n\n\n<p>DashBoard-Dev \u670d\u52a1\u662f oneThread \u6846\u67b6\u7684\u7ba1\u7406\u5165\u53e3\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u5957 REST API\uff0c\u4f7f\u5f97\u8fd0\u7ef4\u4eba\u5458\u80fd\u591f\u901a\u8fc7 HTTP \u63a5\u53e3\u67e5\u8be2\u548c\u66f4\u65b0\u7ebf\u7a0b\u6c60\u914d\u7f6e\uff0c\u76d1\u63a7\u7ebf\u7a0b\u6c60\u8fd0\u884c\u72b6\u6001\uff0c\u5e76\u8bbe\u7f6e\u9608\u503c\u544a\u8b66\u3002<strong>DashBoard-Dev\u670d\u52a1\u7684\u6838\u5fc3\u529f\u80fd\u5305\u62ec\u914d\u7f6e\u7ba1\u7406\u3001\u670d\u52a1\u53d1\u73b0\u3001\u72b6\u6001\u76d1\u63a7\u548c\u544a\u8b66\u8bbe\u7f6e<\/strong> \u3002<\/p>\n\n\n\n<p>\u5728 <strong>DashBoard-Dev<\/strong> \u4e2d\uff0c\u5982\u679c\u8fdb\u884c\u529f\u80fd\u62c6\u5206\uff0c\u53ef\u4ee5\u5212\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u6a21\u5757\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9879\u76ee\u6a21\u5757<\/li>\n\n\n\n<li>Grafana \u6a21\u5757<\/li>\n\n\n\n<li>\u7528\u6237\u6a21\u5757<\/li>\n\n\n\n<li>\u7ebf\u7a0b\u6c60\u7ba1\u7406 &amp; \u5b9e\u4f8b<\/li>\n\n\n\n<li>Web \u7ebf\u7a0b\u6c60\u7ba1\u7406 &amp; \u5b9e\u4f8b<\/li>\n<\/ul>\n\n\n\n<p>\u5176\u4e2d\uff0c\u524d\u4e09\u4e2a\u6a21\u5757\u4e3b\u8981\u662f\u4e3a\u4e86\u652f\u6491\u63a7\u5236\u53f0\u7684\u642d\u5efa\uff0c\u8bbe\u8ba1\u76f8\u5bf9\u7b80\u5355\uff0c\u5927\u5bb6\u4e86\u89e3\u5373\u53ef\u3002<\/p>\n\n\n\n<p>\u771f\u6b63\u7684\u6838\u5fc3\u5728\u4e8e <strong>\u7ebf\u7a0b\u6c60\u7ba1\u7406<\/strong> \u548c <strong>Web\u7ebf\u7a0b\u6c60\u7ba1\u7406<\/strong> \uff0c\u4e8c\u8005\u7684\u903b\u8f91\u57fa\u672c\u4e00\u81f4\u3002\u4e0b\u9762\u5c06\u4ee5 <strong>\u7ebf\u7a0b\u6c60<\/strong> \u4e3a\u4f8b\u5c55\u5f00\u8bf4\u660e\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-api\">1. \u7ba1\u7406\u914d\u7f6e API<\/h3>\n\n\n\n<p>DashBoard-Dev \u670d\u52a1\u901a\u8fc7 ThreadPoolManagerController \u63d0\u4f9b\u914d\u7f6e\u7ba1\u7406 API\uff0c\u5141\u8bb8\u7528\u6237\u67e5\u8be2\u548c\u66f4\u65b0\u7ebf\u7a0b\u6c60\u914d\u7f6e\u3002<\/p>\n\n\n\n<p><strong>\u67e5\u8be2\u7ebf\u7a0b\u6c60\u96c6\u5408API<\/strong> \uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@GetMapping(\"\/api\/onethread-dashboard\/thread-pools\")publicResult&lt;List&lt;ThreadPoolDetailRespDTO&gt;&gt;listThreadPool(ThreadPoolListReqDTO requestParam){returnResults.success(threadPoolManagerService.listThreadPool(requestParam));}<\/code><\/pre>\n\n\n\n<p><strong>\u66f4\u65b0\u7ebf\u7a0b\u6c60API<\/strong> \uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@PutMapping(\"\/api\/onethread-dashboard\/thread-pool\")publicResult&lt;Void&gt;updateGlobalThreadPool(@RequestBody@ValidThreadPoolUpdateReqDTO requestParam){\n &nbsp; &nbsp;threadPoolManagerService.updateGlobalThreadPool(requestParam);returnResults.success();}<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e9b API \u8c03\u7528 threadPoolManagerService \u7684\u76f8\u5e94\u65b9\u6cd5\uff0c\u901a\u8fc7 NacosProxyClient \u4e0e Nacos \u4ea4\u4e92\uff0c\u5b9e\u73b0\u914d\u7f6e\u7684\u67e5\u8be2\u548c\u66f4\u65b0\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2\">2. \u670d\u52a1\u53d1\u73b0\u4e0e\u914d\u7f6e\u805a\u5408<\/h3>\n\n\n\n<p>DashBoard-Dev \u670d\u52a1\u901a\u8fc7 NacosProxyClient \u7684 service \u65b9\u6cd5\u67e5\u8be2\u670d\u52a1\u5b9e\u4f8b\u5217\u8868\uff0c\u7136\u540e\u901a\u8fc7 HTTP \u8c03\u7528\u5404\u5b9e\u4f8b\u7684\u76d1\u63a7\u63a5\u53e3\uff0c\u6536\u96c6\u7ebf\u7a0b\u6c60\u8fd0\u884c\u65f6\u72b6\u6001\u3002<\/p>\n\n\n\n<p><strong>\u670d\u52a1\u53d1\u73b0\u4e0e\u914d\u7f6e\u805a\u5408\u6d41\u7a0b<\/strong> \uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>1.\u6839\u636e\u547d\u540d\u7a7a\u95f4\u548c\u670d\u52a1\u540d\u67e5\u8be2 Nacos \u670d\u52a1\u5b9e\u4f8b\u5217\u8868\uff1b<\/li>\n\n\n\n<li>2.\u5bf9\u6bcf\u4e2a\u670d\u52a1\u5b9e\u4f8b\u53d1\u8d77 HTTP \u8bf7\u6c42\uff0c\u83b7\u53d6\u7ebf\u7a0b\u6c60\u8fd0\u884c\u65f6\u72b6\u6001\uff1b<\/li>\n\n\n\n<li>3.\u5c06\u5404\u5b9e\u4f8b\u7684\u72b6\u6001\u6570\u636e\u805a\u5408\uff0c\u5f62\u6210\u5168\u5c40\u7684\u7ebf\u7a0b\u6c60\u76d1\u63a7\u89c6\u56fe\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u5728 threadPoolManagerService \u7684 listThreadPool \u65b9\u6cd5\u4e2dList&lt;String&gt; namespaces =newArrayList&lt;&gt;(oneThreadProperties.getNamespaces());\/\/ \u5904\u7406namespace\u8fc7\u6ee4\/\/ \u5e76\u884c\u62c9\u53d6\u5404namespace\u7684\u914d\u7f6eList&lt;Map.Entry&lt;String, NacosConfigRespDTO&gt;&gt; tasks = namespaces\n &nbsp; &nbsp; &nbsp;  .parallelStream().flatMap(ns -&gt;{List&lt;NacosConfigRespDTO&gt; cfgs = nacosProxyClient.listConfig(ns);\/\/ ... \u7701\u7565\u8fc7\u6ee4\u903b\u8f91}).collect(Collectors.toList());\n\u200b\n\/\/ \u5e76\u884c\u5904\u7406\u4efb\u52a1\uff1a\u89e3\u6790YAML -&gt; \u7ed1\u5b9a\u914d\u7f6e -&gt; \u67e5\u8be2\u670d\u52a1\u5b9e\u4f8b\u6570 -&gt; \u62fc\u88c5\u8fd4\u56dereturn tasks.parallelStream().map(entry -&gt;{String namespace = entry.getKey();NacosConfigRespDTO config = entry.getValue();\n\u200b\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \u89e3\u6790YAMLMap&lt;Object, Object&gt; configInfoMap = yamlConfigParser.doParse(config.getContent());ConfigurationPropertySource sources =newMapConfigurationPropertySource(configInfoMap);Binder binder =newBinder(sources);\n\u200b\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \u7ed1\u5b9aonethread\u914d\u7f6eDashBoardConfigProperties refresherProperties = binder.bind(\"onethread\",Bindable.of(DashBoardConfigProperties.class)).orElseThrow(()-&gt;newIllegalArgumentException(\"\u914d\u7f6e\u7ed1\u5b9a\u5931\u8d25\"));\n\u200b\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/ \u67e5\u8be2\u5f53\u524d\u670d\u52a1\u5728Nacos\u7684\u5b9e\u4f8b\u6570NacosServiceListRespDTO service = nacosProxyClient.service(namespace, config.getAppName());\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;refresherProperties.getExecutors().forEach(each -&gt;{\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;each.setNamespace(namespace);\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;each.setServiceName(config.getAppName());\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;each.setDataId(config.getDataId());\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;each.setGroup(config.getGroup());\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;each.setInstanceCount(service.getInstanceCount());});\n\u200b\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return refresherProperties.getExecutors();}).flatMap(List::stream).collect(Collectors.toList());<\/code><\/pre>\n\n\n\n<p><strong>\u8fd9\u4e00\u5b9e\u73b0\u5229\u7528\u4e86Java8\u7684StreamAPI\u548c\u5e76\u884c\u6d41\uff0c\u63d0\u9ad8\u4e86\u914d\u7f6e\u67e5\u8be2\u548c\u72b6\u6001\u6536\u96c6\u7684\u6548\u7387<\/strong> \u3002\u7279\u522b\u662f\u5bf9\u4e8e\u5927\u89c4\u6a21\u90e8\u7f72\u7684\u7cfb\u7edf\uff0c\u8fd9\u79cd\u5e76\u884c\u5904\u7406\u673a\u5236\u80fd\u591f\u663e\u8457\u51cf\u5c11\u7ba1\u7406\u754c\u9762\u7684\u54cd\u5e94\u65f6\u95f4\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3\">3. \u7ebf\u7a0b\u6c60\u52a8\u6001\u8c03\u6574\u5b9e\u73b0<\/h3>\n\n\n\n<p>DashBoard-Dev \u670d\u52a1\u901a\u8fc7 updateGlobalThreadPool \u65b9\u6cd5\u5b9e\u73b0\u7ebf\u7a0b\u6c60\u53c2\u6570\u7684\u52a8\u6001\u8c03\u6574\u3002<strong>\u8fd9\u4e00\u8fc7\u7a0b\u6d89\u53ca\u5230\u914d\u7f6e\u7684\u67e5\u8be2\u3001\u4fee\u6539\u3001\u89e3\u6790\u548c\u53d1\u5e03\uff0c\u6700\u7ec8\u5b9e\u73b0\u7ebf\u7a0b\u6c60\u53c2\u6570\u7684\u5728\u7ebf\u66f4\u65b0<\/strong> \u3002<\/p>\n\n\n\n<p><strong>\u7ebf\u7a0b\u6c60\u53c2\u6570\u70ed\u66f4\u65b0\u6d41\u7a0b<\/strong> \uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>1.DashBoard-Dev \u670d\u52a1\u901a\u8fc7 NacosProxyClient \u66f4\u65b0\u7ebf\u7a0b\u6c60\u914d\u7f6e\uff1b<\/li>\n\n\n\n<li>2.Nacos \u914d\u7f6e\u4e2d\u5fc3\u5c06\u914d\u7f6e\u53d8\u66f4\u63a8\u9001\u7ed9\u6240\u6709\u76d1\u542c\u8be5\u914d\u7f6e\u7684\u4e1a\u52a1\u5e94\u7528\uff1b<\/li>\n\n\n\n<li>3.\u4e1a\u52a1\u5e94\u7528\u901a\u8fc7 oneThread SpringBoot Starter \u914d\u7f6e\u76d1\u542c\u5668\u6355\u83b7\u914d\u7f6e\u53d8\u66f4\uff1b<\/li>\n\n\n\n<li>4.\u4e1a\u52a1\u5e94\u7528\u89e3\u6790\u65b0\u914d\u7f6e\uff0c\u66f4\u65b0\u672c\u5730\u7ebf\u7a0b\u6c60\u53c2\u6570\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>@SneakyThrows@OverridepublicvoidupdateGlobalThreadPool(ThreadPoolUpdateReqDTO requestParam){\/\/ \u67e5\u8be2\u539f\u914d\u7f6eNacosConfigDetailRespDTO configDetail = nacosProxyClient.getConfig(requestParam.getNamespace(), requestParam.getDataId(), requestParam.getGroup());String originalContent = configDetail.getContent();\n\u200b\n &nbsp; &nbsp;\/\/ \u89e3\u6790\u539f\u914d\u7f6eMap&lt;Object, Object&gt; configInfoMap = yamlConfigParser.doParse(originalContent);ConfigurationPropertySource source =newMapConfigurationPropertySource(configInfoMap);\n\u200b\n &nbsp; &nbsp;\/\/ \u7ed1\u5b9a\u5230Java\u5bf9\u8c61DashBoardConfigProperties onethread = binder.bind(\"onethread\",Bindable.of(DashBoardConfigProperties.class)).orElseThrow(()-&gt;newRuntimeException(\"\u7ed1\u5b9a\u5931\u8d25\"));\n\u200b\n &nbsp; &nbsp;\/\/ \u4fee\u6539\u7ebf\u7a0b\u6c60\u53c2\u6570\n &nbsp; &nbsp;onethread.getExecutors().stream().filter(e -&gt; e.getThreadPoolId().equals(requestParam.getThreadPoolId())).findFirst().ifPresent(e -&gt;{\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;e.setCorePoolSize(requestParam.getCorePoolSize());\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;e.setMaximumPoolSize(requestParam.getMaximumPoolSize());\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;e.setKeepAliveTime(requestParam.getKeepAliveTime());\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;e.setQueueCapacity(requestParam.getQueueCapacity());\/\/ ... \u7701\u7565\u5176\u4ed6\u53c2\u6570\u8bbe\u7f6e});\n\u200b\n &nbsp; &nbsp;\/\/ \u5c06Java\u5bf9\u8c61\u8f6c\u56deYAML\u683c\u5f0fYAMLFactory factory =newYAMLFactory();\n &nbsp; &nbsp;factory.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER);\n &nbsp; &nbsp;factory.enable(YAMLGenerator.Feature.MINIMIZEQuOTES);\n\u200b\n &nbsp; &nbsp;ObjectMapper objectMapper =newObjectMapper(factory);\n &nbsp; &nbsp;objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n &nbsp; &nbsp;objectMapper.setPropertyNamingStrategy PropertyNamingStrategies.KEBAB_CASE);\n\u200b\n &nbsp; &nbsp;String yamlStr = objectMapper.writeValueAsString(Collections.singletonMap(\"onethread\", onethread));\n\u200b\n &nbsp; &nbsp;\/\/ \u53d1\u5e03\u65b0\u914d\u7f6e\n &nbsp; &nbsp;nacosProxyClient.publishConfig(requestParam.getNamespace(), requestParam.getDataId(), requestParam.getGroup(), configDetail.getAppName(), configDetail.getId(), configDetail.getMD5(), yamlStr,\"yaml\");}<\/code><\/pre>\n\n\n\n<p><strong>\u8fd9\u4e00\u5b9e\u73b0\u6d41\u7a0b\u7684\u5173\u952e\u5728\u4e8e\u83b7\u53d6\u539f\u914d\u7f6e\u7684id\u548cmd5\u503c<\/strong> \uff0c\u4ee5\u786e\u4fdd\u914d\u7f6e\u66f4\u65b0\u7684\u539f\u5b50\u6027\u548c\u4e00\u81f4\u6027\u3002\u5728 Nacos \u4e2d\uff0c\u6bcf\u4e2a\u914d\u7f6e\u90fd\u6709\u552f\u4e00\u7684 id \u548c md5 \u503c\uff0c\u901a\u8fc7\u643a\u5e26\u8fd9\u4e9b\u503c\u8fdb\u884c\u914d\u7f6e\u66f4\u65b0\uff0c\u53ef\u4ee5\u907f\u514d\u591a\u4eba\u540c\u65f6\u4fee\u6539\u914d\u7f6e\u65f6\u7684\u7248\u672c\u51b2\u7a81\u95ee\u9898\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4\">4. \u7ebf\u7a0b\u6c60\u5b9e\u4f8b\u76d1\u63a7\u6307\u6807<\/h3>\n\n\n\n<p>\u7ebf\u7a0b\u6c60\u76d1\u63a7\u80fd\u529b\u7531 <strong><code>onethread-dashboard-dev-spring-boot-starter<\/code><\/strong> \u63d0\u4f9b\uff0c\u5b83\u66b4\u9732\u4e86\u6807\u51c6\u7684 Web \u63a5\u53e3\u3002 \u5e95\u5c42\u5b9e\u73b0\u4f9d\u8d56\u4e1a\u52a1\u5e94\u7528\u5728 <strong>Nacos<\/strong> \u4e0a\u6ce8\u518c\u7684 <strong>IP\u5730\u5740<\/strong> \uff0cDashboard \u901a\u8fc7\u8be5\u5730\u5740\u76f4\u63a5\u8c03\u7528\u76ee\u6807\u5e94\u7528\u7684\u63a5\u53e3\u83b7\u53d6\u7ebf\u7a0b\u6c60\u72b6\u6001\u3002<\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c<code>getRuntimeState<\/code> \u65b9\u6cd5\u4f1a\u62fc\u63a5\u4e1a\u52a1\u5e94\u7528\u7684\u7f51\u7edc\u5730\u5740\u5e76\u53d1\u8d77\u8bf7\u6c42\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@OverridepublicThreadPoolStateRespDTOgetRuntimeState(String threadPoolId,String networkAddress){String resultStr =HttpUtil.get(\"http:\/\/\"+ networkAddress +\"\/dynamic\/thread-pool\/\"+ threadPoolId);Result&lt;ThreadPoolStateRespDTO&gt; result =JSON.parseObject(resultStr,newTypeReference&lt;&gt;(){});return result.getData();}<\/code><\/pre>\n\n\n\n<p>\u5176\u4e2d <code>networkAddress<\/code> \u53c2\u6570\u6765\u6e90\u4e8e\u7ebf\u7a0b\u6c60\u5217\u8868\u63a5\u53e3\uff0c\u8c03\u7528\u65f6\u76f4\u63a5\u900f\u4f20\u3002<\/p>\n\n\n\n<p>\u5728 <code>onethread-dashboard-dev-spring-boot-starter<\/code> \u5185\u7f6e\u7684\u63a7\u5236\u5668\u4e2d\uff0c\u63d0\u4f9b\u4e86\u4e24\u7c7b\u63a5\u53e3\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8f7b\u91cf\u7ea7\u6307\u6807\u63a5\u53e3<\/strong> \uff1a\u7528\u4e8e\u7ebf\u7a0b\u6c60\u5217\u8868\u5c55\u793a\uff0c\u5feb\u901f\u83b7\u53d6\u57fa\u7840\u8fd0\u884c\u4fe1\u606f\uff1b<\/li>\n\n\n\n<li><strong>\u5b8c\u6574\u8fd0\u884c\u65f6\u63a5\u53e3<\/strong> \uff1a\u7528\u4e8e\u8be6\u60c5\u9875\u9762\uff0c\u5c55\u793a\u7ebf\u7a0b\u6c60\u7684\u5168\u9762\u72b6\u6001\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4ee3\u7801\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@RestController@RequiredArgsConstructorpublicclassDynamicThreadPoolController{\n\u200b\n &nbsp; &nbsp;privatefinalDynamicThreadPoolService dynamicThreadPoolService;\n\u200b\n &nbsp; &nbsp;\/**\n &nbsp; &nbsp; * \u83b7\u53d6\u7ebf\u7a0b\u6c60\u7684\u8f7b\u91cf\u7ea7\u8fd0\u884c\u6307\u6807\n &nbsp; &nbsp; *\/@GetMapping(\"\/dynamic\/thread-pool\/{threadPoolId}\/basic-metrics\")publicResult&lt;ThreadPoolDashBoardDevBaseMetricsRespDTO&gt;getBasicMetrics(@PathVariableString threadPoolId){returnResults.success(dynamicThreadPoolService.getBasicMetrics(threadPoolId));}\n\u200b\n &nbsp; &nbsp;\/**\n &nbsp; &nbsp; * \u83b7\u53d6\u7ebf\u7a0b\u6c60\u7684\u5b8c\u6574\u8fd0\u884c\u65f6\u72b6\u6001\n &nbsp; &nbsp; *\/@GetMapping(\"\/dynamic\/thread-pool\/{threadPoolId}\")publicResult&lt;ThreadPoolDashBoardDevRespDTO&gt;getRuntimeInfo(@PathVariableString threadPoolId){returnResults.success(dynamicThreadPoolService.getRuntimeInfo(threadPoolId));}}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5\">5. \u7ebf\u7a0b\u6c60\u7ba1\u7406\u548c\u5b9e\u4f8b\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/h3>\n\n\n\n<p>\u5728 <strong>\u7ebf\u7a0b\u6c60\u7ba1\u7406<\/strong> \u4e2d\uff0c\u5206\u4e3a <strong>\u7ebf\u7a0b\u6c60\u5217\u8868<\/strong> \u548c <strong>\u7ebf\u7a0b\u6c60\u5b9e\u4f8b<\/strong> \u4e24\u4e2a\u7ef4\u5ea6\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7ebf\u7a0b\u6c60\u5217\u8868<\/strong> \u201c\u4ee3\u8868\u5f53\u524d\u7684\u9759\u6001\u7ebf\u7a0b\u6c60\u914d\u7f6e\uff0c\u914d\u7f6e\u53d8\u66f4\u4f1a\u4f5c\u7528\u4e8e <strong>\u6240\u6709\u5e94\u7528\u5b9e\u4f8b<\/strong> \u3002\u53ef\u4ee5\u7406\u89e3\u4e3a\u5168\u5c40\u7684\u7ebf\u7a0b\u6c60\u914d\u7f6e\u7ba1\u7406\u3002<\/li>\n\n\n\n<li><strong>\u7ebf\u7a0b\u6c60\u5b9e\u4f8b<\/strong> \uff1a\u5c55\u793a\u4e86\u67d0\u4e2a\u7ebf\u7a0b\u6c60\u5728\u4e0d\u540c\u5e94\u7528\u5b9e\u4f8b\u4e0a\u7684\u8fd0\u884c\u60c5\u51b5\u3002\u652f\u6301\u67e5\u770b\u6bcf\u4e2a\u5b9e\u4f8b\u7684\u8be6\u7ec6\u8fd0\u884c\u53c2\u6570\uff0c\u5e76\u4e14\u53ef\u4ee5\u9488\u5bf9\u5355\u4e2a\u5b9e\u4f8b\u8fdb\u884c\u53c2\u6570\u8c03\u6574\u3002<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>\u5355\u5b9e\u4f8b\u53d8\u66f4\u573a\u666f<\/strong> \uff1a\u901a\u5e38\u7528\u4e8e\u96c6\u7fa4\u6574\u4f53\u7ebf\u7a0b\u6c60\u914d\u7f6e\u6ca1\u6709\u95ee\u9898\uff0c\u4f46\u67d0\u4e2a\u5b9e\u4f8b\u51fa\u73b0\u4e86\u7279\u6b8a\u60c5\u51b5\uff08\u5982\u9047\u5230\u6d41\u91cf\u6fc0\u589e\uff09\u3002\u6b64\u65f6\u65e0\u9700\u4fee\u6539\u5168\u5c40\u914d\u7f6e\uff0c\u53ea\u9700\u6269\u5bb9\u6216\u8c03\u6574\u8be5\u5b9e\u4f8b\u7684\u7ebf\u7a0b\u6c60\u53c2\u6570\u5373\u53ef\u3002<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th class=\"has-text-align-left\" data-align=\"left\">\u7ef4\u5ea6<\/th><th class=\"has-text-align-left\" data-align=\"left\">\u7ebf\u7a0b\u6c60\u5217\u8868<\/th><th class=\"has-text-align-left\" data-align=\"left\">\u7ebf\u7a0b\u6c60\u5b9e\u4f8b<\/th><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>\u5b9a\u4e49<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">\u9759\u6001\u7684\u7ebf\u7a0b\u6c60\u914d\u7f6e\u6e05\u5355<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u67d0\u4e2a\u7ebf\u7a0b\u6c60\u5728\u5177\u4f53\u5e94\u7528\u5b9e\u4f8b\u4e0a\u7684\u8fd0\u884c\u60c5\u51b5<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>\u4f5c\u7528\u8303\u56f4<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">\u53d8\u66f4\u4f5c\u7528\u4e8e <strong>\u6240\u6709\u5e94\u7528\u5b9e\u4f8b<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">\u53ef\u4ee5\u9488\u5bf9 <strong>\u5355\u4e2a\u5b9e\u4f8b<\/strong> \u8c03\u6574\u53c2\u6570<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>\u7528\u9014<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">\u5168\u5c40\u7edf\u4e00\u7684\u7ebf\u7a0b\u6c60\u914d\u7f6e\u7ba1\u7406<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u9488\u5bf9\u5355\u5b9e\u4f8b\u7684\u8fd0\u884c\u72b6\u6001\u76d1\u63a7\u4e0e\u8c03\u6574<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>\u53ef\u67e5\u770b\u5185\u5bb9<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">\u914d\u7f6e\u9879\uff08\u6838\u5fc3\u7ebf\u7a0b\u6570\u3001\u6700\u5927\u7ebf\u7a0b\u6570\u3001\u961f\u5217\u5927\u5c0f\u7b49\uff09<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u6bcf\u4e2a\u5b9e\u4f8b\u7684\u5b9e\u65f6\u8fd0\u884c\u6307\u6807\u4e0e\u914d\u7f6e\u8be6\u60c5<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>\u5178\u578b\u573a\u666f<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">\u7edf\u4e00\u914d\u7f6e\u3001\u6279\u91cf\u4fee\u6539<\/td><td class=\"has-text-align-left\" data-align=\"left\">\u67d0\u4e2a\u5b9e\u4f8b\u5f02\u5e38\uff0c\u9700\u8981\u6269\u5bb9\u6216\u5355\u72ec\u8c03\u6574\u53c2\u6570<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u6587\u672b\u603b\u7ed3<\/h2>\n\n\n\n<p>oneThread \u52a8\u6001\u7ebf\u7a0b\u6c60\u6846\u67b6\u7684 DashBoard-Dev \u670d\u52a1\uff0c\u901a\u8fc7\u5de7\u5999\u7684\u67b6\u6784\u8bbe\u8ba1\uff0c\u6210\u529f\u5730\u5e73\u8861\u4e86\u7cfb\u7edf\u590d\u6742\u5ea6\u4e0e\u529f\u80fd\u5b8c\u6574\u6027\u3002\u5b83\u65e2\u4fdd\u6301\u4e86\u57fa\u4e8e\u914d\u7f6e\u4e2d\u5fc3\u67b6\u6784\u7684\u8f7b\u91cf\u7279\u6027\uff0c\u53c8\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u53ef\u89c6\u5316\u7ba1\u7406\u80fd\u529b\uff0c\u4e3a\u7ebf\u7a0b\u6c60\u6cbb\u7406\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n\n\n\n<p><strong>\u6838\u5fc3\u8bbe\u8ba1\u4eae\u70b9\u603b\u7ed3<\/strong> \uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>1.<strong>\u67b6\u6784\u521b\u65b0<\/strong> \uff1a\u91c7\u7528\u914d\u7f6e\u4e2d\u5fc3 + \u53ef\u89c6\u5316\u4ee3\u7406\u7684\u6df7\u5408\u6a21\u5f0f\uff0c\u517c\u987e\u8f7b\u91cf\u4e0e\u529f\u80fd\u6027\u3002<\/li>\n\n\n\n<li>2.<strong>\u5b9e\u73b0\u7cbe\u5de7<\/strong> \uff1a\u901a\u8fc7 Nacos HTTP API \u4ee3\u7406\uff0c\u5b9e\u73b0\u4e86\u65e0\u4fb5\u5165\u7684\u914d\u7f6e\u7ba1\u7406\u3002<\/li>\n\n\n\n<li>3.<strong>\u6027\u80fd\u4f18\u5316<\/strong> \uff1a\u5927\u91cf\u4f7f\u7528\u5e76\u884c\u5904\u7406\u548c\u5f02\u6b65\u7f16\u7a0b\uff0c\u63d0\u5347\u4e86\u6570\u636e\u83b7\u53d6\u548c\u5904\u7406\u6548\u7387\u3002<\/li>\n\n\n\n<li>4.<strong>\u6269\u5c55\u53cb\u597d<\/strong> \uff1a\u9884\u7559\u4e86\u591a\u4e2a\u6269\u5c55\u70b9\uff0c\u652f\u6301\u591a\u914d\u7f6e\u4e2d\u5fc3\u548c\u81ea\u5b9a\u4e49\u76d1\u63a7\u6307\u6807\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u8fd9\u79cd\u8bbe\u8ba1\u601d\u8def\u5bf9\u4e8e\u5176\u4ed6\u4e2d\u95f4\u4ef6\u7684\u53ef\u89c6\u5316\u7ba1\u7406\u4e5f\u5177\u6709\u5f88\u597d\u7684\u501f\u9274\u610f\u4e49\uff0c\u7279\u522b\u662f\u5728\u5982\u4f55\u5e73\u8861\u67b6\u6784\u590d\u6742\u5ea6\u4e0e\u529f\u80fd\u5b8c\u6574\u6027\u65b9\u9762\uff0c\u7b97\u662f\u4e3a\u5927\u5bb6\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f00\u9614\u6027\u7684\u6848\u4f8b\u5427\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Banner\u5c31\u662f\u63a7\u5236\u53f0\u6253\u5370\u7684\u4e1c\u897f\uff0c\u6bd4\u5982\u8bf4springboot \u6bd4\u5982\u8bf4claude code\uff0c\u53ef\u60dc\u73b0\u5728\u53d8\u6210\u8fd9\u6837\u4e86 oneThread &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1817","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/eve2333.top\/index.php?rest_route=\/wp\/v2\/posts\/1817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eve2333.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eve2333.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eve2333.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eve2333.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1817"}],"version-history":[{"count":10,"href":"https:\/\/eve2333.top\/index.php?rest_route=\/wp\/v2\/posts\/1817\/revisions"}],"predecessor-version":[{"id":1835,"href":"https:\/\/eve2333.top\/index.php?rest_route=\/wp\/v2\/posts\/1817\/revisions\/1835"}],"wp:attachment":[{"href":"https:\/\/eve2333.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eve2333.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eve2333.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}