{"id":5761,"date":"2024-08-01T22:47:35","date_gmt":"2024-08-01T14:47:35","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=5761"},"modified":"2024-08-01T22:47:35","modified_gmt":"2024-08-01T14:47:35","slug":"%e4%bd%bf%e7%94%a8-spring-boot-%e4%b8%8e%e5%ae%9e%e6%97%b6%e8%af%ad%e9%9f%b3%e7%bf%bb%e8%af%91%e7%b3%bb%e7%bb%9f%e7%9a%84%e9%9b%86%e6%88%90","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/%e4%bd%bf%e7%94%a8-spring-boot-%e4%b8%8e%e5%ae%9e%e6%97%b6%e8%af%ad%e9%9f%b3%e7%bf%bb%e8%af%91%e7%b3%bb%e7%bb%9f%e7%9a%84%e9%9b%86%e6%88%90\/","title":{"rendered":"\u4f7f\u7528 Spring Boot \u4e0e\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u7684\u96c6\u6210"},"content":{"rendered":"<div class='wxsyncmain'>\n<p style=\"margin-bottom: 0px;text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg lazyload\" data-cropselx1=\"0\" data-cropselx2=\"578\" data-cropsely1=\"0\" data-cropsely2=\"330\" data-imgfileid=\"100012521\" data-ratio=\"0.5712962962962963\" data-s=\"300,640\"  data-type=\"png\" data-w=\"1080\" style=\"height: 330px;width: 578px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222511361.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" data-cropselx1=\"0\" data-cropselx2=\"578\" data-cropsely1=\"0\" data-cropsely2=\"330\" data-imgfileid=\"100012521\" data-ratio=\"0.5712962962962963\" data-s=\"300,640\"  data-type=\"png\" data-w=\"1080\" style=\"height: 330px;width: 578px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222511361.png\"  \/><\/noscript><\/p>\n<section style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;line-height: 2em;\"><span style=\"letter-spacing: 0.578px;font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: var(--articleFontsize);\"><\/span><\/section>\n<section style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;line-height: 2em;\"><span style=\"font-size: 17px;letter-spacing: 0.578px;font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;\">\u672c\u4e13\u9898\u7cfb\u7edf\u8bb2\u89e3\u4e86\u5982\u4f55\u5229\u7528SpringBoot\u96c6\u6210\u97f3\u9891\u8bc6\u522b\u6280\u672f\uff0c\u6db5\u76d6\u4e86\u4ece\u57fa\u7840\u914d\u7f6e\u5230\u590d\u6742\u5e94\u7528\u7684\u65b9\u65b9\u9762\u9762\u3002\u901a\u8fc7\u672c\u6587\uff0c\u8bfb\u8005\u53ef\u4ee5\u4e86\u89e3\u5230\u5728\u667a\u80fd\u8bed\u97f3\u586b\u5355\u3001\u667a\u80fd\u8bed\u97f3\u4ea4\u4e92\u3001\u667a\u80fd\u8bed\u97f3\u68c0\u7d22\u7b49\u573a\u666f\u4e2d\uff0c\u97f3\u9891\u8bc6\u522b\u6280\u672f\u5982\u4f55\u6709\u6548\u63d0\u5347\u4eba\u673a\u4ea4\u4e92\u6548\u7387\u3002\u65e0\u8bba\u662f\u672c\u5730\u5b58\u50a8\u68c0\u7d22\uff0c\u8fd8\u662f\u4e91\u670d\u52a1\u7684\u96c6\u6210\uff0c\u4e30\u5bcc\u7684\u5e94\u7528\u5b9e\u4f8b\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u5168\u9762\u7684\u89e3\u51b3\u65b9\u6848\u3002\u7ee7\u7eed\u6df1\u5165\u7814\u7a76\u548c\u5b9e\u8df5\u8fd9\u4e9b\u6280\u672f\uff0c\u5c06\u6709\u52a9\u4e8e\u63a8\u52a8\u667a\u80fd\u5e94\u7528\u7684\u5e7f\u6cdb\u666e\u53ca\u548c\u53d1\u5c55\uff0c\u63d0\u5347\u5404\u7c7b\u4e1a\u52a1\u7684\u667a\u80fd\u5316\u6c34\u5e73\u3002<\/span><\/section>\n<section style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;line-height: 2em;\"><\/section>\n<p data-sourcepos=\"1:1-1:55\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u4f7f\u7528 Spring Boot \u4e0e\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u7684\u96c6\u6210<\/span><\/p>\n<p data-sourcepos=\"3:1-3:427\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u5df2\u7ecf\u6210\u4e3a\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4e00\u9879\u91cd\u8981\u7684\u529f\u80fd\uff0c\u7279\u522b\u662f\u5728\u5168\u7403\u5316\u4e1a\u52a1\u573a\u666f\u4e2d\u3002\u901a\u8fc7Spring Boot\u96c6\u6210\u591a\u8bed\u8a00\u7684\u8bed\u97f3\u8bc6\u522b\u548c\u7ffb\u8bd1\u670d\u52a1\uff0c\u53ef\u4ee5\u6784\u5efa\u4e00\u4e2a\u9ad8\u6548\u7684\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u8bb2\u89e3\u5982\u4f55\u914d\u7f6eSpring Boot\u9879\u76ee\u4ee5\u652f\u6301\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\uff0c\u7ed3\u5408\u4ee3\u7801\u793a\u4f8b\u5bf9\u5b9e\u73b0\u8fc7\u7a0b\u8fdb\u884c\u6df1\u5ea6\u89e3\u8bfb\uff0c\u5e76\u5206\u4eab\u7cfb\u7edf\u5ef6\u8fdf\u4f18\u5316\u7684\u6280\u5de7\u548c\u5b9e\u9645\u5e94\u7528\u6848\u4f8b\u3002<\/span><\/p>\n<h4 data-sourcepos=\"5:1-5:50\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u63cf\u8ff0\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u7684\u57fa\u672c\u9700\u6c42<\/span><\/h4>\n<p data-sourcepos=\"7:1-7:69\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u4e00\u4e2a\u5b8c\u5907\u7684\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u5e94\u6ee1\u8db3\u4ee5\u4e0b\u57fa\u672c\u9700\u6c42\uff1a<\/span><\/p>\n<ol data-sourcepos=\"9:1-13:0\" style=\"padding-left: 2rem;margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\" class=\"list-paddingleft-1\">\n<li style=\"font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u8bed\u97f3\u8bc6\u522b<\/span>\uff1a\u80fd\u591f\u5b9e\u65f6\u8bc6\u522b\u591a\u79cd\u8bed\u8a00\u7684\u8bed\u97f3\u8f93\u5165\u3002<\/span><\/p>\n<\/li>\n<li style=\"margin-top: 0.25rem;font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u8bed\u8a00\u7ffb\u8bd1<\/span>\uff1a\u5c06\u8bc6\u522b\u7ed3\u679c\u7ffb\u8bd1\u6210\u76ee\u6807\u8bed\u8a00\uff0c\u5e76\u5b9e\u73b0\u591a\u8bed\u8a00\u652f\u6301\u3002<\/span><\/p>\n<\/li>\n<li style=\"margin-top: 0.25rem;font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u5b9e\u65f6\u6027<\/span>\uff1a\u786e\u4fdd\u6574\u4e2a\u8bc6\u522b\u548c\u7ffb\u8bd1\u8fc7\u7a0b\u5177\u6709\u8f83\u4f4e\u7684\u5ef6\u8fdf\uff0c\u63d0\u4f9b\u7528\u6237\u6d41\u7545\u7684\u4f53\u9a8c\u3002<\/span><\/p>\n<\/li>\n<li style=\"margin-top: 0.25rem;font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">API\u63a5\u53e3<\/span>\uff1a\u63d0\u4f9bRESTful API\uff0c\u65b9\u4fbf\u5ba2\u6237\u7aef\u8c03\u7528\u3002<\/span><\/p>\n<\/li>\n<\/ol>\n<h4 data-sourcepos=\"14:1-14:67\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u914d\u7f6eSpring Boot\u9879\u76ee\u4e0e\u591a\u8bed\u8a00\u8bed\u97f3\u8bc6\u522b\u548c\u7ffb\u8bd1\u670d\u52a1<\/span><\/h4>\n<p data-sourcepos=\"16:1-16:164\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u6211\u4eec\u5c06\u4f7f\u7528Spring Boot\u6765\u642d\u5efa\u57fa\u7840\u6846\u67b6\uff0c\u5229\u7528\u7b2c\u4e09\u65b9\u670d\u52a1\uff08\u5982Google Cloud Speech-to-Text\u548cTranslate\u670d\u52a1\uff09\u6765\u5b9e\u73b0\u8bed\u97f3\u8bc6\u522b\u548c\u7ffb\u8bd1\u529f\u80fd\u3002<\/span><\/p>\n<p data-sourcepos=\"18:1-18:83\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2aSpring Boot\u9879\u76ee\uff0c\u5e76\u5728<\/span><code style=\"font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace;font-size: 13.6px;padding: 0.2rem 0.4rem;background-color: rgba(27, 31, 35, 0.05);color: rgb(85, 85, 85);border-radius: 0.1875rem;\"><span style=\"font-size: 17px;\">pom.xml<\/span><\/code><span style=\"font-size: 17px;\">\u4e2d\u6dfb\u52a0\u5fc5\u8981\u7684\u4f9d\u8d56\uff1a<\/span><\/p>\n<pre data-sourcepos=\"20:1-35:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>dependency<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>    <span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>groupId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>org.springframework.boot<span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>groupId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>    <span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>artifactId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>spring-boot-starter-web<span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>artifactId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span><span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>dependency<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span><span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>dependency<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>    <span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>groupId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>com.google.cloud<span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>groupId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>    <span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>artifactId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>google-cloud-speech<span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>artifactId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>    <span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>version<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>1.28.0<span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>version<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span><span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>dependency<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span><span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>dependency<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>    <span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>groupId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>com.google.cloud<span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>groupId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>    <span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>artifactId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>google-cloud-translate<span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>artifactId<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>    <span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span>version<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span>1.95.0<span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>version<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span><span style=\"color: rgb(153, 0, 85);\"><span style=\"color: rgb(153, 153, 153);\">&lt;\/<\/span>dependency<span style=\"color: rgb(153, 153, 153);\">&gt;<\/span><\/span><\/span><\/code><\/pre>\n<p data-sourcepos=\"37:1-37:65\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u7136\u540e\uff0c\u5728Spring Boot\u9879\u76ee\u4e2d\u914d\u7f6eGoogle Cloud\u7684\u5ba2\u6237\u7aef\uff1a<\/span><\/p>\n<pre data-sourcepos=\"39:1-59:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">com<span style=\"color: rgb(153, 153, 153);\">.<\/span>google<span style=\"color: rgb(153, 153, 153);\">.<\/span>cloud<span style=\"color: rgb(153, 153, 153);\">.<\/span>speech<span style=\"color: rgb(153, 153, 153);\">.<\/span>v1<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">com<span style=\"color: rgb(153, 153, 153);\">.<\/span>google<span style=\"color: rgb(153, 153, 153);\">.<\/span>cloud<span style=\"color: rgb(153, 153, 153);\">.<\/span>translate<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Translate<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">com<span style=\"color: rgb(153, 153, 153);\">.<\/span>google<span style=\"color: rgb(153, 153, 153);\">.<\/span>cloud<span style=\"color: rgb(153, 153, 153);\">.<\/span>translate<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">TranslateOptions<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>context<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Bean<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>context<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Configuration<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@Configuration<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">GoogleCloudConfig<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(153, 153, 153);\">@Bean<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">SpeechClient<\/span> <span style=\"color: rgb(221, 74, 104);\">speechClient<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span> <span style=\"color: rgb(0, 119, 170);\">throws<\/span> <span style=\"color: rgb(221, 74, 104);\">Exception<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> <span style=\"color: rgb(221, 74, 104);\">SpeechClient<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">create<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Bean<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">Translate<\/span> <span style=\"color: rgb(221, 74, 104);\">translate<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslateOptions<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getDefaultInstance<\/span><span style=\"color: rgb(153, 153, 153);\">().<\/span><span style=\"color: rgb(221, 74, 104);\">getService<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<h4 data-sourcepos=\"61:1-61:40\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5b9e\u73b0\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7684REST API<\/span><\/h4>\n<p data-sourcepos=\"63:1-63:124\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u5b9e\u73b0\u4e00\u4e2aREST\u63a5\u53e3\uff0c\u8be5\u63a5\u53e3\u63a5\u6536\u8bed\u97f3\u6570\u636e\uff0c\u8fdb\u884c\u8bc6\u522b\u548c\u7ffb\u8bd1\uff0c\u5e76\u8fd4\u56de\u7ffb\u8bd1\u7ed3\u679c\u3002<\/span><\/p>\n<pre data-sourcepos=\"65:1-114:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">com<span style=\"color: rgb(153, 153, 153);\">.<\/span>google<span style=\"color: rgb(153, 153, 153);\">.<\/span>cloud<span style=\"color: rgb(153, 153, 153);\">.<\/span>speech<span style=\"color: rgb(153, 153, 153);\">.<\/span>v1<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">com<span style=\"color: rgb(153, 153, 153);\">.<\/span>google<span style=\"color: rgb(153, 153, 153);\">.<\/span>protobuf<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">ByteString<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>beans<span style=\"color: rgb(153, 153, 153);\">.<\/span>factory<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Autowired<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>web<span style=\"color: rgb(153, 153, 153);\">.<\/span>bind<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>web<span style=\"color: rgb(153, 153, 153);\">.<\/span>multipart<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">MultipartFile<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@RestController<\/span><span style=\"color: rgb(153, 153, 153);\">@RequestMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/api\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationController<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">SpeechClient<\/span> speechClient<span style=\"color: rgb(153, 153, 153);\">;<\/span>        <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">Translate<\/span> translate<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">@PostMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/translate\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> <span style=\"color: rgb(221, 74, 104);\">translateSpeech<\/span><span style=\"color: rgb(153, 153, 153);\">(@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"file\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">MultipartFile<\/span> file<span style=\"color: rgb(153, 153, 153);\">,<\/span>                                   <span style=\"color: rgb(153, 153, 153);\">@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"targetLanguage\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(0, 119, 170);\">throws<\/span> <span style=\"color: rgb(221, 74, 104);\">Exception<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: slategray;\">\/\/ \u83b7\u53d6\u97f3\u9891\u6570\u636e<\/span>        <span style=\"color: rgb(221, 74, 104);\">ByteString<\/span> audioBytes <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">ByteString<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">copyFrom<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>file<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getBytes<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>                <span style=\"color: slategray;\">\/\/ \u914d\u7f6e\u8bed\u97f3\u8bc6\u522b\u8bf7\u6c42<\/span>        <span style=\"color: rgb(221, 74, 104);\">RecognitionConfig<\/span> config <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">RecognitionConfig<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">newBuilder<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">setEncoding<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">RecognitionConfig<span style=\"color: rgb(153, 153, 153);\">.<\/span>AudioEncoding<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(153, 0, 85);\">LINEAR16<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">setLanguageCode<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(102, 153, 0);\">\"zh-CN\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: slategray;\">\/\/ \u4fee\u6539\u4e3a\u4e2d\u6587\u914d\u7f6e<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">build<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(221, 74, 104);\">RecognitionAudio<\/span> audio <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">RecognitionAudio<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">newBuilder<\/span><span style=\"color: rgb(153, 153, 153);\">().<\/span><span style=\"color: rgb(221, 74, 104);\">setContent<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">).<\/span><span style=\"color: rgb(221, 74, 104);\">build<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>                <span style=\"color: slategray;\">\/\/ \u8c03\u7528Google Speech API\u8fdb\u884c\u8bed\u97f3\u8bc6\u522b<\/span>        <span style=\"color: rgb(221, 74, 104);\">RecognizeResponse<\/span> response <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> speechClient<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">recognize<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>config<span style=\"color: rgb(153, 153, 153);\">,<\/span> audio<span style=\"color: rgb(153, 153, 153);\">);<\/span>        <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">SpeechRecognitionResult<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> results <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> response<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getResultsList<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>                <span style=\"color: slategray;\">\/\/ \u83b7\u53d6\u8bc6\u522b\u7ed3\u679c<\/span>        <span style=\"color: rgb(221, 74, 104);\">StringBuilder<\/span> recognizedText <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(0, 119, 170);\">new<\/span> <span style=\"color: rgb(221, 74, 104);\">StringBuilder<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(0, 119, 170);\">for<\/span> <span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">SpeechRecognitionResult<\/span> result <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">:<\/span> results<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>            recognizedText<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">append<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>result<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getAlternativesList<\/span><span style=\"color: rgb(153, 153, 153);\">().<\/span><span style=\"color: rgb(221, 74, 104);\">get<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(153, 0, 85);\">0<\/span><span style=\"color: rgb(153, 153, 153);\">).<\/span><span style=\"color: rgb(221, 74, 104);\">getTranscript<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>        <span style=\"color: rgb(153, 153, 153);\">}<\/span>                <span style=\"color: slategray;\">\/\/ \u8c03\u7528Google Translate API\u8fdb\u884c\u7ffb\u8bd1<\/span>        <span style=\"color: rgb(221, 74, 104);\">String<\/span> translatedText <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> translate<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">translate<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>recognizedText<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toString<\/span><span style=\"color: rgb(153, 153, 153);\">(),<\/span>                <span style=\"color: rgb(221, 74, 104);\">Translate<span style=\"color: rgb(153, 153, 153);\">.<\/span>TranslateOption<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">targetLanguage<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>targetLanguage<span style=\"color: rgb(153, 153, 153);\">)).<\/span><span style=\"color: rgb(221, 74, 104);\">getTranslatedText<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>                <span style=\"color: rgb(0, 119, 170);\">return<\/span> translatedText<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<p data-sourcepos=\"116:1-116:196\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u4e0a\u8ff0\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u4e2a<\/span><code style=\"font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace;font-size: 13.6px;padding: 0.2rem 0.4rem;background-color: rgba(27, 31, 35, 0.05);color: rgb(85, 85, 85);border-radius: 0.1875rem;\"><span style=\"font-size: 17px;\">\/translate<\/span><\/code><span style=\"font-size: 17px;\">\u7684REST\u63a5\u53e3\uff0c\u5b83\u63a5\u53d7\u4e24\u4e2a\u53c2\u6570\uff1a\u8bed\u97f3\u6587\u4ef6\u548c\u76ee\u6807\u7ffb\u8bd1\u8bed\u8a00\u3002\u901a\u8fc7\u8c03\u7528Google Cloud\u670d\u52a1\u5b9e\u73b0\u8bed\u97f3\u8bc6\u522b\u548c\u7ffb\u8bd1\uff0c\u8fd4\u56de\u7ffb\u8bd1\u7ed3\u679c\u3002<\/span><\/p>\n<h4 data-sourcepos=\"118:1-118:50\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5206\u4eab\u7cfb\u7edf\u5ef6\u8fdf\u4f18\u5316\u548c\u5b9e\u9645\u5e94\u7528\u6848\u4f8b<\/span><\/h4>\n<p data-sourcepos=\"120:1-120:180\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4f18\u5316\u7cfb\u7edf\u7684\u5ef6\u8fdf\u662f\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u7684\u5173\u952e\u3002\u5728\u6b64\u90e8\u5206\uff0c\u6211\u4eec\u5c06\u7ed3\u5408\u4ee3\u7801\u793a\u4f8b\uff0c\u6df1\u5165\u8bb2\u89e3\u5982\u4f55\u4f18\u5316\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u7684\u5ef6\u8fdf\u3002<\/span><\/p>\n<h5 data-sourcepos=\"122:1-122:27\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;font-size: 0.875rem;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">1. \u51cf\u5c11\u7f51\u7edc\u5ef6\u8fdf<\/span><\/h5>\n<p data-sourcepos=\"124:1-124:54\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u4e3a\u4e86\u51cf\u5c11\u7f51\u7edc\u5ef6\u8fdf\uff0c\u53ef\u4ee5\u8003\u8651\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/span><\/p>\n<ul data-sourcepos=\"126:1-128:0\" style=\"padding-left: 2rem;margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\" class=\"list-paddingleft-1\">\n<li style=\"font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u5730\u7406\u4f4d\u7f6e\u4f18\u5316<\/span>\uff1a\u5c06\u670d\u52a1\u90e8\u7f72\u5728\u8ddd\u79bb\u7528\u6237\u548cGoogle Cloud\u6570\u636e\u4e2d\u5fc3\u66f4\u8fd1\u7684\u533a\u57df\u3002<\/span><\/p>\n<\/li>\n<li style=\"margin-top: 0.25rem;font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u5185\u5bb9\u5206\u53d1\u7f51\u7edc\uff08CDN\uff09<\/span>\uff1a\u4f7f\u7528CDN\u52a0\u901f\u8bbf\u95ee\u901f\u5ea6\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<h5 data-sourcepos=\"129:1-129:21\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;font-size: 0.875rem;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">2. \u5f02\u6b65\u5904\u7406<\/span><\/h5>\n<p data-sourcepos=\"131:1-131:119\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u901a\u8fc7\u5f02\u6b65\u5904\u7406\u53ef\u4ee5\u663e\u8457\u964d\u4f4e\u54cd\u5e94\u65f6\u95f4\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Spring\u7684\u5f02\u6b65\u6ce8\u89e3<\/span><code style=\"font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace;font-size: 13.6px;padding: 0.2rem 0.4rem;background-color: rgba(27, 31, 35, 0.05);color: rgb(85, 85, 85);border-radius: 0.1875rem;\"><span style=\"font-size: 17px;\">@Async<\/span><\/code><span style=\"font-size: 17px;\">\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002<\/span><\/p>\n<pre data-sourcepos=\"133:1-170:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>scheduling<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Async<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>scheduling<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">EnableAsync<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>stereotype<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Service<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@EnableAsync<\/span><span style=\"color: rgb(153, 153, 153);\">@Service<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationService<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">SpeechClient<\/span> speechClient<span style=\"color: rgb(153, 153, 153);\">;<\/span>        <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">Translate<\/span> translate<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Async<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">translateSpeechAsync<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">ByteString<\/span> audioBytes<span style=\"color: rgb(153, 153, 153);\">,<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(0, 119, 170);\">throws<\/span> <span style=\"color: rgb(221, 74, 104);\">Exception<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(221, 74, 104);\">RecognitionConfig<\/span> config <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">RecognitionConfig<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">newBuilder<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">setEncoding<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">RecognitionConfig<span style=\"color: rgb(153, 153, 153);\">.<\/span>AudioEncoding<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(153, 0, 85);\">LINEAR16<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">setLanguageCode<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(102, 153, 0);\">\"zh-CN\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: slategray;\">\/\/ \u4fee\u6539\u4e3a\u4e2d\u6587\u914d\u7f6e<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">build<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(221, 74, 104);\">RecognitionAudio<\/span> audio <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">RecognitionAudio<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">newBuilder<\/span><span style=\"color: rgb(153, 153, 153);\">().<\/span><span style=\"color: rgb(221, 74, 104);\">setContent<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">).<\/span><span style=\"color: rgb(221, 74, 104);\">build<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(221, 74, 104);\">RecognizeResponse<\/span> response <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> speechClient<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">recognize<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>config<span style=\"color: rgb(153, 153, 153);\">,<\/span> audio<span style=\"color: rgb(153, 153, 153);\">);<\/span>        <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">SpeechRecognitionResult<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> results <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> response<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getResultsList<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(221, 74, 104);\">StringBuilder<\/span> recognizedText <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(0, 119, 170);\">new<\/span> <span style=\"color: rgb(221, 74, 104);\">StringBuilder<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(0, 119, 170);\">for<\/span> <span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">SpeechRecognitionResult<\/span> result <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">:<\/span> results<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>            recognizedText<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">append<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>result<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getAlternativesList<\/span><span style=\"color: rgb(153, 153, 153);\">().<\/span><span style=\"color: rgb(221, 74, 104);\">get<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(153, 0, 85);\">0<\/span><span style=\"color: rgb(153, 153, 153);\">).<\/span><span style=\"color: rgb(221, 74, 104);\">getTranscript<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>        <span style=\"color: rgb(153, 153, 153);\">}<\/span>        <span style=\"color: rgb(221, 74, 104);\">String<\/span> translatedText <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> translate<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">translate<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>recognizedText<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toString<\/span><span style=\"color: rgb(153, 153, 153);\">(),<\/span>                <span style=\"color: rgb(221, 74, 104);\">Translate<span style=\"color: rgb(153, 153, 153);\">.<\/span>TranslateOption<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">targetLanguage<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>targetLanguage<span style=\"color: rgb(153, 153, 153);\">)).<\/span><span style=\"color: rgb(221, 74, 104);\">getTranslatedText<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">completedFuture<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>translatedText<span style=\"color: rgb(153, 153, 153);\">);<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<p data-sourcepos=\"172:1-172:37\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5728Controller\u4e2d\u8c03\u7528\u5f02\u6b65\u65b9\u6cd5\uff1a<\/span><\/p>\n<pre data-sourcepos=\"174:1-195:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>beans<span style=\"color: rgb(153, 153, 153);\">.<\/span>factory<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Autowired<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>web<span style=\"color: rgb(153, 153, 153);\">.<\/span>bind<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>web<span style=\"color: rgb(153, 153, 153);\">.<\/span>multipart<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">MultipartFile<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span>concurrent<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@RestController<\/span><span style=\"color: rgb(153, 153, 153);\">@RequestMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/api\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationController<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationService<\/span> translationService<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">@PostMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/translate\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">translateSpeech<\/span><span style=\"color: rgb(153, 153, 153);\">(@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"file\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">MultipartFile<\/span> file<span style=\"color: rgb(153, 153, 153);\">,<\/span>                                                       <span style=\"color: rgb(153, 153, 153);\">@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"targetLanguage\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(0, 119, 170);\">throws<\/span> <span style=\"color: rgb(221, 74, 104);\">Exception<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(221, 74, 104);\">ByteString<\/span> audioBytes <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">ByteString<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">copyFrom<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>file<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getBytes<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> translationService<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">translateSpeechAsync<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">,<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">);<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<h5 data-sourcepos=\"197:1-197:27\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;font-size: 0.875rem;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">3. \u97f3\u9891\u5207\u7247\u5904\u7406<\/span><\/h5>\n<p data-sourcepos=\"199:1-199:105\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5bf9\u4e8e\u8f83\u957f\u7684\u97f3\u9891\u6587\u4ef6\uff0c\u53ef\u4ee5\u5c06\u5176\u5207\u7247\u6210\u66f4\u5c0f\u7684\u90e8\u5206\u5e76\u884c\u5904\u7406\uff0c\u4ee5\u51cf\u5c11\u5904\u7406\u65f6\u95f4\u3002<\/span><\/p>\n<pre data-sourcepos=\"201:1-240:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Arrays<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span>concurrent<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span>stream<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@Service<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">AudioProcessingService<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationService<\/span> translationService<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(0, 119, 170);\">static<\/span> <span style=\"color: rgb(0, 119, 170);\">final<\/span> <span style=\"color: rgb(0, 119, 170);\">int<\/span> <span style=\"color: rgb(153, 0, 85);\">SLICE_SIZE<\/span> <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(153, 0, 85);\">60<\/span> <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span> <span style=\"color: rgb(153, 0, 85);\">1000<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span> <span style=\"color: slategray;\">\/\/ \u6bcf\u7247 60 \u79d2<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Async<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">processAndTranslateAudio<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span> audioBytes<span style=\"color: rgb(153, 153, 153);\">,<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(0, 119, 170);\">throws<\/span> <span style=\"color: rgb(221, 74, 104);\">Exception<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">&lt;<\/span><span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">&gt;<\/span> audioSlices <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">sliceAudio<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">);<\/span>        <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;&gt;<\/span> futures <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> audioSlices<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">stream<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">map<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>slice <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> translationService<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">translateSpeechAsync<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">ByteString<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">copyFrom<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>slice<span style=\"color: rgb(153, 153, 153);\">),<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">))<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">collect<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toList<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>        <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">Void<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> allOf <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">allOf<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>futures<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toArray<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">new<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">[<\/span><span style=\"color: rgb(153, 0, 85);\">0<\/span><span style=\"color: rgb(153, 153, 153);\">]));<\/span>        <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;&gt;<\/span> allTranslations <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> allOf<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">thenApply<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>v <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> futures<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">stream<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">map<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">::<\/span><span style=\"color: rgb(221, 74, 104);\">join<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">collect<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toList<\/span><span style=\"color: rgb(153, 153, 153);\">()));<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> allTranslations<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">thenApply<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>translations <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">join<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(102, 153, 0);\">\" \"<\/span><span style=\"color: rgb(153, 153, 153);\">,<\/span> translations<span style=\"color: rgb(153, 153, 153);\">));<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">&lt;<\/span><span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">sliceAudio<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span> audioBytes<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(0, 119, 170);\">int<\/span> totalLength <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> audioBytes<span style=\"color: rgb(153, 153, 153);\">.<\/span>length<span style=\"color: rgb(153, 153, 153);\">;<\/span>        <span style=\"color: rgb(0, 119, 170);\">int<\/span> numberOfSlices <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">int<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">Math<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">ceil<\/span><span style=\"color: rgb(153, 153, 153);\">((<\/span><span style=\"color: rgb(0, 119, 170);\">double<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> totalLength <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">\/<\/span> <span style=\"color: rgb(153, 0, 85);\">SLICE_SIZE<\/span><span style=\"color: rgb(153, 153, 153);\">);<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> <span style=\"color: rgb(221, 74, 104);\">Arrays<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">stream<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">new<\/span> <span style=\"color: rgb(0, 119, 170);\">int<\/span><span style=\"color: rgb(153, 153, 153);\">[<\/span>numberOfSlices<span style=\"color: rgb(153, 153, 153);\">])<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">mapToObj<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>i <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">Arrays<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">copyOfRange<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">,<\/span> i <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span> <span style=\"color: rgb(153, 0, 85);\">SLICE_SIZE<\/span><span style=\"color: rgb(153, 153, 153);\">,<\/span> <span style=\"color: rgb(221, 74, 104);\">Math<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">min<\/span><span style=\"color: rgb(153, 153, 153);\">((<\/span>i <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">+<\/span> <span style=\"color: rgb(153, 0, 85);\">1<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span> <span style=\"color: rgb(153, 0, 85);\">SLICE_SIZE<\/span><span style=\"color: rgb(153, 153, 153);\">,<\/span> totalLength<span style=\"color: rgb(153, 153, 153);\">)))<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">collect<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toList<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<p data-sourcepos=\"242:1-242:43\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5728Controller\u4e2d\u4f7f\u7528\u97f3\u9891\u5904\u7406\u670d\u52a1\uff1a<\/span><\/p>\n<pre data-sourcepos=\"244:1-259:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(153, 153, 153);\">@RestController<\/span><span style=\"color: rgb(153, 153, 153);\">@RequestMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/api\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationController<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">AudioProcessingService<\/span> audioProcessingService<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">@PostMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/translate\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">translateSpeech<\/span><span style=\"color: rgb(153, 153, 153);\">(@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"file\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">MultipartFile<\/span> file<span style=\"color: rgb(153, 153, 153);\">,<\/span>                                                       <span style=\"color: rgb(153, 153, 153);\">@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"targetLanguage\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(0, 119, 170);\">throws<\/span> <span style=\"color: rgb(221, 74, 104);\">Exception<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span> audioBytes <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> file<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getBytes<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> audioProcessingService<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">processAndTranslateAudio<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">,<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">);<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<h3 data-sourcepos=\"261:1-261:37\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;font-size: 1.25rem;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5b9e\u9645\u5e94\u7528\u6848\u4f8b\u4e0e\u6df1\u5165\u4f18\u5316<\/span><\/h3>\n<h4 data-sourcepos=\"263:1-263:45\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u6848\u4f8b1\uff1a\u56fd\u9645\u4f1a\u8bae\u5b9e\u65f6\u7ffb\u8bd1\u7cfb\u7edf<\/span><\/h4>\n<p data-sourcepos=\"265:1-265:225\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5728\u56fd\u9645\u4f1a\u8bae\u4e2d\uff0c\u5b9e\u65f6\u7ffb\u8bd1\u7cfb\u7edf\u53ef\u4ee5\u4e3a\u4e0e\u4f1a\u8005\u63d0\u4f9b\u591a\u8bed\u8a00\u7684\u5b9e\u65f6\u5b57\u5e55\uff0c\u5e2e\u52a9\u4ed6\u4eec\u66f4\u597d\u5730\u7406\u89e3\u6f14\u8bb2\u5185\u5bb9\u3002\u4e3a\u4e86\u786e\u4fdd\u7cfb\u7edf\u80fd\u591f\u9ad8\u6548\u3001\u4f4e\u5ef6\u8fdf\u5730\u5de5\u4f5c\uff0c\u6211\u4eec\u53ef\u4ee5\u5e94\u7528\u4ee5\u4e0b\u4f18\u5316\u6280\u672f\uff1a<\/span><\/p>\n<ul data-sourcepos=\"267:1-269:0\" style=\"padding-left: 2rem;margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\" class=\"list-paddingleft-1\">\n<li style=\"font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u97f3\u9891\u5207\u7247\u5904\u7406<\/span>\uff1a\u5bf9\u957f\u65f6\u95f4\u7684\u6f14\u8bb2\u97f3\u9891\u8fdb\u884c\u5e76\u884c\u5904\u7406\u3002\u901a\u8fc7\u97f3\u9891\u5207\u7247\u3001\u5e76\u884c\u8bc6\u522b\u548c\u7ffb\u8bd1\uff0c\u7f29\u77ed\u5355\u6b21\u8bf7\u6c42\u7684\u5904\u7406\u65f6\u95f4\u3002<\/span><\/p>\n<\/li>\n<li style=\"margin-top: 0.25rem;font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u5f02\u6b65\u5904\u7406<\/span>\uff1a\u4f7f\u7528Spring\u7684\u5f02\u6b65\u5904\u7406\u673a\u5236\uff0c\u51cf\u5c11\u524d\u7aef\u7b49\u5f85\u65f6\u95f4\uff0c\u5b9e\u73b0\u4f4e\u5ef6\u8fdf\u54cd\u5e94\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<p data-sourcepos=\"270:1-270:57\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u4ee5\u4e0b\u4e3a\u56fd\u9645\u4f1a\u8bae\u5b9e\u65f6\u7ffb\u8bd1\u7cfb\u7edf\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/span><\/p>\n<p data-sourcepos=\"272:1-272:37\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);font-size: 17px;\">\u97f3\u9891\u5207\u7247\u5904\u7406\u4e0e\u5f02\u6b65\u5904\u7406<\/span><\/p>\n<pre data-sourcepos=\"274:1-316:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Arrays<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span>concurrent<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span>stream<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@Service<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">AudioProcessingService<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationService<\/span> translationService<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(0, 119, 170);\">static<\/span> <span style=\"color: rgb(0, 119, 170);\">final<\/span> <span style=\"color: rgb(0, 119, 170);\">int<\/span> <span style=\"color: rgb(153, 0, 85);\">SLICE_SIZE<\/span> <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(153, 0, 85);\">60<\/span> <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span> <span style=\"color: rgb(153, 0, 85);\">1000<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span> <span style=\"color: slategray;\">\/\/ \u6bcf\u7247 60 \u79d2<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Async<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">processAndTranslateAudio<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span> audioBytes<span style=\"color: rgb(153, 153, 153);\">,<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(0, 119, 170);\">throws<\/span> <span style=\"color: rgb(221, 74, 104);\">Exception<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: slategray;\">\/\/ \u5c06\u97f3\u9891\u6570\u636e\u5207\u7247\u5904\u7406<\/span>        <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">&lt;<\/span><span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">&gt;<\/span> audioSlices <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">sliceAudio<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">);<\/span>        <span style=\"color: slategray;\">\/\/ \u5e76\u884c\u7ffb\u8bd1\u6bcf\u4e00\u7247\u97f3\u9891\u6570\u636e<\/span>        <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;&gt;<\/span> futures <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> audioSlices<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">stream<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">map<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>slice <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> translationService<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">translateSpeechAsync<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">ByteString<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">copyFrom<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>slice<span style=\"color: rgb(153, 153, 153);\">),<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">))<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">collect<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toList<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>        <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">Void<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> allOf <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">allOf<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>futures<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toArray<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">new<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">[<\/span><span style=\"color: rgb(153, 0, 85);\">0<\/span><span style=\"color: rgb(153, 153, 153);\">]));<\/span>        <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;&gt;<\/span> allTranslations <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> allOf<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">thenApply<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>v <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> futures<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">stream<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">map<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">::<\/span><span style=\"color: rgb(221, 74, 104);\">join<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">collect<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toList<\/span><span style=\"color: rgb(153, 153, 153);\">()));<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> allTranslations<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">thenApply<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>translations <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">join<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(102, 153, 0);\">\" \"<\/span><span style=\"color: rgb(153, 153, 153);\">,<\/span> translations<span style=\"color: rgb(153, 153, 153);\">));<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span>    <span style=\"color: slategray;\">\/\/ \u97f3\u9891\u5207\u7247\u5904\u7406\u65b9\u6cd5<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">&lt;<\/span><span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">sliceAudio<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span> audioBytes<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(0, 119, 170);\">int<\/span> totalLength <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> audioBytes<span style=\"color: rgb(153, 153, 153);\">.<\/span>length<span style=\"color: rgb(153, 153, 153);\">;<\/span>        <span style=\"color: rgb(0, 119, 170);\">int<\/span> numberOfSlices <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">int<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">Math<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">ceil<\/span><span style=\"color: rgb(153, 153, 153);\">((<\/span><span style=\"color: rgb(0, 119, 170);\">double<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> totalLength <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">\/<\/span> <span style=\"color: rgb(153, 0, 85);\">SLICE_SIZE<\/span><span style=\"color: rgb(153, 153, 153);\">);<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> <span style=\"color: rgb(221, 74, 104);\">Arrays<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">stream<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">new<\/span> <span style=\"color: rgb(0, 119, 170);\">int<\/span><span style=\"color: rgb(153, 153, 153);\">[<\/span>numberOfSlices<span style=\"color: rgb(153, 153, 153);\">])<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">mapToObj<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>i <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">Arrays<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">copyOfRange<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">,<\/span> i <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span> <span style=\"color: rgb(153, 0, 85);\">SLICE_SIZE<\/span><span style=\"color: rgb(153, 153, 153);\">,<\/span> <span style=\"color: rgb(221, 74, 104);\">Math<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">min<\/span><span style=\"color: rgb(153, 153, 153);\">((<\/span>i <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">+<\/span> <span style=\"color: rgb(153, 0, 85);\">1<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span> <span style=\"color: rgb(153, 0, 85);\">SLICE_SIZE<\/span><span style=\"color: rgb(153, 153, 153);\">,<\/span> totalLength<span style=\"color: rgb(153, 153, 153);\">)))<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">collect<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toList<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<p data-sourcepos=\"318:1-318:28\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);font-size: 17px;\">\u8c03\u7528\u97f3\u9891\u5904\u7406\u670d\u52a1<\/span><\/p>\n<pre data-sourcepos=\"320:1-335:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(153, 153, 153);\">@RestController<\/span><span style=\"color: rgb(153, 153, 153);\">@RequestMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/api\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationController<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">AudioProcessingService<\/span> audioProcessingService<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">@PostMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/translate\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">translateSpeech<\/span><span style=\"color: rgb(153, 153, 153);\">(@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"file\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">MultipartFile<\/span> file<span style=\"color: rgb(153, 153, 153);\">,<\/span>                                                       <span style=\"color: rgb(153, 153, 153);\">@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"targetLanguage\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(0, 119, 170);\">throws<\/span> <span style=\"color: rgb(221, 74, 104);\">Exception<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(0, 119, 170);\">byte<\/span><span style=\"color: rgb(153, 153, 153);\">[]<\/span> audioBytes <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> file<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">getBytes<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> audioProcessingService<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">processAndTranslateAudio<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>audioBytes<span style=\"color: rgb(153, 153, 153);\">,<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">);<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<h4 data-sourcepos=\"337:1-337:36\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u6848\u4f8b2\uff1a\u591a\u8bed\u8a00\u5ba2\u670d\u7cfb\u7edf<\/span><\/h4>\n<p data-sourcepos=\"339:1-339:192\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u5728\u5168\u7403\u8de8\u56fd\u4f01\u4e1a\u4e2d\uff0c\u591a\u8bed\u8a00\u5ba2\u670d\u7cfb\u7edf\u80fd\u591f\u5b9e\u65f6\u7ffb\u8bd1\u5ba2\u6237\u548c\u5ba2\u670d\u4e4b\u95f4\u7684\u5bf9\u8bdd\uff0c\u63d0\u5347\u670d\u52a1\u8d28\u91cf\u3002\u4e3a\u4e86\u786e\u4fdd\u7cfb\u7edf\u7684\u9ad8\u6548\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u5e94\u7528\u4ee5\u4e0b\u4f18\u5316\u63aa\u65bd\uff1a<\/span><\/p>\n<ul data-sourcepos=\"341:1-343:0\" style=\"padding-left: 2rem;margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\" class=\"list-paddingleft-1\">\n<li style=\"font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u672c\u5730\u5316\u7f13\u5b58<\/span>\uff1a\u5c06\u5e38\u7528\u7684\u7ffb\u8bd1\u7ed3\u679c\u8fdb\u884c\u7f13\u5b58\uff0c\u51cf\u5c11\u91cd\u590d\u8bf7\u6c42\u3002<\/span><\/p>\n<\/li>\n<li style=\"margin-top: 0.25rem;font-size: 17px;\">\n<p><span style=\"font-size: 17px;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);\">\u6279\u5904\u7406\u8bf7\u6c42<\/span>\uff1a\u6279\u91cf\u5904\u7406\u5ba2\u6237\u5bf9\u8bdd\uff0c\u63d0\u9ad8\u7cfb\u7edf\u6548\u7387\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<p data-sourcepos=\"344:1-344:15\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u793a\u4f8b\u4ee3\u7801\uff1a<\/span><\/p>\n<p data-sourcepos=\"346:1-346:19\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);font-size: 17px;\">\u672c\u5730\u5316\u7f13\u5b58<\/span><\/p>\n<pre data-sourcepos=\"348:1-364:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>cache<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Cacheable<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>stereotype<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Service<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">com<span style=\"color: rgb(153, 153, 153);\">.<\/span>google<span style=\"color: rgb(153, 153, 153);\">.<\/span>cloud<span style=\"color: rgb(153, 153, 153);\">.<\/span>translate<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Translate<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@Service<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">CachedTranslationService<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">Translate<\/span> translate<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Cacheable(<\/span><span style=\"color: rgb(102, 153, 0);\">\"translations\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> <span style=\"color: rgb(221, 74, 104);\">translateText<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span> text<span style=\"color: rgb(153, 153, 153);\">,<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> translate<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">translate<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>text<span style=\"color: rgb(153, 153, 153);\">,<\/span> <span style=\"color: rgb(221, 74, 104);\">Translate<span style=\"color: rgb(153, 153, 153);\">.<\/span>TranslateOption<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">targetLanguage<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>targetLanguage<span style=\"color: rgb(153, 153, 153);\">)).<\/span><span style=\"color: rgb(221, 74, 104);\">getTranslatedText<\/span><span style=\"color: rgb(153, 153, 153);\">();<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<p data-sourcepos=\"366:1-366:19\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);font-size: 17px;\">\u6279\u5904\u7406\u8bf7\u6c42<\/span><\/p>\n<pre data-sourcepos=\"368:1-393:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>scheduling<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Async<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>stereotype<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">Service<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span>concurrent<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@Service<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">BatchTranslationService<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">CachedTranslationService<\/span> cachedTranslationService<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Async<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">batchTranslate<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> texts<span style=\"color: rgb(153, 153, 153);\">,<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;&gt;<\/span> futures <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> texts<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">stream<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">map<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>text <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">supplyAsync<\/span><span style=\"color: rgb(153, 153, 153);\">(()<\/span> <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> cachedTranslationService<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">translateText<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>text<span style=\"color: rgb(153, 153, 153);\">,<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)))<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">collect<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toList<\/span><span style=\"color: rgb(153, 153, 153);\">());<\/span>        <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">Void<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> allOf <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">=<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">allOf<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>futures<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toArray<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(0, 119, 170);\">new<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">[<\/span><span style=\"color: rgb(153, 0, 85);\">0<\/span><span style=\"color: rgb(153, 153, 153);\">]));<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> allOf<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">thenApply<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>v <span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">-&gt;<\/span> futures<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">stream<\/span><span style=\"color: rgb(153, 153, 153);\">()<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">map<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">::<\/span><span style=\"color: rgb(221, 74, 104);\">join<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>                <span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">collect<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span><span style=\"color: rgb(221, 74, 104);\">Collectors<\/span><span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">toList<\/span><span style=\"color: rgb(153, 153, 153);\">()));<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<p data-sourcepos=\"395:1-395:25\" style=\"margin-bottom: 1rem;caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-weight: 600;color: rgb(0, 0, 0);font-size: 17px;\">\u8c03\u7528\u6279\u5904\u7406\u670d\u52a1<\/span><\/p>\n<pre data-sourcepos=\"397:1-415:3\" tabindex=\"0\" style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;font-size: 13.6px;margin-top: 0.5em;margin-bottom: 0.5em;overflow-wrap: normal;padding: 1em;overflow: auto;line-height: 1.45;background: rgb(246, 248, 250);border-radius: 0.1875rem;color: black;word-spacing: normal;word-break: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;\"><code style=\"font-family: Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;background: none;color: rgb(85, 85, 85);border-radius: 0.1875rem;word-spacing: normal;word-break: normal;overflow-wrap: normal;tab-size: 4;hyphens: none;text-shadow: white 0px 1px;border-width: 0px;border-style: initial;border-color: initial;display: inline;overflow: visible;line-height: inherit;\"><span style=\"font-size: 17px;\"><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">org<span style=\"color: rgb(153, 153, 153);\">.<\/span>springframework<span style=\"color: rgb(153, 153, 153);\">.<\/span>web<span style=\"color: rgb(153, 153, 153);\">.<\/span>bind<span style=\"color: rgb(153, 153, 153);\">.<\/span>annotation<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(154, 110, 58);background: rgba(255, 255, 255, 0.5);\">*<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(0, 119, 170);\">import<\/span> <span style=\"opacity: 0.7;\">java<span style=\"color: rgb(153, 153, 153);\">.<\/span>util<span style=\"color: rgb(153, 153, 153);\">.<\/span>concurrent<span style=\"color: rgb(153, 153, 153);\">.<\/span><\/span><span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">;<\/span><span style=\"color: rgb(153, 153, 153);\">@RestController<\/span><span style=\"color: rgb(153, 153, 153);\">@RequestMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/api\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span><span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(0, 119, 170);\">class<\/span> <span style=\"color: rgb(221, 74, 104);\">TranslationController<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>    <span style=\"color: rgb(153, 153, 153);\">@Autowired<\/span>    <span style=\"color: rgb(0, 119, 170);\">private<\/span> <span style=\"color: rgb(221, 74, 104);\">BatchTranslationService<\/span> batchTranslationService<span style=\"color: rgb(153, 153, 153);\">;<\/span>    <span style=\"color: rgb(153, 153, 153);\">@PostMapping(<\/span><span style=\"color: rgb(102, 153, 0);\">\"\/batch-translate\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span>    <span style=\"color: rgb(0, 119, 170);\">public<\/span> <span style=\"color: rgb(221, 74, 104);\">CompletableFuture<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;&gt;<\/span> <span style=\"color: rgb(221, 74, 104);\">batchTranslate<\/span><span style=\"color: rgb(153, 153, 153);\">(@RequestBody<\/span> <span style=\"color: rgb(221, 74, 104);\">List<\/span><span style=\"color: rgb(153, 153, 153);\">&lt;<\/span><span style=\"color: rgb(221, 74, 104);\">String<\/span><span style=\"color: rgb(153, 153, 153);\">&gt;<\/span> texts<span style=\"color: rgb(153, 153, 153);\">,<\/span>                                                           <span style=\"color: rgb(153, 153, 153);\">@RequestParam(<\/span><span style=\"color: rgb(102, 153, 0);\">\"targetLanguage\"<\/span><span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(221, 74, 104);\">String<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">)<\/span> <span style=\"color: rgb(153, 153, 153);\">{<\/span>        <span style=\"color: rgb(0, 119, 170);\">return<\/span> batchTranslationService<span style=\"color: rgb(153, 153, 153);\">.<\/span><span style=\"color: rgb(221, 74, 104);\">batchTranslate<\/span><span style=\"color: rgb(153, 153, 153);\">(<\/span>texts<span style=\"color: rgb(153, 153, 153);\">,<\/span> targetLanguage<span style=\"color: rgb(153, 153, 153);\">);<\/span>    <span style=\"color: rgb(153, 153, 153);\">}<\/span><span style=\"color: rgb(153, 153, 153);\">}<\/span><\/span><\/code><\/pre>\n<h3 data-sourcepos=\"417:1-417:10\" style=\"margin-top: 1.5rem;margin-bottom: 1rem;font-weight: 600;line-height: 1.25;font-size: 1.25rem;color: rgb(0, 0, 0);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;letter-spacing: normal;text-align: start;text-wrap: wrap;\"><span style=\"font-size: 17px;\">\u603b\u7ed3<\/span><\/h3>\n<p data-sourcepos=\"419:1-419:473\" style=\"caret-color: rgb(36, 41, 46);color: rgb(36, 41, 46);font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;margin-bottom: 0px !important;\"><span style=\"font-size: 17px;\">\u901a\u8fc7Spring Boot\u96c6\u6210Google Cloud\u7684\u8bed\u97f3\u8bc6\u522b\u548c\u7ffb\u8bd1\u670d\u52a1\uff0c\u53ef\u4ee5\u9ad8\u6548\u5b9e\u73b0\u591a\u8bed\u8a00\u7684\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u3002\u7ed3\u5408\u5f02\u6b65\u5904\u7406\u3001\u97f3\u9891\u5207\u7247\u5904\u7406\u3001\u672c\u5730\u5316\u7f13\u5b58\u548c\u6279\u5904\u7406\u8bf7\u6c42\u7b49\u4f18\u5316\u624b\u6bb5\uff0c\u53ef\u4ee5\u663e\u8457\u964d\u4f4e\u7cfb\u7edf\u5ef6\u8fdf\uff0c\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002\u4e0a\u8ff0\u56fd\u9645\u4f1a\u8bae\u5b9e\u65f6\u7ffb\u8bd1\u7cfb\u7edf\u548c\u591a\u8bed\u8a00\u5ba2\u670d\u7cfb\u7edf\u7684\u5b9e\u9645\u6848\u4f8b\u5c55\u793a\u4e86\u8fd9\u4e9b\u6280\u672f\u548c\u4f18\u5316\u63aa\u65bd\u7684\u5e94\u7528\u6548\u679c\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6784\u5efa\u9ad8\u6548\u7684\u5b9e\u65f6\u8bed\u97f3\u7ffb\u8bd1\u7cfb\u7edf\u6709\u6240\u5e2e\u52a9\u3002<\/span><\/p>\n<p style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;\">\n<section style=\"margin-bottom: 1em;letter-spacing: 0.578px;text-wrap: wrap;color: rgba(0, 0, 0, 0.85);font-family: -apple-system, system-ui, &quot;segoe ui&quot;, Roboto, &quot;helvetica neue&quot;, Arial, &quot;noto sans&quot;, sans-serif, &quot;apple color emoji&quot;, &quot;segoe ui emoji&quot;, &quot;segoe ui symbol&quot;, &quot;noto color emoji&quot;, monospace;text-align: start;background-color: rgb(255, 255, 255);text-shadow: none !important;line-height: 1.5rem !important;font-size: 1rem !important;\"><span style=\"text-align: justify;color: rgb(0, 0, 0);font-family: &quot;Helvetica Neue&quot;;font-size: 17px;\">\u4eca\u5929\u5c31\u8bb2\u5230\u8fd9\u91cc\uff0c\u5982\u679c\u6709\u95ee\u9898\u9700\u8981\u54a8\u8be2\uff0c\u5927\u5bb6\u53ef\u4ee5\u76f4\u63a5\u7559\u8a00\u6216\u626b\u4e0b\u65b9\u4e8c\u7ef4\u7801\u6765\u77e5\u8bc6\u661f\u7403\u627e\u6211\uff0c\u6211\u4eec\u4f1a\u5c3d\u529b\u4e3a\u4f60\u89e3\u7b54\u3002<\/span><\/section>\n<p style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-cropselx1=\"0\" data-cropselx2=\"578\" data-cropsely1=\"0\" data-cropsely2=\"317\" data-galleryid=\"\" data-imgfileid=\"100012519\" data-ratio=\"0.549074074074074\" data-s=\"300,640\"  data-type=\"jpeg\" data-w=\"1080\" style=\"height: 318px;width: 578px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222536719.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-cropselx1=\"0\" data-cropselx2=\"578\" data-cropsely1=\"0\" data-cropsely2=\"317\" data-galleryid=\"\" data-imgfileid=\"100012519\" data-ratio=\"0.549074074074074\" data-s=\"300,640\"  data-type=\"jpeg\" data-w=\"1080\" style=\"height: 318px;width: 578px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222536719.jpeg\"  \/><\/noscript><\/p>\n<section style=\"margin-bottom: 1em;letter-spacing: 0.578px;text-wrap: wrap;color: rgba(0, 0, 0, 0.85);font-family: -apple-system, system-ui, &quot;segoe ui&quot;, Roboto, &quot;helvetica neue&quot;, Arial, &quot;noto sans&quot;, sans-serif, &quot;apple color emoji&quot;, &quot;segoe ui emoji&quot;, &quot;segoe ui symbol&quot;, &quot;noto color emoji&quot;, monospace;text-align: start;background-color: rgb(255, 255, 255);text-shadow: none !important;line-height: 1.5rem !important;font-size: 1rem !important;\"><\/section>\n<section style=\"margin-bottom: 1em;letter-spacing: 0.578px;text-wrap: wrap;color: rgba(0, 0, 0, 0.85);font-family: -apple-system, system-ui, &quot;segoe ui&quot;, Roboto, &quot;helvetica neue&quot;, Arial, &quot;noto sans&quot;, sans-serif, &quot;apple color emoji&quot;, &quot;segoe ui emoji&quot;, &quot;segoe ui symbol&quot;, &quot;noto color emoji&quot;, monospace;text-align: start;background-color: rgb(255, 255, 255);text-shadow: none !important;line-height: 1.5rem !important;font-size: 1rem !important;\"><span style=\"letter-spacing: 0.544px;color: rgb(51, 51, 51);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;text-align: justify;font-size: 17px;\">AI\u8d44\u6e90\u805a\u5408\u7ad9\u5df2\u7ecf\u6b63\u5f0f\u4e0a\u7ebf\uff0c\u8be5\u5e73\u53f0\u4e0d\u4ec5\u4ec5\u662f\u4e00\u4e2aAI\u8d44\u6e90\u805a\u5408\u7ad9\uff0c\u66f4\u662f\u4e00\u4e2a\u4e3a\u8ffd\u6c42\u77e5\u8bc6\u6df1\u5ea6\u548c\u5e7f\u5ea6\u7684\u4eba\u4eec\u6253\u9020\u7684\u667a\u6167\u805a\u96c6\u5730\u3002\u901a\u8fc7\u8bbf\u95ee AI \u8d44\u6e90\u805a\u5408\u7f51\u7ad9 https:\/\/ai-ziyuan.techwisdom.cn\/\uff0c\u4f60\u5c06\u8fdb\u5165\u4e00\u4e2a\u5168\u65b9\u4f4d\u6db5\u76d6\u4eba\u5de5\u667a\u80fd\u548c\u8bed\u8a00\u6a21\u578b\u9886\u57df\u7684\u5b9d\u85cf\u5e93<span style=\"font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.578px;\">\u3002<\/span><\/span><\/section>\n<p style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;\">\n<section style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;min-height: 1em;text-align: center;line-height: 2em;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100012520\" data-ratio=\"0.9921414538310412\" data-s=\"300,640\"  data-type=\"png\" data-w=\"509\" style=\"width: 509px !important;visibility: visible !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222541811.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100012520\" data-ratio=\"0.9921414538310412\" data-s=\"300,640\"  data-type=\"png\" data-w=\"509\" style=\"width: 509px !important;visibility: visible !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222541811.png\"  \/><\/noscript><\/section>\n<section style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;min-height: 1em;text-align: center;line-height: 2em;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100012517\" data-ratio=\"0.25\" data-s=\"300,640\"  data-type=\"png\" data-w=\"424\" style=\"width: 424px !important;visibility: visible !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222546560.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100012517\" data-ratio=\"0.25\" data-s=\"300,640\"  data-type=\"png\" data-w=\"424\" style=\"width: 424px !important;visibility: visible !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222546560.png\"  \/><\/noscript><\/section>\n<section style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;min-height: 1em;text-align: center;line-height: 2em;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-imgfileid=\"100012518\" data-ratio=\"0.5142857142857142\" data-s=\"300,640\"  data-type=\"png\" data-w=\"210\" style=\"width: 210px !important;visibility: visible !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222551971.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-imgfileid=\"100012518\" data-ratio=\"0.5142857142857142\" data-s=\"300,640\"  data-type=\"png\" data-w=\"210\" style=\"width: 210px !important;visibility: visible !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222551971.png\"  \/><\/noscript><\/section>\n<section style=\"margin-bottom: 0px;letter-spacing: 0.578px;text-wrap: wrap;min-height: 1em;text-align: center;line-height: 2em;\"><span style=\"font-size: 16px;\"><strong><span style=\"color: rgb(0, 0, 0);font-family: &quot;Helvetica Neue&quot;;letter-spacing: 0.544px;text-align: start;background-color: rgb(255, 255, 255);\">\u4f5c\u8005\uff1a\u8def\u6761\u7f16\u7a0b\uff08\u8f6c\u8f7d\u8bf7\u83b7\u672c\u516c\u4f17\u53f7\u6388\u6743\uff0c\u5e76\u6ce8\u660e\u4f5c\u8005\u4e0e\u51fa\u5904\uff09<\/span><\/strong><\/span><\/section>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u8def\u6761\u7f16\u7a0b              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u672c\u4e13\u9898\u7cfb\u7edf\u8bb2\u89e3\u4e86\u5982\u4f55\u5229\u7528SpringBoot\u96c6\u6210\u97f3\u9891\u8bc6\u522b\u6280\u672f\uff0c\u6db5\u76d6\u4e86\u4ece\u57fa\u7840\u914d\u7f6e\u5230\u590d\u6742\u5e94\u7528\u7684\u65b9\u65b9\u9762\u9762\u3002\u901a\u8fc7\u672c\u6587\uff0c\u8bfb\u8005\u53ef\u4ee5\u4e86\u89e3\u5230\u5728\u667a\u80fd &#8230;<\/p>\n","protected":false},"author":1,"featured_media":5726,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-5761","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222459528-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222511361.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222459528-300x300.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222459528-1024x1022.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222511361.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222459528-300x300.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222459528-1024x1022.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222459528.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222511361.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222511361.png","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222536719.jpeg","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222536719.jpeg","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222541811.png","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222541811.png","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222546560.png","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222546560.png","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222551971.png","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222551971.png","id":"image9"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2024-08-01","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":709,"next_post_id":5644,"next_post_title":"\u89e3\u51b3\u65e5\u5fd7\u5f00\u5173\u9700\u6c42\uff1aSpringBoot \u5b9e\u73b0\u70ed\u63d2\u62d4 AOP","previous_post_id":5477,"previous_post_title":"SpringBoot \u670d\u52a1\u542f\u52a8\u6162\u6392\u67e5\u601d\u8def","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=5761"}],"version-history":[{"count":1,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5761\/revisions"}],"predecessor-version":[{"id":6303,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5761\/revisions\/6303"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/5726"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=5761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=5761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=5761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}