Commit 7df5f4da by 苗权威

8.3

parent 70c123c2
......@@ -12,6 +12,7 @@
<module name="ruoqi" />
<module name="spirit" />
<module name="third_party_load" />
<module name="tts_service" />
<module name="xiaoai" />
<module name="xiaodu" />
<module name="xiaoduhome" />
......@@ -32,6 +33,7 @@
<module name="ruoqi" options="-parameters" />
<module name="spirit" options="-parameters -extdirs /usr/local/intellij/workplace/smartbox/spirit/src/main/resources/lib" />
<module name="third_party_load" options="-parameters" />
<module name="tts_service" options="-parameters" />
<module name="xiaoai" options="-parameters" />
<module name="xiaodu" options="-parameters" />
<module name="xiaoduhome" options="-parameters" />
......
......@@ -7,6 +7,7 @@
<file url="file://$PROJECT_DIR$/ruoqi" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spirit" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/third_party_load" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/tts_service" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/xiaoai" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/xiaodu" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/xiaoduhome" charset="UTF-8" />
......
......@@ -25,6 +25,7 @@
<option value="$PROJECT_DIR$/open/pom.xml" />
<option value="$PROJECT_DIR$/third_party_load/pom.xml" />
<option value="$PROJECT_DIR$/xiaoduhome/pom.xml" />
<option value="$PROJECT_DIR$/tts_service/pom.xml" />
</list>
</option>
</component>
......
......@@ -6,26 +6,13 @@
<change beforePath="$PROJECT_DIR$/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoai/src/main/java/ai/qiwu/mi/xiaoai/controller/XiaoAiController.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoai/src/main/java/ai/qiwu/mi/xiaoai/controller/XiaoAiController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoai/src/main/java/ai/qiwu/mi/xiaoai/service/XiaoAiService.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoai/src/main/java/ai/qiwu/mi/xiaoai/service/XiaoAiService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/OkHttp3Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/OkHttp3Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/Oauth2Controller.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/Oauth2Controller.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/CustomProductPrompts.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/CustomProductPrompts.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Pricing.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Pricing.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Product.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Product.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/PublishingInformation.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/PublishingInformation.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/response/PublishRequestBody.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/LoadBySMS.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/LoadBySMS.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/AudioUrlAndText.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/AudioUrlAndText.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/RequestTerminal.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/RequestTerminal.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/productManager/ProductManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/productManager/ProductManager.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/resources/application.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/resources/static/picture/big.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/resources/static/picture/small.jpg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2_load.html" beforeDir="false" afterPath="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2_load.html" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<ignored path="$PROJECT_DIR$/target/" />
......@@ -41,6 +28,7 @@
<ignored path="$PROJECT_DIR$/open/target/" />
<ignored path="$PROJECT_DIR$/third_party_load/target/" />
<ignored path="$PROJECT_DIR$/xiaoduhome/target/" />
<ignored path="$PROJECT_DIR$/tts_service/target/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -66,64 +54,79 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="642">
<caret line="71" column="58" selection-start-line="71" selection-start-column="58" selection-end-line="71" selection-end-column="58" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="28" column="13" selection-start-line="28" selection-start-column="13" selection-end-line="28" selection-end-column="13" />
<state relative-caret-position="452">
<caret line="313" column="23" selection-start-line="313" selection-start-column="19" selection-end-line="313" selection-end-column="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/Product.html">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/OkHttp3Utils.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="239" column="5" selection-start-line="239" selection-start-column="5" selection-end-line="239" selection-end-column="5" />
<state relative-caret-position="220">
<caret line="22" column="38" selection-start-line="22" selection-start-column="38" selection-end-line="22" selection-end-column="38" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/home_load.html">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTServiceUtil.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1430">
<caret line="65" column="32" lean-forward="true" selection-start-line="65" selection-start-column="32" selection-end-line="65" selection-end-column="32" />
<state relative-caret-position="140">
<caret line="80" column="23" selection-start-line="80" selection-start-column="23" selection-end-line="80" selection-end-column="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Initialize.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="103" column="9" lean-forward="true" selection-start-line="103" selection-start-column="9" selection-end-line="103" selection-end-column="9" />
<state relative-caret-position="614">
<caret line="106" column="26" selection-start-line="106" selection-start-column="15" selection-end-line="106" selection-end-column="26" />
<folding>
<element signature="e#6036#6089#0" />
<element signature="e#10722#10835#0" />
<element signature="e#10473#10488#0" />
<element signature="e#13574#13639#0" />
<element signature="e#14045#14057#0" />
<element signature="e#16234#16259#0" />
<element signature="imports" expanded="true" />
<element signature="e#4366#4367#0" expanded="true" />
<element signature="e#4400#4401#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/tts.properties">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="484">
<caret line="112" column="42" selection-start-line="112" selection-start-column="42" selection-end-line="112" selection-end-column="42" />
<state relative-caret-position="44">
<caret line="2" column="15" lean-forward="true" selection-start-line="2" selection-start-column="15" selection-end-line="2" selection-end-column="15" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/ProductController.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSUtils.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2128">
<caret line="130" column="9" selection-start-line="130" selection-start-column="9" selection-end-line="130" selection-end-column="9" />
<state relative-caret-position="430">
<caret line="152" column="24" lean-forward="true" selection-start-line="152" selection-start-column="24" selection-end-line="152" selection-end-column="24" />
<folding>
<element signature="imports" expanded="true" />
</folding>
......@@ -131,15 +134,24 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/application.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="218">
<caret line="21" lean-forward="true" selection-start-line="21" selection-end-line="21" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Enum" />
<option value="HTML File" />
<option value="Interface" />
<option value="Class" />
<option value="HTML File" />
</list>
</option>
</component>
......@@ -150,10 +162,19 @@
<find>msgId</find>
<find>logger</find>
<find>StreamResponse</find>
<find>PERSON_INFO</find>
<find>platform</find>
<find>AudioSystem</find>
<find>requestTemplate</find>
<find>generalMP3</find>
<find>Config</find>
<find>StringUtils.join</find>
<find>_type</find>
</findStrings>
<replaceStrings>
<replace>OPENID_CACHE</replace>
<replace>log</replace>
<replace>PERSON_INFO_ONLINE</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
......@@ -162,57 +183,57 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ScheduleTask.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/LoadFrontController.java" />
<option value="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/HttpRequestUtils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/HttpRequestUtils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/UploadImageResult.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Product.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/PublishingInformation.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/CustomProductPrompts.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/Pricing.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/LoadImageResponse.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/MultipartResolver.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/ProductTokenHolder.java" />
<option value="$PROJECT_DIR$/xiaoai/src/main/java/ai/qiwu/mi/xiaoai/service/XiaoAiService.java" />
<option value="$PROJECT_DIR$/xiaoai/src/main/java/ai/qiwu/mi/xiaoai/controller/XiaoAiController.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/AboutProductResult.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/response/PublishResponse.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/response/PublishRequest.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/OkHttp3Utils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/LoadBySMS.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/UpdateProduct.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/response/QueryProductDataItem.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/response/QueryProductResponse.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/ProductError.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/response/SkillProduct.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/application.properties" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/UpdateRequestBody.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/response/PubDelUpdResponse.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/productManager/ProductManager.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/ProductController.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/QueryProduct.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Facade.html" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/QiWuResponse.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/QiWuRequest.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Utils.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/GetUserInfoByToken.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java" />
<option value="$PROJECT_DIR$/xiaoduhome/pom.xml" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/ResponseEncapsulation.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/application.properties" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Constants.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Product.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java" />
<option value="$PROJECT_DIR$/xiaodu/pom.xml" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2_load.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/Oauth2Controller.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/templates/home_load.html" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/XiaoduApplication.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/QiWuRequest.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/RequestTerminal.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/resources/application.properties" />
<option value="$PROJECT_DIR$/xiaodu/pom.xml" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/AudioUrlAndText.java" />
<option value="$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/SpeakerInfo.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/PersonInfo.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/OnlineCache.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/SpeakersApiRes.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/ErrorMsgEnum.java" />
<option value="$PROJECT_DIR$/tts_service/src/test/java/ai/qiwu/com/tts_service/common/TTSUtils.java" />
<option value="$PROJECT_DIR$/tts_service/src/test/java/ai/qiwu/com/tts_service/TtsServiceApplicationTests.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSConstants.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/ResponseCodeWithData.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/ChangeSound.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TTSResponse.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TTSRequest.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/GeneralMP3Data.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/ResponseStatusWithList.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TTSLSRequest.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/Mp3Request.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/MP3Response.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/ChatBotRequest.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/ChatBotResponse.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/AudioRequestService.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTServiceUtil.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/TtsServiceApplication.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/entity/Speakers_info.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/repository/SpeakerInfoRepository.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/entity/SpeakersInfo.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/Config.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TextInfo.java" />
<option value="$PROJECT_DIR$/tts_service/pom.xml" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/resources/application.yml" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Initialize.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/resources/tts.properties" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/CallPython.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSUtils.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/OkHttp3Utils.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java" />
</list>
</option>
</component>
......@@ -230,6 +251,15 @@
<expand>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="tts_service" type="9519ce18:MavenProjectsStructure$ProjectNode" />
</path>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="tts_service" type="9519ce18:MavenProjectsStructure$ProjectNode" />
<item name="Lifecycle" type="58874e2:MavenProjectsStructure$LifecycleNode" />
</path>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="xiaodu" type="9519ce18:MavenProjectsStructure$ProjectNode" />
</path>
<path>
......@@ -245,10 +275,10 @@
<option name="skipTests" value="true" />
</component>
<component name="ProjectFrameBounds">
<option name="x" value="245" />
<option name="y" value="60" />
<option name="x" value="745" />
<option name="y" value="32" />
<option name="width" value="1409" />
<option name="height" value="1005" />
<option name="height" value="1023" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="1" id="Add" />
......@@ -259,6 +289,7 @@
</navigator>
<panes>
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<expand>
......@@ -269,77 +300,92 @@
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="third_party_load" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="common" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="common" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="controller" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="controller" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="entity" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="repository" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
......@@ -348,16 +394,17 @@
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaodu" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
......@@ -370,34 +417,37 @@
<property name="RequestMappingsPanelWidth2" value="75" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1564223859131" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1564812546670" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../security/p1o6vt" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.254023" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
<property name="settings.editor.selected.configurable" value="spring.boot" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo" />
<recent name="$PROJECT_DIR$/xiaodu/src/main/resources/static/picture" />
<recent name="$PROJECT_DIR$/third_party_load/src/main/resources/static" />
<recent name="$PROJECT_DIR$/open/src/test/java/ai/qiwu/com/open/common/encryption" />
<recent name="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/controller" />
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/spirit/src/main/resources/static/aligenie" />
<recent name="$PROJECT_DIR$/spirit/src/main/resources/lib" />
<recent name="$PROJECT_DIR$/ruoqi/src/main/resources/lib" />
</key>
<key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
<recent name="ai.qiwu.com.tts_service.entity" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="ai.qiwu.com.tts_service.common" />
<recent name="ai.qiwu.baidu.xiaodu.pojo" />
<recent name="ai.qiwu.com.xiaoduhome.pojo" />
<recent name="ai.qiwu.com.xiaoduhome.service" />
<recent name="ai.qiwu.com.xiaoduhome.common" />
<recent name="ai.qiwu.mqw.rokid.dispatcher" />
<recent name="ai.qiwu.mqw.rokid" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/spirit/src/main/resources/static/aligenie" />
<recent name="$PROJECT_DIR$/spirit/src/main/resources/lib" />
<recent name="$PROJECT_DIR$/ruoqi/src/main/resources/lib" />
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo" />
<recent name="$PROJECT_DIR$/xiaodu/src/main/resources/static/picture" />
<recent name="$PROJECT_DIR$/third_party_load/src/main/resources/static" />
<recent name="$PROJECT_DIR$/open/src/test/java/ai/qiwu/com/open/common/encryption" />
<recent name="$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/controller" />
</key>
</component>
<component name="RunDashboard">
......@@ -412,13 +462,13 @@
</list>
</option>
</component>
<component name="RunManager" selected="Application.Utils">
<configuration name="LoadBySMS" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.baidu.xiaodu.service.LoadBySMS" />
<module name="xiaodu" />
<component name="RunManager" selected="Spring Boot.TtsServiceApplication">
<configuration name="CallPython" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.tts_service.common.CallPython" />
<module name="tts_service" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.baidu.xiaodu.service.*" />
<option name="PATTERN" value="ai.qiwu.com.tts_service.common.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
......@@ -426,8 +476,8 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="ResponseEncapsulation" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.baidu.xiaodu.service.ResponseEncapsulation" />
<configuration name="LoadBySMS" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.baidu.xiaodu.service.LoadBySMS" />
<module name="xiaodu" />
<extension name="coverage">
<pattern>
......@@ -439,12 +489,12 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="SecurityConfig" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.third_party_load.config.SecurityConfig" />
<module name="third_party_load" />
<configuration name="TTSUtils" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.tts_service.common.TTSUtils" />
<module name="tts_service" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.com.third_party_load.config.*" />
<option name="PATTERN" value="ai.qiwu.com.tts_service.common.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
......@@ -465,19 +515,6 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="XiaoDuController" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.baidu.xiaodu.controller.XiaoDuController" />
<module name="xiaodu" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.baidu.xiaodu.controller.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Open" type="ECS_RUN_CONFIGRATION" factoryName="Ecs configuration factory">
<option name="address" />
<option name="alreadyReset" value="true" />
......@@ -695,6 +732,22 @@
<option name="Maven.BeforeRunTask" enabled="true" file="$PROJECT_DIR$/xiaodu/pom.xml" goal="clean install" />
</method>
</configuration>
<configuration name="TtsServiceApplicationTests.createFileTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="tts_service" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="ai.qiwu.com.tts_service.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="ai.qiwu.com.tts_service" />
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.tts_service.TtsServiceApplicationTests" />
<option name="METHOD_NAME" value="createFileTest" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="DingdongApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="dingdong" />
<option name="SPRING_BOOT_MAIN_CLASS" value="ai.qiwu.dong.dingdong.DingdongApplication" />
......@@ -744,6 +797,13 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TtsServiceApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="tts_service" />
<option name="SPRING_BOOT_MAIN_CLASS" value="ai.qiwu.com.tts_service.TtsServiceApplication" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="XiaoaiApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="xiaoai" />
<option name="SPRING_BOOT_MAIN_CLASS" value="ai.qiwu.mi.xiaoai.XiaoaiApplication" />
......@@ -773,11 +833,10 @@
</method>
</configuration>
<list>
<item itemvalue="Application.SecurityConfig" />
<item itemvalue="Application.XiaoDuController" />
<item itemvalue="Application.LoadBySMS" />
<item itemvalue="Application.ResponseEncapsulation" />
<item itemvalue="Application.Utils" />
<item itemvalue="Application.TTSUtils" />
<item itemvalue="Application.CallPython" />
<item itemvalue="ECS on Alibaba Cloud.dingdong" />
<item itemvalue="ECS on Alibaba Cloud.xiaodu" />
<item itemvalue="ECS on Alibaba Cloud.rokid" />
......@@ -785,6 +844,7 @@
<item itemvalue="ECS on Alibaba Cloud.Open" />
<item itemvalue="ECS on Alibaba Cloud.spirit" />
<item itemvalue="ECS on Alibaba Cloud.security" />
<item itemvalue="JUnit.TtsServiceApplicationTests.createFileTest" />
<item itemvalue="Spring Boot.DingdongApplication" />
<item itemvalue="Spring Boot.RuoqiApplication" />
<item itemvalue="Spring Boot.SpiritApplication" />
......@@ -796,14 +856,15 @@
<item itemvalue="Spring Boot.OpenApplication" />
<item itemvalue="Spring Boot.ThirdPartyLoadApplication" />
<item itemvalue="Spring Boot.XiaoduhomeApplication" />
<item itemvalue="Spring Boot.TtsServiceApplication" />
</list>
<recent_temporary>
<list>
<item itemvalue="Application.CallPython" />
<item itemvalue="Application.TTSUtils" />
<item itemvalue="JUnit.TtsServiceApplicationTests.createFileTest" />
<item itemvalue="Application.Utils" />
<item itemvalue="Application.LoadBySMS" />
<item itemvalue="Application.ResponseEncapsulation" />
<item itemvalue="Application.XiaoDuController" />
<item itemvalue="Application.SecurityConfig" />
</list>
</recent_temporary>
</component>
......@@ -852,12 +913,25 @@
<workItem from="1563950516185" duration="20616000" />
<workItem from="1564017599424" duration="35400000" />
<workItem from="1564104425575" duration="32421000" />
<workItem from="1564191447891" duration="26686000" />
<workItem from="1564191447891" duration="28450000" />
<workItem from="1564365227039" duration="5272000" />
<workItem from="1564449869662" duration="5215000" />
<workItem from="1564463258904" duration="314000" />
<workItem from="1564463629925" duration="26132000" />
<workItem from="1564536798043" duration="36015000" />
<workItem from="1564622494207" duration="34612000" />
<workItem from="1564709875705" duration="36677000" />
<workItem from="1564794366344" duration="14962000" />
</task>
<servers />
</component>
<component name="TestHistory">
<history-entry file="TtsServiceApplicationTests_createFileTest - 2019.07.31 at 12h 29m 48s.xml">
<configuration name="TtsServiceApplicationTests.createFileTest" configurationId="JUnit" />
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="738264000" />
<option name="totallyTimeSpent" value="899227000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
......@@ -869,10 +943,10 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="245" y="60" width="1409" height="1005" extended-state="0" />
<frame x="643" y="65" width="1409" height="1023" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Structure" order="0" sideWeight="0.5052879" side_tool="true" weight="0.19576333" />
<window_info id="Structure" order="0" sideWeight="0.50689656" side_tool="true" weight="0.22042616" />
<window_info id="Designer" order="1" />
<window_info id="Image Layers" order="2" />
<window_info id="Capture Tool" order="3" />
......@@ -880,455 +954,494 @@
<window_info id="Favorites" order="5" sideWeight="0.5017626" side_tool="true" weight="0.25712198" />
<window_info id="Alibaba Cloud Explorer" order="6" sideWeight="0.49941108" weight="0.32843497" />
<window_info id="Web" order="7" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="8" sideWeight="0.4947121" visible="true" weight="0.20058781" />
<window_info content_ui="combo" id="Project" order="8" sideWeight="0.49310344" weight="0.22042616" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32902467" />
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.25704226" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32873562" />
<window_info anchor="bottom" id="Run" order="2" weight="0.37816092" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39929327" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.3298122" />
<window_info anchor="bottom" id="Spring" order="7" weight="0.32902467" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.3278496" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.3274648" />
<window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" weight="0.32979977" />
<window_info anchor="bottom" id="Java Enterprise" order="11" />
<window_info anchor="bottom" id="Database Changes" order="12" />
<window_info anchor="bottom" id="Version Control" order="13" weight="0.32975295" />
<window_info anchor="bottom" id="Alibaba Cloud View" order="14" weight="0.32979977" />
<window_info anchor="bottom" id="Messages" order="15" weight="0.30868545" />
<window_info anchor="bottom" id="Messages" order="15" weight="0.30804598" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Palette" order="3" />
<window_info anchor="right" id="Capture Analysis" order="4" />
<window_info anchor="right" id="Database" order="5" weight="0.32916972" />
<window_info anchor="right" id="Palette&#9;" order="6" />
<window_info anchor="right" id="Theme Preview" order="7" />
<window_info anchor="right" id="Bean Validation" order="8" />
<window_info anchor="right" id="Maven" order="9" weight="0.15503307" />
<window_info anchor="right" id="Maven" order="3" weight="0.15503307" />
<window_info anchor="right" id="Palette" order="4" />
<window_info anchor="right" id="Capture Analysis" order="5" />
<window_info anchor="right" id="Database" order="6" weight="0.32916972" />
<window_info anchor="right" id="Palette&#9;" order="7" />
<window_info anchor="right" id="Theme Preview" order="8" />
<window_info anchor="right" id="Bean Validation" order="9" />
<window_info anchor="right" id="Alibaba Log Console" order="10" />
</layout>
<layout-to-restore>
<window_info id="Structure" order="0" sideWeight="0.5041225" side_tool="true" weight="0.24908693" />
<window_info id="Structure" order="0" sideWeight="0.5052879" side_tool="true" weight="0.19576333" />
<window_info id="Designer" order="1" />
<window_info id="Image Layers" order="2" />
<window_info id="Capture Tool" order="3" />
<window_info id="UI Designer" order="4" />
<window_info id="Favorites" order="5" sideWeight="0.5017626" side_tool="true" weight="0.25712198" />
<window_info id="Alibaba Cloud Explorer" order="6" sideWeight="0.49941108" weight="0.3287071" />
<window_info id="Alibaba Cloud Explorer" order="6" sideWeight="0.49941108" weight="0.32843497" />
<window_info id="Web" order="7" side_tool="true" />
<window_info content_ui="combo" id="Project" order="8" sideWeight="0.4958775" visible="true" weight="0.18699782" />
<window_info active="true" content_ui="combo" id="Project" order="8" sideWeight="0.4947121" visible="true" weight="0.2167524" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32979977" />
<window_info anchor="bottom" id="Run" order="2" weight="0.5840188" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32902467" />
<window_info anchor="bottom" id="Run" order="2" weight="0.52816904" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39929327" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Spring" order="7" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.3286219" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.3298122" />
<window_info anchor="bottom" id="Spring" order="7" weight="0.32902467" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.3274648" />
<window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" weight="0.32979977" />
<window_info anchor="bottom" id="Java Enterprise" order="11" />
<window_info anchor="bottom" id="Database Changes" order="12" />
<window_info anchor="bottom" id="Version Control" order="13" weight="0.32975295" />
<window_info anchor="bottom" id="Alibaba Cloud View" order="14" weight="0.32979977" />
<window_info anchor="bottom" id="Messages" order="15" weight="0.30270907" />
<window_info anchor="bottom" id="Messages" order="15" weight="0.30868545" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Maven" order="3" weight="0.20745069" />
<window_info anchor="right" id="Maven" order="3" weight="0.15503307" />
<window_info anchor="right" id="Palette" order="4" />
<window_info anchor="right" id="Capture Analysis" order="5" />
<window_info anchor="right" id="Database" order="6" weight="0.32967836" />
<window_info anchor="right" id="Database" order="6" weight="0.32916972" />
<window_info anchor="right" id="Palette&#9;" order="7" />
<window_info anchor="right" id="Theme Preview" order="8" />
<window_info anchor="right" id="Bean Validation" order="9" />
<window_info anchor="right" id="Alibaba Log Console" order="10" />
</layout-to-restore>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/response/PubDelUpdResponse.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/lang/Double.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="15" column="23" lean-forward="true" selection-start-line="15" selection-start-column="23" selection-end-line="15" selection-end-column="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="479">
<caret line="536" column="25" selection-start-line="536" selection-start-column="25" selection-end-line="536" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/UpdateProduct.html">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/ChangeSound.java" />
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/io/File.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="528">
<caret line="69" column="56" selection-start-line="69" selection-start-column="50" selection-end-line="69" selection-end-column="56" />
<state relative-caret-position="281">
<caret line="965" column="16" selection-start-line="965" selection-start-column="16" selection-end-line="965" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadBaiDu.html">
<provider selected="true" editor-type-id="text-editor" />
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/io/FilterInputStream.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="347">
<caret line="105" column="15" selection-start-line="105" selection-start-column="15" selection-end-line="105" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/LoadBySMS.html">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/concurrent/Executors.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="352">
<caret line="16" column="9" lean-forward="true" selection-start-line="16" selection-start-column="9" selection-end-line="16" selection-end-column="9" />
<state relative-caret-position="281">
<caret line="87" column="34" selection-start-line="87" selection-start-column="34" selection-end-line="87" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/productManager/ProductManager.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/concurrent/ExecutorService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="354">
<caret line="72" column="49" selection-start-line="72" selection-start-column="44" selection-end-line="72" selection-end-column="49" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="404">
<caret line="235" column="18" selection-start-line="235" selection-start-column="18" selection-end-line="235" selection-end-column="18" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/ProductError.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/concurrent/Future.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="184">
<caret line="11" column="27" selection-start-line="11" selection-start-column="27" selection-end-line="11" selection-end-column="27" />
<state relative-caret-position="293">
<caret line="150" column="6" selection-start-line="150" selection-start-column="6" selection-end-line="150" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/Facade.html">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/List.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="10" column="39" selection-start-line="10" selection-start-column="39" selection-end-line="10" selection-end-column="39" />
<state relative-caret-position="281">
<caret line="110" column="17" selection-start-line="110" selection-start-column="17" selection-end-line="110" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/product/UpdateRequestBody.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/ArrayList.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
<state relative-caret-position="272">
<caret line="106" column="41" selection-start-line="106" selection-start-column="41" selection-end-line="106" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#6283#6284#0" expanded="true" />
<element signature="e#6351#6352#0" expanded="true" />
<element signature="e#13713#13714#0" expanded="true" />
<element signature="e#13768#13769#0" expanded="true" />
<element signature="e#24721#24722#0" expanded="true" />
<element signature="e#24775#24776#0" expanded="true" />
<element signature="e#46731#46732#0" expanded="true" />
<element signature="e#46796#46797#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduHome/pom.xml" />
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/AbstractList.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2478" />
<state relative-caret-position="281">
<caret line="70" column="22" selection-start-line="70" selection-start-column="22" selection-end-line="70" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/QiWuRequest.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/Arrays.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="264">
<caret line="14" column="27" lean-forward="true" selection-start-line="14" selection-start-column="27" selection-end-line="14" selection-end-column="27" />
<state relative-caret-position="272">
<caret line="3207" column="28" selection-start-line="3207" selection-start-column="28" selection-end-line="3207" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Utils.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/javax/sound/sampled/Clip.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="8" column="25" selection-start-line="8" selection-start-column="25" selection-end-line="8" selection-end-column="25" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="-2227">
<caret line="55" column="17" selection-start-line="55" selection-start-column="17" selection-end-line="55" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/RequestTerminal.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/javax/sound/sampled/AudioSystem.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="506">
<caret line="44" column="74" selection-start-line="44" selection-start-column="44" selection-end-line="44" selection-end-column="74" />
<state relative-caret-position="-1268">
<caret line="523" lean-forward="true" selection-start-line="523" selection-end-line="523" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/pojo/GetUserInfoByToken.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/Mp3Request.java" />
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/OnlineCache.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/GetUserInfoByToken.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/QiWuResponse.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/ResponseStatusWithList.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="11" column="19" selection-start-line="11" selection-start-column="19" selection-end-line="11" selection-end-column="19" />
<state relative-caret-position="418">
<caret line="19" column="71" selection-start-line="19" selection-start-column="71" selection-end-line="19" selection-end-column="71" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/SpeakersApiRes.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="9" lean-forward="true" selection-start-line="9" selection-end-line="9" />
<state relative-caret-position="242">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/service/RequestQiWu.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/ChatBotResponse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="550">
<caret line="44" selection-start-line="44" selection-end-line="44" />
<state relative-caret-position="506">
<caret line="23" column="55" selection-start-line="23" selection-start-column="55" selection-end-line="23" selection-end-column="55" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#430#431#0" expanded="true" />
<element signature="e#462#463#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/display/templates/Tpl1Content.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/MP3Response.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213">
<caret line="24" column="5" lean-forward="true" selection-start-line="24" selection-start-column="5" selection-end-line="24" selection-end-column="5" />
<state relative-caret-position="352">
<caret line="16" column="27" lean-forward="true" selection-start-line="16" selection-start-column="27" selection-end-line="16" selection-end-column="27" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#556#557#0" expanded="true" />
<element signature="e#592#593#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/display/templates/ImageStructure.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/AudioRequestService.java" />
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar!/org/apache/commons/lang3/StringUtils.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="583">
<caret line="69" column="26" selection-start-line="69" selection-start-column="26" selection-end-line="69" selection-end-column="26" />
<state relative-caret-position="27060">
<caret line="1283" column="29" selection-start-line="1283" selection-start-column="29" selection-end-line="1283" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/display/templates/Tag.class">
<entry file="file://$PROJECT_DIR$/open/src/main/java/ai/qiwu/com/open/common/utils/UpDownloadAudion.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="13" column="24" lean-forward="true" selection-start-line="13" selection-start-column="24" selection-end-line="13" selection-end-column="24" />
<state relative-caret-position="462">
<caret line="38" column="9" selection-start-line="38" selection-start-column="9" selection-end-line="38" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/pom.xml">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/Base64.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="470">
<caret line="71" column="41" lean-forward="true" selection-start-line="71" selection-start-column="41" selection-end-line="71" selection-end-column="41" />
<state relative-caret-position="1276">
<caret line="86" column="26" selection-start-line="86" selection-start-column="26" selection-end-line="86" selection-end-column="26" />
<folding>
<element signature="e#2577#2578#0" expanded="true" />
<element signature="e#2616#2617#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/XiaoduhomeApplication.java">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/lang/AbstractStringBuilder.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="110">
<caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
<state relative-caret-position="281">
<caret line="77" column="15" selection-start-line="77" selection-start-column="15" selection-end-line="77" selection-end-column="15" />
<folding>
<element signature="e#1588#1589#0" expanded="true" />
<element signature="e#1616#1617#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/resources/application.properties">
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/stream/ForEachOps.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="22">
<caret line="1" lean-forward="true" selection-start-line="1" selection-end-line="1" />
<state relative-caret-position="73">
<caret line="173" selection-start-line="173" selection-end-line="173" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/springframework/boot/spring-boot-autoconfigure/2.1.6.RELEASE/spring-boot-autoconfigure-2.1.6.RELEASE.jar!/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="484">
<caret line="22" column="31" lean-forward="true" selection-start-line="22" selection-start-column="31" selection-end-line="22" selection-end-column="31" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="73">
<caret line="101" column="50" selection-start-line="101" selection-start-column="50" selection-end-line="101" selection-end-column="50" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/QueryProduct.html">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/springframework/data/spring-data-jpa/2.1.9.RELEASE/spring-data-jpa-2.1.9.RELEASE.jar!/org/springframework/data/jpa/domain/AbstractPersistable.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1562">
<caret line="16" column="13" selection-start-line="16" selection-start-column="13" selection-end-line="16" selection-end-column="13" />
<folding>
<element signature="n#style#0;n#div#0;n#div#1;n#div#0;n#body#0;n#html#0;n#!!top" expanded="true" />
</folding>
<state relative-caret-position="154">
<caret line="17" column="22" selection-start-line="17" selection-start-column="22" selection-end-line="17" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/ResponseEncapsulation.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/repository/SpeakerInfoRepository.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3668">
<caret line="193" column="42" lean-forward="true" selection-start-line="193" selection-start-column="42" selection-end-line="193" selection-end-column="42" />
<state relative-caret-position="264">
<caret line="12" column="48" selection-start-line="12" selection-start-column="48" selection-end-line="12" selection-end-column="48" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/card/Card.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/TtsServiceApplication.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="264">
<caret line="19" column="22" selection-start-line="19" selection-start-column="22" selection-end-line="19" selection-end-column="22" />
<state relative-caret-position="110">
<caret line="8" column="62" selection-start-line="8" selection-start-column="62" selection-end-line="8" selection-end-column="62" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/display/templates/BaseTemplate.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/Config.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="275">
<caret line="24" column="22" selection-start-line="24" selection-start-column="22" selection-end-line="24" selection-end-column="22" />
<state relative-caret-position="284">
<caret line="30" column="25" selection-start-line="30" selection-start-column="25" selection-end-line="30" selection-end-column="25" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/display/templates/BodyTemplate1.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/ResponseCodeWithData.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="16" column="40" lean-forward="true" selection-start-line="16" selection-start-column="40" selection-end-line="16" selection-end-column="40" />
<state relative-caret-position="374">
<caret line="17" column="11" selection-start-line="17" selection-start-column="11" selection-end-line="17" selection-end-column="11" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#423#424#0" expanded="true" />
<element signature="e#455#456#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/audioplayer/Content.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TextInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="353">
<caret line="196" column="19" lean-forward="true" selection-start-line="196" selection-start-column="19" selection-end-line="196" selection-end-column="19" />
<state relative-caret-position="308">
<caret line="14" column="42" selection-start-line="14" selection-start-column="42" selection-end-line="14" selection-end-column="42" />
<folding>
<element signature="e#2192#2193#0" expanded="true" />
<element signature="e#2225#2226#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/audioplayer/PlayerInfo.class">
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/application.properties">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="19" column="55" selection-start-line="19" selection-start-column="55" selection-end-line="19" selection-end-column="55" />
<state relative-caret-position="44">
<caret line="2" column="33" lean-forward="true" selection-start-line="2" selection-start-column="33" selection-end-line="2" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/audioplayer/control/BaseButton.class">
<entry file="file://$PROJECT_DIR$/xiaodu/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="20" column="44" selection-start-line="20" selection-start-column="44" selection-end-line="20" selection-end-column="44" />
<state relative-caret-position="466">
<caret line="121" column="37" lean-forward="true" selection-start-line="121" selection-start-column="8" selection-end-line="121" selection-end-column="37" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/pom.xml">
<entry file="file://$PROJECT_DIR$/tts_service/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="426">
<caret line="110" column="18" lean-forward="true" selection-start-line="110" selection-start-column="18" selection-end-line="110" selection-end-column="18" />
<state relative-caret-position="1760">
<caret line="80" column="34" lean-forward="true" selection-start-line="80" selection-start-column="34" selection-end-line="80" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/github/ipld/java-cid/v1.1.1/java-cid-v1.1.1.jar!/io/ipfs/cid/Cid.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/entity/SpeakersInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="46" column="5" lean-forward="true" selection-start-line="46" selection-start-column="5" selection-end-line="46" selection-end-column="5" />
<state relative-caret-position="601">
<caret line="47" column="20" selection-start-line="47" selection-start-column="20" selection-end-line="47" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/application.properties">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/PersonInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="264">
<caret line="12" column="16" selection-start-line="12" selection-start-column="16" selection-end-line="12" selection-end-column="16" />
<state relative-caret-position="352">
<caret line="21" column="11" selection-start-line="21" selection-start-column="11" selection-end-line="21" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/bot/AudioPlayer.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/CallPython.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="22" column="36" lean-forward="true" selection-start-line="22" selection-start-column="36" selection-end-line="22" selection-end-column="36" />
<state relative-caret-position="360">
<caret line="37" column="27" lean-forward="true" selection-start-line="37" selection-start-column="27" selection-end-line="37" selection-end-column="27" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/response/directive/Directive.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Initialize.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="110">
<state relative-caret-position="614">
<caret line="106" column="26" selection-start-line="106" selection-start-column="15" selection-end-line="106" selection-end-column="26" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#4366#4367#0" expanded="true" />
<element signature="e#4400#4401#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/application.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="218">
<caret line="21" lean-forward="true" selection-start-line="21" selection-end-line="21" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/bot/BaseBot.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TTSLSRequest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="80" column="24" selection-start-line="80" selection-start-column="24" selection-end-line="80" selection-end-column="24" />
<state relative-caret-position="228">
<caret line="17" column="13" selection-start-line="17" selection-start-column="13" selection-end-line="17" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Constants.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/OkHttp3Utils.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="266">
<caret line="43" column="15" selection-start-line="43" selection-start-column="15" selection-end-line="43" selection-end-column="15" />
<state relative-caret-position="220">
<caret line="22" column="38" selection-start-line="22" selection-start-column="38" selection-end-line="22" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/model/Response.class">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/ChatBotRequest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="547">
<caret line="56" column="16" selection-start-line="56" selection-start-column="16" selection-end-line="56" selection-end-column="16" />
<state relative-caret-position="330">
<caret line="15" column="13" selection-start-line="15" selection-start-column="13" selection-end-line="15" selection-end-column="13" />
<folding>
<element signature="e#1409#1410#0" expanded="true" />
<element signature="e#1441#1442#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/lang/String.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-137">
<caret line="1752" column="15" selection-start-line="1752" selection-start-column="15" selection-end-line="1752" selection-end-column="15" />
<state relative-caret-position="642">
<caret line="71" column="58" selection-start-line="71" selection-start-column="58" selection-end-line="71" selection-end-column="58" />
<folding>
<element signature="e#66457#66458#0" expanded="true" />
<element signature="e#66495#66496#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/Oauth2_load.html">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/GeneralMP3Data.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="74">
<caret line="84" column="30" lean-forward="true" selection-start-line="84" selection-start-column="30" selection-end-line="84" selection-end-column="30" />
<state relative-caret-position="281">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/Oauth2Controller.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TTSResponse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="836">
<caret line="97" column="30" lean-forward="true" selection-start-line="97" selection-start-column="30" selection-end-line="97" selection-end-column="30" />
<state relative-caret-position="484">
<caret line="22" column="11" selection-start-line="22" selection-start-column="11" selection-end-line="22" selection-end-column="11" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/common/Utils.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/tts.properties">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="484">
<caret line="112" column="42" selection-start-line="112" selection-start-column="42" selection-end-line="112" selection-end-column="42" />
<state relative-caret-position="44">
<caret line="2" column="15" lean-forward="true" selection-start-line="2" selection-start-column="15" selection-end-line="2" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/ProductController.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTServiceUtil.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2128">
<caret line="130" column="9" selection-start-line="130" selection-start-column="9" selection-end-line="130" selection-end-column="9" />
<state relative-caret-position="140">
<caret line="80" column="23" selection-start-line="80" selection-start-column="23" selection-end-line="80" selection-end-column="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TTSRequest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="103" column="9" lean-forward="true" selection-start-line="103" selection-start-column="9" selection-end-line="103" selection-end-column="9" />
<state relative-caret-position="457">
<caret line="23" column="25" lean-forward="true" selection-start-line="23" selection-start-column="25" selection-end-line="23" selection-end-column="25" />
<folding>
<element signature="e#6036#6089#0" />
<element signature="e#10722#10835#0" />
<element signature="e#10473#10488#0" />
<element signature="e#13574#13639#0" />
<element signature="e#14045#14057#0" />
<element signature="e#16234#16259#0" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/home_load.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1430">
<caret line="65" column="32" lean-forward="true" selection-start-line="65" selection-start-column="32" selection-end-line="65" selection-end-column="32" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/resources/templates/Product.html">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSUtils.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="239" column="5" selection-start-line="239" selection-start-column="5" selection-end-line="239" selection-end-column="5" />
<state relative-caret-position="430">
<caret line="152" column="24" lean-forward="true" selection-start-line="152" selection-start-column="24" selection-end-line="152" selection-end-column="24" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/controller/XiaoDuController.java">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="28" column="13" selection-start-line="28" selection-start-column="13" selection-end-line="28" selection-end-column="13" />
<state relative-caret-position="452">
<caret line="313" column="23" selection-start-line="313" selection-start-column="19" selection-end-line="313" selection-end-column="23" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
......
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Properties;
public class MavenWrapperDownloader {
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: : " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
# TODO classpath?
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
wget "$jarUrl" -O "$wrapperJarPath"
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
curl -o "$wrapperJarPath" "$jarUrl"
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
echo Found %WRAPPER_JAR%
) else (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
echo Finished downloading %WRAPPER_JAR%
)
@REM End of extension
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>ai.qiwu.com</groupId>
<artifactId>tts_service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>tts_service</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>2.1.6.RELEASE</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.python/jython-standalone &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.python</groupId>-->
<!--<artifactId>jython-standalone</artifactId>-->
<!--<version>2.7.1</version>-->
<!--</dependency>-->
</dependencies>
<build>
<finalName>tts</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package ai.qiwu.com.tts_service;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@SpringBootApplication
@EntityScan(basePackages = {"ai.qiwu.com.tts_service.entity"})
@EnableJpaRepositories(basePackages = {"ai.qiwu.com.tts_service.repository"})
public class TtsServiceApplication {
public static void main(String[] args) {
SpringApplication.run(TtsServiceApplication.class, args);
}
}
package ai.qiwu.com.tts_service.common;
import lombok.extern.slf4j.Slf4j;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.Buffer;
import java.util.ArrayList;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-8-2 上午9:51
*/
@Slf4j
public class CallPython {
private static final String INTERPRETER = "/usr/bin/python3";
private static final String AUDIO_FILE = "/home/yf01/pythonWork/audio.py";
private static final String COMBINE_FILE = "/home/yf01/pythonWork/combine.py";
public static void changeSound(String wav_filename, String volume, String speed, String pitch, String filename) throws IOException {
String[] args = {INTERPRETER, AUDIO_FILE, wav_filename, volume, speed, pitch, filename};
Process process = Runtime.getRuntime().exec(args);
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
StringBuilder result = new StringBuilder();
while ((line = reader.readLine()) != null) {
result.append(line);
}
log.info("change Sound result:{}", result.toString());
reader.close();
}
public static void combine(List<String> file_ls, String tmp_audio_name) throws IOException {
StringBuilder builder = new StringBuilder();
for (String file : file_ls) builder.append(file).append(",");
String fileList = builder.toString().substring(0, builder.length()-1);
String[] args = {INTERPRETER, COMBINE_FILE, fileList, tmp_audio_name};
Process process = Runtime.getRuntime().exec(args);
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
StringBuilder result = new StringBuilder();
while ((line = reader.readLine()) != null) {
result.append(line);
}
log.info("combine result:{}", result.toString());
reader.close();
}
public static void changeSound() throws IOException {
String[] args = {INTERPRETER, "/home/yf01/pythonWork/hello.py", "1", "2"};
Process process = Runtime.getRuntime().exec(args);
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
StringBuilder result = new StringBuilder();
while ((line = reader.readLine()) != null) {
result.append(line);
}
log.info("result:{}", result.toString());
reader.close();
}
public static void main(String[] args) throws IOException {
String wav = "/usr/GameEditor/mqw/tts/audio/A04/正常/f403f73cff700be9c3fed05b67fc9ace.wav";
String mp3 = "/usr/GameEditor/mqw/tts/audio/A04/正常/f403f73cff700be9c3fed05b67fc9ace.mp3";
changeSound(wav, "0", "1.32", "0", mp3);
}
}
package ai.qiwu.com.tts_service.common;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.Properties;
/**
* @author 苗权威
* @dateTime 19-7-30 下午2:40
*/
@Slf4j
public class Config {
private static Properties properties;
static {
String filename = "tts.properties";
properties = new Properties();
try {
properties.load(new InputStreamReader(Config.class.getClassLoader().getResourceAsStream(filename), "UTF-8"));
} catch (IOException e) {
log.error("获取配置文件对象出错:{}", e.toString());
}
}
public static String getProperty(String key) {
String value = properties.getProperty(key.trim());
if (StringUtils.isBlank(value)) return null;
return value.trim();
}
public static String getProperty(String key, String defaultValue) {
String value = properties.getProperty(key.trim());
if (StringUtils.isBlank(value)) return defaultValue;
return value.trim();
}
}
package ai.qiwu.com.tts_service.common;
import lombok.Getter;
import lombok.Setter;
/**
* @author 苗权威
* @dateTime 19-7-31 上午10:04
*/
public enum ErrorMsgEnum {
FAIL_DEL_OFFLINE_BOT(1001, "删除offline地址的bot请求出错"),
FAIL_IN_CREATE_DIR(1002, "创建文件失败");
private int code;
private String msg;
ErrorMsgEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static String findMsgByCode(int code) {
for (ErrorMsgEnum item: ErrorMsgEnum.values()) {
if (item.getCode() == code) {
return item.getMsg();
}
}
return null;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package ai.qiwu.com.tts_service.common;
import ai.qiwu.com.tts_service.pojo.ResponseCodeWithData;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import okio.BufferedSink;
import okio.Okio;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* @author 苗权威
* @dateTime 19-7-18 上午10:54
*/
@Slf4j
public class OkHttp3Utils {
private static final OkHttpClient client = new OkHttpClient.Builder().connectTimeout(12, TimeUnit.SECONDS).build();
private static final OkHttpClient ShortTimeoutClient = new OkHttpClient.Builder().connectTimeout(3, TimeUnit.SECONDS).build();
public static String doGet(String url) throws IOException {
return doGet(url, new HashMap<>());
}
public static String doGet(String url, Map<String, String> params) throws IOException {
return doGet(url, params, new HashMap<>());
}
public static String doGet(String url, Map<String, String> params, Map<String, String> header) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
HttpUrl.Builder urlBuild = request.url().newBuilder();
Headers.Builder headerBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = header.entrySet().iterator();
headIterator.forEachRemaining(e -> headerBuilder.add(e.getKey(), e.getValue()));
Iterator<Map.Entry<String, String>> paramsIterator = params.entrySet().iterator();
paramsIterator.forEachRemaining(e -> urlBuild.addQueryParameter(e.getKey(), e.getValue()));
builder.url(urlBuild.build()).headers(headerBuilder.build());
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
public static String doPost(String url, Map<String, String> params) throws IOException {
return doPost(url, new HashMap<>(), params,null);
}
public static String doPost(String url, Map<String, String> params, Map<String, String> headers) throws IOException {
return doPost(url, headers, params, null);
}
public static String doPost(String url, File file) throws IOException {
return doPost(url , new HashMap<>(), new HashMap<>(), file);
}
public static String doPostJsonStr(String url, Map<String, String> headers, String requestJsonStr) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
builder.headers(headBuilder.build()).post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), requestJsonStr));
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
public static ResponseCodeWithData doPostTimeout(String url, Map<String, String> headers,
String requestJsonStr, File file, boolean longTime) throws IOException {
OkHttpClient timeoutClient;
if (longTime) {
timeoutClient = client;
} else {
timeoutClient = ShortTimeoutClient;
}
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
builder.headers(headBuilder.build()).post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), requestJsonStr));
ResponseCodeWithData codeWithData = null;
try (Response response = timeoutClient.newCall(builder.build()).execute()){
log.info("doPostTimeout请求返回:{}", response.code());
if (response.code() == 200) {
if (file != null) {
try (BufferedSink sink = Okio.buffer(Okio.sink(file))){
sink.writeAll(Objects.requireNonNull(response.body()).source());
codeWithData = new ResponseCodeWithData(response.code());
}
} else {
codeWithData = new ResponseCodeWithData(response.code(), response.body().string());
}
}
return codeWithData;
}
}
public static String doPost(String url, Map<String, String> headers, Map<String, String> params, File file) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
MultipartBody.Builder requestBuilder = new MultipartBody.Builder();
Iterator<Map.Entry<String, String>> paramsIterator = params.entrySet().iterator();
paramsIterator.forEachRemaining(e -> requestBuilder.addFormDataPart(e.getKey(), e.getValue()));
if (file != null) {
requestBuilder.addFormDataPart("uploadFiles", file.getName(),
RequestBody.create(MediaType.parse("application/octet-stream"), file));
}
builder.headers(headBuilder.build()).post(requestBuilder.build());
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
public static String doPost(String url, Map<String, String> headers, Map<String, String> params,
String fileName, byte[] fileByte) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
MultipartBody.Builder requestBuilder = new MultipartBody.Builder();
Iterator<Map.Entry<String, String>> paramsIterator = params.entrySet().iterator();
paramsIterator.forEachRemaining(e -> requestBuilder.addFormDataPart(e.getKey(), e.getValue()));
if (fileByte.length > 0) {
requestBuilder.addFormDataPart("uploadFiles", fileName,
RequestBody.create(MediaType.parse("application/octet-stream"), fileByte));
}
builder.headers(headBuilder.build()).post(requestBuilder.build());
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
public static String doPut(String url, Map<String, String> headers, String jsonStr) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
builder.headers(headBuilder.build()).put(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), jsonStr));
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
public static String doDelete(String url, Map<String, String> headers, String jsonStr) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
builder.headers(headBuilder.build()).delete(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), jsonStr));
try (Response response = client.newCall(builder.build()).execute()){
return response.body().string();
}
}
public static Integer deDeleteReturnCode(String url, Map<String, String> headers, String jsonStr) throws IOException {
Request.Builder builder = new Request.Builder();
Request request = builder.url(url).build();
Headers.Builder headBuilder = request.headers().newBuilder();
Iterator<Map.Entry<String, String>> headIterator = headers.entrySet().iterator();
headIterator.forEachRemaining(e -> headBuilder.add(e.getKey(), e.getValue()));
builder.headers(headBuilder.build()).delete(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), jsonStr));
try (Response response = client.newCall(builder.build()).execute()){
return response.code();
}
}
}
package ai.qiwu.com.tts_service.common;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author 苗权威
* @dateTime 19-7-31 下午2:30
*/
public interface TTSConstants {
String DEFAULT_MOOD = "正常";
}
package ai.qiwu.com.tts_service.common;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.DigestUtils;
import java.io.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.text.Format;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-7-30 下午5:39
*/
@Slf4j
public class TTSUtils {
private static final String STRIP = " /'\"";
public static boolean deleteFile(File file) {
if (!file.exists()) return false;
if (file.isDirectory()) {
File[] files = file.listFiles();
for (File f : files) deleteFile(f);
}
return file.delete();
}
public static boolean makedir(String path) {
File file = new File(path);
boolean createDirResult = false;
if (!file.exists() || file.isFile()) {
createDirResult = file.mkdirs();
}
log.info("要创建的文件夹路径:{}", path);
return createDirResult;
}
public static boolean createFile(String path) throws IOException {
File file = new File(path);
boolean createResult = false;
if (!file.exists() || file.isDirectory()) {
createResult = file.createNewFile();
}
return createResult;
}
public static File createFileReturnIts(String path) throws IOException {
File file = new File(path);
if (!file.exists() || file.isDirectory()) {
if (!file.createNewFile()) return null;
}
return file;
}
public static boolean createFile(String dir, String fileName) {
try {
makedir(dir);
} catch (Exception e) {
log.error("创建目录:{}失败", dir);
return false;
}
String file = buildMP3Filename(fileName);
String filePath = StringUtils.join(new String[]{dir, file}, File.separator);
boolean createFileResult;
try {
createFileResult = createFile(filePath);
} catch (Exception e) {
log.error("创建文件:{}出错:{}", fileName,e.toString());
return false;
}
if (!createFileResult) {
log.error("创建文件:{}失败", fileName);
}
return createFileResult;
}
public static String buildMP3Filename(String filename) {
String file = DigestUtils.md5DigestAsHex(filename.getBytes(StandardCharsets.UTF_8));
file = StringUtils.join(new String[]{file, "mp3"}, ".");
return file;
}
public static String pythonlistToStr(List<String> file_ls) {
StringBuilder builder = new StringBuilder("['");
for (String str : file_ls) {
builder.append(str).append("', '");
}
String bStr = builder.toString();
String res = bStr.substring(0, bStr.length()-3)+"]";
return buildMP3Filename(res);
}
public static boolean doesFileExist(String filePath) {
File file = new File(filePath);
return file.exists();
}
public static void cpContent(String src, String dest) {
try (BufferedInputStream input = new BufferedInputStream(new FileInputStream(new File(src)));
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dest))))){
byte[] buffer = new byte[1024];
int ln;
StringBuilder builder = new StringBuilder();
//builder.append("data:audio/mp3;base64,");
while ((ln = input.read(buffer)) != -1) {
byte[] encode = Base64.getEncoder().encode(Arrays.copyOf(buffer, ln));
builder.append(new String(encode,Charset.forName("utf-8")));
}
writer.write(builder.toString());
writer.flush();
} catch (Exception e) {
log.error("转移文件内容出错:{}", e.toString());
}
}
public static String readAllFile(String path) throws IOException {
try (BufferedInputStream input = new BufferedInputStream(new FileInputStream(new File(path)))){
byte[] buffer = new byte[1024];
int ln;
StringBuilder builder = new StringBuilder();
builder.append("data:audio/mp3;base64,");
while ((ln = input.read(buffer)) != -1) {
builder.append(new String(buffer, 0, ln));
}
return builder.toString();
}
}
public static String pythonStrip(String s) {
char[] chars = s.toCharArray();
int pre = 0, post = s.length()-1;
while (pre <= post && STRIP.contains(chars[pre]+"")) {
pre++;
}
while (post > pre && STRIP.contains(chars[post]+"")) {
post--;
}
return s.substring(pre, post+1);
}
public static String secure_fileName(String filename) {
filename = Normalizer.normalize(filename, Normalizer.Form.NFKD);
for (String sep : new String[]{"\\\\", "/", "\\.\\."}) {
filename = filename.replaceAll(sep, " ");
}
filename = StringUtils.join(filename.split(" "), "_");
return filename;
}
public static void main(String[] args) {
String s = " '//\"\"' /a/'sf'/\" ' ";
//System.out.println(pythonStrip(s));
String s2 = "fsf\\sf///sff../fs..f/gh\\/fg..";
//System.out.println(s2.replaceAll("\\\\", " "));
System.out.println(secure_fileName(s2));
}
}
package ai.qiwu.com.tts_service.common;
import ai.qiwu.com.tts_service.pojo.MP3Response;
import ai.qiwu.com.tts_service.pojo.ResponseStatusWithList;
import ai.qiwu.com.tts_service.pojo.TTSResponse;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-8-1 下午8:26
*/
@Slf4j
public class TTServiceUtil {
public static void buildOnlineCacheResponse(HttpServletResponse response, TTSResponse ttsResponse, int status) {
String ttsResJsonStr = JSON.toJSONString(ttsResponse);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=utf-8");
response.setStatus(status);
try (PrintWriter out = response.getWriter()){
out.append(ttsResJsonStr);
out.flush();
} catch (Exception e) {
log.error("获取PrintWriter出错:{}",e.toString());
}
}
public static void buildMp3Response(HttpServletResponse response, MP3Response mp3Response, String fileName, int status) {
response.setStatus(status);
if (mp3Response != null) {
String ttsResJsonStr = JSON.toJSONString(mp3Response);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=utf-8");
try (PrintWriter out = response.getWriter()){
out.append(ttsResJsonStr);
out.flush();
} catch (Exception e) {
log.error("获取PrintWriter出错:{}",e.toString());
}
} else {
try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(fileName));
OutputStream out = new BufferedOutputStream(response.getOutputStream())){
response.reset();
response.setContentType("audio/mp3");
byte[] buffer = new byte[1024];
int ln;
while ((ln = inputStream.read(buffer)) != -1) {
out.write(buffer, 0, ln);
}
out.flush();
} catch (Exception e) {
log.error("写入音频流到HttpServletResponse失败:{}", e.toString());
}
}
}
public static void buildTTS_lsResponse(HttpServletResponse servletResponse, TTSResponse ttsResponse, List<String> list, int status) {
servletResponse.setStatus(status);
String ttsResJsonStr;
if (ttsResponse != null) {
ttsResJsonStr = JSON.toJSONString(ttsResponse);
} else {
ResponseStatusWithList statusWithList = new ResponseStatusWithList(200, list);
ttsResJsonStr = JSON.toJSONString(statusWithList);
}
servletResponse.setCharacterEncoding("UTF-8");
servletResponse.setContentType("application/json;charset=utf-8");
try (PrintWriter out = servletResponse.getWriter()){
out.append(ttsResJsonStr);
out.flush();
} catch (Exception e) {
log.error("获取PrintWriter出错:{}",e.toString());
}
}
public static void buildServletResponse(HttpServletResponse servletResponse, TTSResponse ttsResponse, File file, int status) {
servletResponse.setStatus(status);
if (ttsResponse == null) {
try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(file));
OutputStream out = new BufferedOutputStream(servletResponse.getOutputStream())){
servletResponse.reset();
servletResponse.setContentType("audio/mp3");
byte[] buffer = new byte[1024];
int ln;
while ((ln = inputStream.read(buffer)) != -1) {
out.write(buffer, 0, ln);
}
out.flush();
} catch (Exception e) {
log.error("写入音频流到HttpServletResponse失败:{}", e.toString());
}
} else {
String ttsResJsonStr = JSON.toJSONString(ttsResponse);
servletResponse.setCharacterEncoding("UTF-8");
servletResponse.setContentType("application/json;charset=utf-8");
try (PrintWriter out = servletResponse.getWriter()){
out.append(ttsResJsonStr);
out.flush();
} catch (Exception e) {
log.error("获取PrintWriter出错:{}",e.toString());
}
}
}
}
package ai.qiwu.com.tts_service.controller;
import ai.qiwu.com.tts_service.common.Config;
import ai.qiwu.com.tts_service.pojo.*;
import ai.qiwu.com.tts_service.service.TTService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
/**
* @author 苗权威
* @dateTime 19-7-30 下午5:49
*/
@RestController
@Slf4j
@RequestMapping("/mqw")
public class TTSController {
// @Autowired
private final TTService ttService;
@Autowired
public TTSController(TTService ttService) {
this.ttService = ttService;
}
@DeleteMapping("/online_cache")
public void online_cache(@RequestBody OnlineCache onlineCache, HttpServletResponse response) {
ttService.online_cache(onlineCache, response);
}
@GetMapping("/api/speakers")
public SpeakersApiRes speakers_api() {
return new SpeakersApiRes(Config.getProperty("online_sever"), Config.getProperty("offline_server"));
}
@GetMapping("/api/tts")
public void tts(@RequestParam(required = false) String person, @RequestParam(required = false) String tone,
@RequestParam(required = false) String text, @RequestParam(required = false) String botname,
@RequestParam(required = false) String _type, @RequestParam(required = false) String volume,
@RequestParam(required = false) String pitch, @RequestParam(required = false) String speed,
HttpServletResponse servletResponse) {
TTSRequest ttsRequest = new TTSRequest(person, text, _type, pitch, tone, botname, volume, speed);
ttService.tts(ttsRequest, "GET", servletResponse);
}
@PostMapping("/api/tts")
public void tts(@RequestBody TTSRequest ttsRequest, HttpServletResponse response) {
ttService.tts(ttsRequest, "POST", response);
}
@PutMapping("/api/tts")
public void tts(HttpServletResponse response, @RequestBody TTSRequest ttsRequest) {
ttService.tts(ttsRequest, "PUT", response);
}
@PostMapping("/api/tts_ls")
public void tts_ls(@RequestBody TTSLSRequest request, HttpServletResponse response) {
ttService.tts_ls(request, response);
}
@GetMapping("/api/tts/get_audio")
public void mp3(@RequestParam(required = false) String dirs, @RequestParam(required = false) String filename,
@RequestParam(required = false) String _type, HttpServletResponse response) {
ttService.mp3(dirs, filename, _type, response);
}
@PostMapping("/api/chatbot")
public ChatBotResponse chatbot(@RequestBody ChatBotRequest request) {
return ttService.chatbot(request);
}
}
package ai.qiwu.com.tts_service.entity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.AbstractPersistable;
import javax.persistence.*;
/**
* @author 苗权威
* @dateTime 19-7-30 下午1:24
*/
@Entity
@Table(name = "speakers_info")
@Getter
@Setter
@ToString
public class SpeakersInfo {
@Id
@GeneratedValue
private Integer id;
@Column
private String person;
@Column
private String name;
@Column
private String sex;
@Column
private String mood;
@Column(name = "model_name")
private String modelName;
@Column
private Integer jump; // null
@Column
private String hparams; //''
@Column(name = "with_online")
private Integer withOnline; // 0
@Column(name = "is_delete")
private String isDelete; //'0'
}
package ai.qiwu.com.tts_service.pojo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-8-1 下午8:14
*/
@Getter
@Setter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class ChatBotRequest {
private String user_id;
private String text;
private String _type;
public ChatBotRequest(String user_id, String text, String _type) {
this.user_id = user_id;
this.text = text;
this._type = _type;
}
}
package ai.qiwu.com.tts_service.pojo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-8-1 下午8:18
*/
@Getter
@Setter
@ToString
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class ChatBotResponse {
private String text;
private String audio;
public ChatBotResponse(String text) {
this.text = text;
}
public ChatBotResponse(String text, String audio) {
this.text = text;
this.audio = audio;
}
}
package ai.qiwu.com.tts_service.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-31 下午1:34
*/
@Getter
@Setter
@ToString
public class GeneralMP3Data {
private String server;
private String text;
private String person;
private String tone;
private String botname;
private Boolean cache;
private Double volume;
private Double speed;
private Double pitch;
private String format;
public GeneralMP3Data(String server, String text, String person, String tone, String botname,
Boolean cache, Double volume, Double speed, Double pitch) {
this.server = server;
this.text = text;
this.person = person;
this.tone = tone;
this.botname = botname;
this.cache = cache;
this.volume = volume;
this.speed = speed;
this.pitch = pitch;
}
}
package ai.qiwu.com.tts_service.pojo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-8-1 下午5:32
*/
@Getter
@Setter
@ToString
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class MP3Response {
private Integer status;
private String message;
public MP3Response(Integer status, String message) {
this.status = status;
this.message = message;
}
public MP3Response(Integer status) {
this.status = status;
}
}
package ai.qiwu.com.tts_service.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-30 下午6:46
*/
@Getter
@Setter
@ToString
public class OnlineCache {
private String botname;
private String server;
}
package ai.qiwu.com.tts_service.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.ArrayList;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-7-30 下午3:27
*/
@Getter
@Setter
@ToString
public class PersonInfo {
private String name;
private String sex;
private List<String> mood = new ArrayList<>();
public PersonInfo(String name, String sex) {
this.name = name;
this.sex = sex;
}
}
package ai.qiwu.com.tts_service.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-31 下午2:24
*/
@Getter
@Setter
@ToString
public class ResponseCodeWithData {
private int code;
private String res;
public ResponseCodeWithData(int code, String res) {
this.code = code;
this.res = res;
}
public ResponseCodeWithData(int code) {
this.code = code;
}
}
package ai.qiwu.com.tts_service.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-8-1 下午3:52
*/
@Getter
@Setter
@ToString
public class ResponseStatusWithList {
private Integer status;
private List<String> audio;
public ResponseStatusWithList(Integer status, List<String> audio) {
this.status = status;
this.audio = audio;
}
}
package ai.qiwu.com.tts_service.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-30 下午8:29
*/
@Getter
@Setter
@ToString
public class SpeakersApiRes {
private String online;
private String offline;
public SpeakersApiRes(String online, String offline) {
this.online = online;
this.offline = offline;
}
}
package ai.qiwu.com.tts_service.pojo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-8-1 上午10:38
*/
@Getter
@Setter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class TTSLSRequest {
private String _type;
private String platform;
private List<TextInfo> text_info_ls;
private String botname;
private String person;
}
package ai.qiwu.com.tts_service.pojo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-30 下午8:44
*/
@Getter
@Setter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class TTSRequest {
private String person;
private String text;
private String _type;
private String pitch;
private String tone;
private String botname;
private String volume;
private String speed;
public TTSRequest(String person, String text, String _type, String pitch,
String tone, String botname, String volume, String speed) {
this.person = person;
this.text = text;
this._type = _type;
this.pitch = pitch;
this.tone = tone;
this.botname = botname;
this.volume = volume;
this.speed = speed;
}
}
package ai.qiwu.com.tts_service.pojo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-7-30 下午6:53
*/
@Getter
@Setter
@ToString
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class TTSResponse {
private Integer status;
private String message;
private String audio;
public TTSResponse(Integer status, String message) {
this.status = status;
this.message = message;
}
public TTSResponse(Integer status) {
this.status = status;
}
}
package ai.qiwu.com.tts_service.pojo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-8-1 上午10:40
*/
@Getter
@Setter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class TextInfo {
private String person;
private String text;
private String tone;
private String volume;
private String pitch;
private String speed;
private Boolean cache;
private String server;
private String botname;
}
package ai.qiwu.com.tts_service.repository;
import ai.qiwu.com.tts_service.entity.SpeakersInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-7-30 下午2:07
*/
public interface SpeakerInfoRepository extends JpaRepository<SpeakersInfo, Integer> {
List<SpeakersInfo> findByIsDelete(String isDelete);
}
package ai.qiwu.com.tts_service.service;
import ai.qiwu.com.tts_service.common.Config;
import ai.qiwu.com.tts_service.common.TTSConstants;
import ai.qiwu.com.tts_service.pojo.PersonInfo;
import ai.qiwu.com.tts_service.entity.SpeakersInfo;
import ai.qiwu.com.tts_service.repository.SpeakerInfoRepository;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author 苗权威
* @dateTime 19-7-30 下午5:05
*/
@Component
@Slf4j
public class Initialize implements InitializingBean {
private String init_person = "B05";
private String init_tone = "正常";
private String init_url;
private static final List<String> URL_LS;
private static final Map<String, PersonInfo> PERSON_INFO_ONLINE; //speakers_online
private static final Map<String, PersonInfo> PERSON_INFO_OFFLINE; //speakers_offline
private static final Map<String, Map<String, String>> PERSON_MOODURL; //api
private static final Map<String, Map<String, String>> OFFLINE_2_ONLINE;
private final SpeakerInfoRepository speakerInfoRepository;
static {
URL_LS = new ArrayList<>();
PERSON_INFO_ONLINE = new HashMap<>();
PERSON_INFO_OFFLINE = new HashMap<>();
PERSON_MOODURL = new HashMap<>();
OFFLINE_2_ONLINE = new HashMap<>();
}
@Autowired
public Initialize(SpeakerInfoRepository speakerInfoRepository) {
this.speakerInfoRepository = speakerInfoRepository;
}
private void initialize(SpeakersInfo speakerInfo) {
String name = speakerInfo.getName();
String sex = speakerInfo.getSex();
String mood = speakerInfo.getMood();
Integer jump = speakerInfo.getJump();
Integer withOnLine = speakerInfo.getWithOnline();
String person = speakerInfo.getPerson();
String person_offline = person+"_offline";
if (withOnLine != null && withOnLine != 0) {
String url = String.format("%s:9%03d/synthesize", Config.getProperty("online_sever"), speakerInfo.getId());
URL_LS.add(url);
if (StringUtils.isBlank(init_person)) {
init_person = person;
}
PersonInfo personInfo_online = PERSON_INFO_ONLINE.computeIfAbsent(person, k -> new PersonInfo(name, sex));
personInfo_online.getMood().add(mood);
Map<String, String> mood_url = PERSON_MOODURL.computeIfAbsent(person, k -> new HashMap<>());
mood_url.put(mood, url);
}
PersonInfo personInfo_offline = PERSON_INFO_OFFLINE.computeIfAbsent(person_offline, k -> new PersonInfo(name, sex));
personInfo_offline.getMood().add(mood);
if (jump != null) {
Map<String, String> mood2jumpUrl = OFFLINE_2_ONLINE.computeIfAbsent(person_offline, k -> new HashMap<>());
mood2jumpUrl.put(mood, String.format("%s:9%03d/synthesize", Config.getProperty("online_sever"), jump));
}
Map<String, String> mood_url = PERSON_MOODURL.computeIfAbsent(person_offline, k -> new HashMap<>());
mood_url.putIfAbsent(mood, String.format("%s/synthesize", Config.getProperty("offline_server")));
}
@Override
public void afterPropertiesSet() throws Exception {
List<SpeakersInfo> speakerInfos = speakerInfoRepository.findByIsDelete("0");
for (SpeakersInfo speakerInfo: speakerInfos) {
initialize(speakerInfo);
}
if (!PERSON_INFO_ONLINE.containsKey(init_person)) {
init_person = PERSON_INFO_ONLINE.keySet().iterator().next();
}
List<String> moodList = PERSON_INFO_ONLINE.get(init_person).getMood();
if (!moodList.contains(init_tone)) {
init_tone = moodList.get(0);
}
init_url = PERSON_MOODURL.get(init_person).get(init_tone);
log.info("url_ls:{}", URL_LS);
log.info("PERSON_INFO_ONLINE:{}", PERSON_INFO_ONLINE);
log.info("PERSON_INFO_OFFLINE:{}", PERSON_INFO_OFFLINE);
log.info("OFFLINE2ONLINE:{}", OFFLINE_2_ONLINE);
log.info("PERSON_MODELURL:{}", PERSON_MOODURL);
}
String getInit_person() {
return init_person;
}
Map<String, Map<String, String>> getPersonMoodurl() {
return PERSON_MOODURL;
}
String getDefault_tone() {
return TTSConstants.DEFAULT_MOOD;
}
String getInit_tone() {
return init_tone;
}
Map<String, String> getThePersonJumpUrls(String person) {
return OFFLINE_2_ONLINE.get(person);
}
boolean doesThisMoodUrlWithOnline0(String url) {
return !URL_LS.contains(url);
}
String getInit_url() {
return init_url;
}
}
package ai.qiwu.com.tts_service.service;
import ai.qiwu.com.tts_service.common.*;
import ai.qiwu.com.tts_service.pojo.*;
import ai.qiwu.com.tts_service.repository.SpeakerInfoRepository;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.*;
/**
* @author 苗权威
* @dateTime 19-7-30 下午2:29
*/
@Service
@Slf4j
public class TTService {
private final Initialize initialize;
private final String offlineService;
@Autowired
public TTService(Initialize initialize) {
this.initialize = initialize;
this.offlineService = String.format("%s/synthesize", Config.getProperty("offline_server"));
}
public ChatBotResponse chatbot(ChatBotRequest request) {
String userId = request.getUser_id();
String text = request.getText();
log.info("userId:{},text:{}", userId, text);
if ("退出文艺平台".equals(text) || "退出文艺大厅".equals(text)) {
return new ChatBotResponse("<exit>退出</exit>");
}
String filename = "TTS_test.mp3";
if ("file".equals(request.get_type())) filename += "&_type=file";
String audio = "http://aliyun-hz1.chewrobot.com:9663/api/tts/get_audio?filename="+URLEncoder.encode(filename);
return new ChatBotResponse(text, audio);
}
public void online_cache(OnlineCache onlineCache, HttpServletResponse response) {
String botName = onlineCache.getBotname();
if (StringUtils.isEmpty(botName)) {
TTServiceUtil.buildOnlineCacheResponse(response, new TTSResponse(401, "no botName"), 401);
return;
}
String bot_dir = Config.getProperty("audio_dir")+ File.separator+botName;
File deleteBotDir = new File(bot_dir);
try {
TTSUtils.deleteFile(deleteBotDir);
} catch (Exception e) {
log.warn("删除文件出错:{}", e.toString());
}
onlineCache.setServer(Config.getProperty("server_name"));
String offlineStr = JSON.toJSONString(onlineCache);
int deleteOfflineResCode;
try {
deleteOfflineResCode = OkHttp3Utils.deDeleteReturnCode(String.format("%s/online_cache",
Config.getProperty("offline_server")), new HashMap<>(), offlineStr);
} catch (IOException e) {
log.error("删除offline地址的bot请求出错:{}", e.toString());
deleteOfflineResCode = 500;
}
TTServiceUtil.buildOnlineCacheResponse(response, new TTSResponse(deleteOfflineResCode, "no botName"), deleteOfflineResCode);
}
/**
* 参数dirs与filename指向一个mp3音频文件,返回该文件内容数据
* @param dirs mp3音频文件路径
* @param filename mp3音频文件名称
* @param _type
* @param response
*/
public void mp3(String dirs, String filename, String _type, HttpServletResponse response) {
if (dirs != null) {
String dir_text = dirs;
if ("..".equals(dir_text) || StringUtils.startsWith(dir_text, "/")) {
TTServiceUtil.buildMp3Response(response, new MP3Response(400, "参数设置有误,不能包含..或是以/开头"), null, 400);
return;
}
if (StringUtils.startsWith(dir_text, "[") && StringUtils.endsWith(dir_text, "]")) {
dir_text = dir_text.substring(1, dir_text.length()-1);
List<String> dir_ls = new ArrayList<>();
for (String dir : dir_text.split(",")) {
dir_ls.add(TTSUtils.pythonStrip(dir));
}
if (StringUtils.startsWith(dir_ls.get(0), "/")) {
TTServiceUtil.buildMp3Response(response, new MP3Response(400, "参数设置有误,参数形式如下[/,..]"), null, 400);
return;
}
dirs = StringUtils.join(dir_ls, "/");
}
//去除 \\ / ..
else dirs = TTSUtils.secure_fileName(dir_text);
}
log.info("filename:{}",filename);
if (StringUtils.endsWith(filename,".mp3")) {
filename = StringUtils.join(new String[]{Config.getProperty("audio_dir"), dirs, filename}, File.separator);
log.info("filename:{}",filename);
if (TTSUtils.doesFileExist(filename)) {
if ("file".equals(_type)) {
TTServiceUtil.buildMp3Response(response, null, filename, 200);
return;
}
TTServiceUtil.buildMp3Response(response, null, filename, 200);
return;
}
}
TTServiceUtil.buildMp3Response(response, new MP3Response(400), null, 400);
}
public void tts_ls(TTSLSRequest request, HttpServletResponse response) {
log.info("TTSLSRequest:{}", request);
String _type = request.get_type();
String platform = request.getPlatform();
List<TextInfo> infoList = request.getText_info_ls();
String botName = request.getBotname();
ExecutorService executor = null;
List<Future<ResponseCodeWithData>> futures = new ArrayList<>();
List<String> file_ls = new ArrayList<>();
if (infoList != null) {
if (infoList.size() > 1) executor = Executors.newFixedThreadPool(infoList.size());
for (TextInfo info : infoList) {
String person = info.getPerson() == null ? initialize.getInit_person() : info.getPerson();
if (!initialize.getPersonMoodurl().containsKey(person)) person = initialize.getInit_person();
log.info("person:{}",person);
String text = info.getText();
if (StringUtils.isBlank(text)) continue;
String tone = info.getTone() == null ? initialize.getInit_tone() : info.getTone();
Map<String, String> moodUrlMap = initialize.getPersonMoodurl().get(person);
if (!moodUrlMap.containsKey(tone)) tone = initialize.getDefault_tone();
if (!moodUrlMap.containsKey(tone)) {
if (person.equals(initialize.getInit_person())) tone = initialize.getInit_tone();
else tone = moodUrlMap.keySet().iterator().next();
}
log.info("mood:{}",tone);
String url = moodUrlMap.get(tone);
log.info("mood->url:{}", url);
double volume = Double.parseDouble(info.getVolume() == null ? "0" : info.getVolume());
double pitch = Double.parseDouble(info.getPitch() == null ? "0" : info.getVolume());
double speed = Double.parseDouble(info.getSpeed() == null ? "1" : info.getVolume());
String[] parents;
if (StringUtils.isBlank(botName)) {
parents = new String[]{Config.getProperty("audio_dir"), person, tone};
}else {
parents = new String[]{Config.getProperty("audio_dir"), botName, person, tone};
}
String folder = StringUtils.join(parents, File.separator);
TTSUtils.makedir(folder);
String filepath = String.format("%s/%s", folder, TTSUtils.buildMP3Filename(text));
log.info("tts_ls方法:filepath:{}", filepath);
if (!TTSUtils.doesFileExist(filepath)) {
log.info("general mp3");
GeneralMP3Data data = new GeneralMP3Data(Config.getProperty("server_name"), text,
person, tone, botName, true, volume, speed, pitch);
if (executor != null) {
String path = filepath;
Future<ResponseCodeWithData> future = executor.submit(() -> generalMP3(url, data, path, "GET"));
futures.add(future);
}
else {
ResponseCodeWithData codeWithData = generalMP3(url, data, filepath, "GET");
if (codeWithData.getCode() != 200) {
log.error("下载:{}音频失败, status:{}", url, codeWithData.getCode());
TTServiceUtil.buildTTS_lsResponse(response, new TTSResponse(codeWithData.getCode()), null, codeWithData.getCode());
return;
}
}
}
if ("filename".equals(_type) && !"xiaoai".equals(platform)) {
filepath = filepath+".b64";
}
file_ls.add(filepath);
}
log.info("182:file list:{}", file_ls);
for (Future<ResponseCodeWithData> future : futures) {
try {
ResponseCodeWithData data = future.get(36, TimeUnit.SECONDS);
if (data.getCode() != 200) {
log.error("下载:{}音频失败, status:{}", data.getCode());
TTServiceUtil.buildTTS_lsResponse(response, new TTSResponse(data.getCode()), null, data.getCode());
return;
}
} catch (InterruptedException | ExecutionException | TimeoutException e) {
log.error("获取结果出错:{}", e.toString());
TTServiceUtil.buildTTS_lsResponse(response, new TTSResponse(400), null, 400);
return;
}
}
if ("xiaoai".equals(platform)) {
String tmp_name = TTSUtils.pythonlistToStr(file_ls);
String[] parents;
if (StringUtils.isBlank(botName)) {
parents = new String[]{Config.getProperty("audio_dir"), "xiaoai"};
}else {
parents = new String[]{Config.getProperty("audio_dir"), botName, "xiaoai"};
}
String folder = StringUtils.join(parents, File.separator);
String dirs = String.format("[%s,xiaoai]", botName);
String tmp_audio_name = String.format("%s/%s", folder, tmp_name);
log.info("小爱tmp_audio_name:{}", tmp_audio_name);
try {
if (!TTSUtils.doesFileExist(tmp_audio_name)) {
TTSUtils.makedir(folder);
log.info("调用python的combine");
CallPython.combine(file_ls, tmp_audio_name);
}
String audio = "http://aliyun-hz1.chewrobot.com:9663/api/tts/get_audio?dirs=%s&filename=%s";
TTServiceUtil.buildTTS_lsResponse(response, new TTSResponse(200, String.format(audio, URLEncoder.encode(dirs),
URLEncoder.encode(tmp_name))), null, 200);
} catch (Exception e) {
log.error("调用python的combine出错:{}", e.toString());
}
}
else {
for (String filename : file_ls) {
String filename_64 = StringUtils.endsWith(filename, ".b64") ? filename : filename+".b64";
if (!TTSUtils.doesFileExist(filename_64)) {
log.info("225:文件:{}不存在",filename_64);
TTSUtils.cpContent(filename_64.substring(0, filename_64.length()-4), filename_64);
}
}
if ("filename".equals(_type)) {
TTServiceUtil.buildTTS_lsResponse(response, null, file_ls, 200);
return;
}
List<String> contents = new ArrayList<>();
for (String filename : file_ls) {
filename = filename+".b64";
try {
contents.add(TTSUtils.readAllFile(filename));
} catch (Exception e) {
log.error("读取文件{}内容出错:{}", filename, e.toString());
}
}
TTServiceUtil.buildTTS_lsResponse(response, null, contents, 200);
}
}
}
/**
* 该方法就是根据请求信息下载音频数据,生成.mp3文件,若_type是json则返回获取该生成后的.mp3文件的请求URL,
* 否则返回该.mp3文件的内容数据
* @param ttsRequest 请求信息
* @param requestMethod 请求方法
* @param servletResponse
*/
public void tts(TTSRequest ttsRequest, String requestMethod, HttpServletResponse servletResponse) {
// 获取person,没有或数据库中不存在,则付值 init_person
String person = ttsRequest.getPerson();
if (person == null || !initialize.getPersonMoodurl().containsKey(person)) person = initialize.getInit_person();
log.info("257:person:{}", person);
// 获取mood 没有或数据库对应person中不存在 则赋值default_mood
String mood = ttsRequest.getTone();
Map<String, String> particularPersonMoodUrl = initialize.getPersonMoodurl().get(person);
if (mood == null || !particularPersonMoodUrl.containsKey(mood)) mood = initialize.getDefault_tone();
//如果person不存在该mood,若person为init_person则赋值init_mood,否则随机返回一个该person的mood
if (!particularPersonMoodUrl.containsKey(mood)) {
if (person.equals(initialize.getInit_person())) {
mood = initialize.getInit_tone();
}else {
mood = particularPersonMoodUrl.keySet().iterator().next();
}
}
log.info("268:tone:{}",mood);
// 获取该person的mood的音频地址
String moodUrl = particularPersonMoodUrl.get(mood);
log.info("270:moodurl:{}", moodUrl);
// text字段不能为空
String text = ttsRequest.getText();
if (StringUtils.isBlank(text)) {
TTServiceUtil.buildServletResponse(servletResponse, new TTSResponse(404, "文本不能为空"), null, 404);
return;
}
double volume = Double.parseDouble(ttsRequest.getVolume() == null ? "0" : ttsRequest.getVolume());
double pitch = Double.parseDouble(ttsRequest.getPitch() == null ? "0" : ttsRequest.getVolume());
double speed = Double.parseDouble(ttsRequest.getSpeed() == null ? "1" : ttsRequest.getVolume());
// botname为空则赋予tmp
String botName = ttsRequest.getBotname();
if (StringUtils.isBlank(botName)) {
botName = "tmp";
}
// (audio_dir)/botname/person/mood目录
String folder = StringUtils.join(new String[]{Config.getProperty("audio_dir"), botName, person, mood}, File.separator);
TTSUtils.makedir(folder);
String fileName = TTSUtils.buildMP3Filename(ttsRequest.getText());
// (audio_dir)/botname/person/mood/xxx.mp3文件路径
String filePath = StringUtils.join(new String[]{folder, fileName}, File.separator);
log.info("filepath:{}", filePath);
TTSResponse response = null;
// _type为json,则构建请求get_audio接口的信息
if ("json".equals(ttsRequest.get_type())) {
String dirs = String.format("[%s,%s,%s]", botName, person, mood);
//http://(server_url)/api/tts/get_audio?dirs=[botname+person,mood]&filename=xxx.mp3
String audio = String.format("http://%s/api/tts/get_audio?dirs=%s&filename=%s", Config.getProperty("server_url"),
dirs, fileName);
try {
audio = URLEncoder.encode(audio, "utf-8"); // 编码URL中的中文
response = new TTSResponse(200, audio);
} catch (UnsupportedEncodingException e) {
log.error("URLEncoding编码出错:{}", e.toString());
response = new TTSResponse(500, "编码URL中的中文出错");
}
}
// filepath文件不存在或是put请求,调用generalMP3生成该filepath所指的mp3文件
if (!TTSUtils.doesFileExist(filePath) || requestMethod.equals("PUT")){
GeneralMP3Data data = new GeneralMP3Data(Config.getProperty("server_name"), ttsRequest.getText(),
person, mood, botName, true, volume, speed, pitch);
ResponseCodeWithData codeWithData = generalMP3(moodUrl, data, filePath, requestMethod);
if (codeWithData.getCode() != 200) {
log.error("下载:{}音频失败", moodUrl);
TTServiceUtil.buildServletResponse(servletResponse, new TTSResponse(codeWithData.getCode()), null, codeWithData.getCode());
return;
}
}
if (response == null) {
TTServiceUtil.buildServletResponse(servletResponse, null, new File(filePath), 200);
} else {
TTServiceUtil.buildServletResponse(servletResponse, response, null, 200);
}
}
/**
* 若文件已存在则不进行覆盖,除非是put更新请求.
* 首先从音频下载地址下载数据到本地,文件地址为filepath(该文件原指的是mp3文件,先改为wav文件),
* 该下载好的wav文件经过python的change_sound方法生成mp3文件,该文件即filepath.
*
* @param url 音频下载地址
* @param data 请求信息
* @param filePath mp3文件的地址
* @param requestMethod 请求方法
* @return 返回状态码,调用方法通过此来判断方法是否成功
*/
private ResponseCodeWithData generalMP3(String url, GeneralMP3Data data, String filePath, String requestMethod) {
ResponseCodeWithData res = null;
String wavFilename = filePath.substring(0, filePath.length()-4)+".wav";
if (!TTSUtils.doesFileExist(wavFilename)) {
data.setFormat("wav");
boolean longTime = true;
if (url.equals(offlineService)) {
longTime = false;
}
res = requestTemplate(url, data, wavFilename, longTime);
if (res.getCode() != 200) {
log.error("请求线上地址,下载音频文件:{},失败:{}",wavFilename,res);
return res;
}
}
if (requestMethod.equals("PUT") || (!TTSUtils.doesFileExist(filePath) && !offlineService.equals(url))) {
try {
CallPython.changeSound(wavFilename, String.valueOf(data.getVolume()), String.valueOf(data.getSpeed()),
String.valueOf(data.getPitch()), filePath);
} catch (Exception e) {
log.error("调用python的changeSound出错:{}", e.toString());
res = new ResponseCodeWithData(500);
}
}
// 如果url是线下地址:http://aliyun-hz1.chewrobot.com:9001/synthesize 且xx.mp3文件不存在,则直接下载
else if (!TTSUtils.doesFileExist(filePath) && offlineService.equals(url)) {
data.setFormat("mp3");
res = requestTemplate(url , data, filePath, false);
if (res.getCode() != 200) {
log.error("线下请求音频文件:{},失败:{}",filePath, res);
}
}
return res;
}
/**
* 下载音频文件或只是普通的post请求,失败尝试次数3
* @param url 音频请求地址
* @param data 请求信息
* @param filePath 文件地址
* @param longTime 线下测试超时为3s,线上为12s
* @return 返回状态码,调用方法通过此来判断方法是否成功
*/
private ResponseCodeWithData requestTemplate(String url, GeneralMP3Data data, String filePath, boolean longTime) {
String dataStr = JSON.toJSONString(data);
log.info("GeneralMP3Data:{}", dataStr);
ResponseCodeWithData res = null;
File mp3File = null;
for (int i = 0; i < 3; i++) {
try {
if (filePath != null) {
mp3File = TTSUtils.createFileReturnIts(filePath);
res = OkHttp3Utils.doPostTimeout(url, new HashMap<>(), dataStr, mp3File, longTime);
} else {
res = OkHttp3Utils.doPostTimeout(url, new HashMap<>(), dataStr, null, longTime);
}
} catch (Exception e) {
log.error("第{}次失败,原因{}", i+1, e.toString());
continue;
}
int resCode = res.getCode();
if (resCode == 200) {
return res;
}
else if (resCode == 404 && url.equals(offlineService)) {
String person = data.getPerson();
String mood = data.getTone();
try {
url = "";
Map<String, String> moodJumpUrl = initialize.getThePersonJumpUrls(person);
if (moodJumpUrl != null) {
if ((url = moodJumpUrl.get(mood)) == null) url = "";
}
if (initialize.doesThisMoodUrlWithOnline0(url)) {
url = initialize.getInit_url();
}
res = requestLongTimeout(url, dataStr, mp3File);
} catch (Exception e) {
log.error("person:{},mood:{}, url not found", person, mood);
res = null;
break;
}
}
}
if (res == null) {
log.error("请求无法获取到结果,该请求信息是:{}", data.toString());
return new ResponseCodeWithData(402, null);
}
if (res.getCode() != 200) {
log.info("请求不成功,该请求信息是:{}", data.toString());
}
return res;
}
/**
* 线下请求超时的话尝试将时间延长为12s再次进行请求,失败尝试次数3
* @param url 音频请求地址
* @param dataJsonStr 请求信息
* @param file 是否是下载音频文件的请求
* @return 返回状态码,调用方法通过此来判断方法是否成功
*/
private ResponseCodeWithData requestLongTimeout(String url, String dataJsonStr, File file) {
ResponseCodeWithData res = null;
for (int i = 0; i < 3; i++) {
try {
if (file != null) {
res = OkHttp3Utils.doPostTimeout(url, new HashMap<>(), dataJsonStr, file, true);
}else {
res = OkHttp3Utils.doPostTimeout(url, new HashMap<>(), dataJsonStr, null, true);
}
} catch (Exception e) {
log.error("第{}次失败,原因{}", i+1, e.toString());
continue;
}
int resCode = res == null ? 500 : res.getCode();
if (resCode == 200) {
break;
}
}
if (res == null) {
log.error("请求无法获取到结果:{},该请求信息是:{}", url,dataJsonStr);
}
return res;
}
}
spring:
datasource:
# url: jdbc:mysql://localhost:3306/TTS
username: tts
password: qiwu@123234aA~
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://aliyun-hz1.chewrobot.com:3306/TTS
jpa:
database: mysql
#控制台显示SQL
show-sql: true
hibernate:
ddl-auto: none
output:
ansi:
enabled: detect
#logging:
# level: info
# path: /usr/mqw/logs/tts
server:
port: 8088
online_sever=http://dev01.centaurstech.com
offline_server=http://aliyun-hz1.chewrobot.com:9001
server_name=hz1
#audio_dir=/root/GameEditor/mqw/tts/audio
audio_dir=/usr/GameEditor/mqw/tts/audio
server_url=aliyun-hz1.chewrobot.com:9663
\ No newline at end of file
package ai.qiwu.com.tts_service;
import ai.qiwu.com.tts_service.common.TTSUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.DigestUtils;
import java.nio.charset.StandardCharsets;
@RunWith(SpringRunner.class)
@SpringBootTest
public class TtsServiceApplicationTests {
@Test
public void contextLoads() {
}
@Test
public void createFileTest() {
String fileName = DigestUtils.md5DigestAsHex("text".getBytes(StandardCharsets.UTF_8));
fileName = StringUtils.join(new String[]{fileName, "mp3"}, ".");
boolean result = TTSUtils.createFile("/usr/springbootdemo/优美/A307/女声高兴", fileName);
System.out.println(result);
}
}
......@@ -11,7 +11,7 @@
<groupId>ai.qiwu.baidu</groupId>
<artifactId>xiaodu</artifactId>
<version>0.0.1-SNAPSHOT</version>
<!--<packaging>war</packaging>-->
<packaging>war</packaging>
<name>xiaodu</name>
<description>Demo project for Spring Boot</description>
......@@ -23,14 +23,21 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!--<exclusions>-->
<!--<exclusion>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
<!--</exclusion>-->
<!--</exclusions>-->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-jdbc</artifactId>-->
<!--<version>2.1.6.RELEASE</version>-->
<!--</dependency>-->
<!--添加servlet-api的依赖,用来打war包-->
<dependency>
<groupId>javax.servlet</groupId>
......@@ -45,6 +52,12 @@
<scope>test</scope>
</dependency>
<!--<dependency>-->
<!--<groupId>mysql</groupId>-->
<!--<artifactId>mysql-connector-java</artifactId>-->
<!--<version>8.0.16</version>-->
<!--<scope>runtime</scope>-->
<!--</dependency>-->
<dependency>
<groupId>com.baidu.dueros</groupId>
<artifactId>bot-sdk</artifactId>
......@@ -57,11 +70,6 @@
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.8</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
......@@ -72,11 +80,6 @@
<version>1.18.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -99,21 +102,21 @@
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.ipld/java-cid -->
<dependency>
<groupId>com.github.ipld</groupId>
<artifactId>java-cid</artifactId>
<version>v1.1.1</version>
</dependency>
<!--&lt;!&ndash; https://mvnrepository.com/artifact/com.github.ipld/java-cid &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>com.github.ipld</groupId>-->
<!--<artifactId>java-cid</artifactId>-->
<!--<version>v1.1.1</version>-->
<!--</dependency>-->
</dependencies>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<!--<repositories>-->
<!--<repository>-->
<!--<id>jitpack.io</id>-->
<!--<url>https://jitpack.io</url>-->
<!--</repository>-->
<!--</repositories>-->
<build>
<finalName>xiaodu</finalName>
......
......@@ -8,14 +8,14 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
public class XiaoduApplication{
public class XiaoduApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(XiaoduApplication.class, args);
}
// @Override
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
// return builder.sources(XiaoduApplication.class);
// }
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(XiaoduApplication.class);
}
}
package ai.qiwu.baidu.xiaodu.common;
import ai.qiwu.baidu.xiaodu.pojo.product.response.ProductIdRequest;
import io.ipfs.cid.Cid;
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
......@@ -9,8 +8,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author 苗权威
......
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* @author 苗权威
* @dateTime 19-6-29 下午4:32
*/
@Getter
@Setter
@ToString
public class AudioUrlAndText {
private String audioUrl;
private String audio;
private String text;
public String getAudioUrl() {
return audioUrl;
}
public void setAudioUrl(String audioUrl) {
this.audioUrl = audioUrl;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
package ai.qiwu.baidu.xiaodu.pojo;
import lombok.Getter;
import lombok.Setter;
/**
* @author 苗权威
* @dateTime 19-7-10 下午2:29
*/
@Getter
@Setter
public class QiWuRequest {
private String user_id;
private String text;
private String access;
}
package ai.qiwu.baidu.xiaodu.service;
import ai.qiwu.baidu.xiaodu.common.Constants;
import ai.qiwu.baidu.xiaodu.common.OkHttp3Utils;
import ai.qiwu.baidu.xiaodu.pojo.AudioUrlAndText;
import ai.qiwu.baidu.xiaodu.pojo.QiWuRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
......@@ -21,52 +25,63 @@ import java.util.HashMap;
* @author 苗权威
* @dateTime 19-6-29 下午3:49
*/
@Slf4j
class RequestTerminal {
private static final Logger logger = LoggerFactory.getLogger(RequestTerminal.class);
static AudioUrlAndText requestTerminate(String word, String userId) {
AudioUrlAndText store = new AudioUrlAndText();
String audioUrl = "";
String textContent = "请说推荐作品";
CloseableHttpClient httpClient = null;
CloseableHttpResponse httpResponse = null;
try {
httpClient = HttpClientBuilder.create().build();
HttpPost post = new HttpPost(Constants.QI_WU_INTERFACE);
HashMap<String, String> params = new HashMap<>();
params.put("user_id", String.valueOf(userId));
params.put("text", word);
params.put("access",Constants.SERVICE_NAME);
String paramsJsonFormat = JSON.toJSONString(params);
StringEntity body = new StringEntity(paramsJsonFormat, "UTF-8");
post.setHeader("Content-Type", "application/json;charset=utf-8");
post.setEntity(body);
httpResponse = httpClient.execute(post);
HttpEntity responseBody = httpResponse.getEntity();
if (responseBody != null) {
String responseContent = EntityUtils.toString(responseBody);
logger.info("齐悟接口返回: "+ responseContent);
JSONObject responseJsonFormat = JSONObject.parseObject(responseContent);
audioUrl = (String) responseJsonFormat.get("audio");
textContent = (String) responseJsonFormat.get("text");
}
} catch (IOException e) {
logger.error("请求齐悟接口出错:"+e.toString());
return null;
} finally {
try {
if (httpClient != null) httpClient.close();
if (httpResponse != null) httpResponse.close();
} catch (IOException e) {
logger.error("关闭与齐悟接口时出错:"+e.toString());
}
}
store.setAudioUrl(audioUrl);
store.setText(textContent);
return store;
static AudioUrlAndText requestTerminate(String userWord, String userId) throws IOException {
QiWuRequest requestPojo = new QiWuRequest();
requestPojo.setUser_id(userId);
requestPojo.setAccess(Constants.SERVICE_NAME);
requestPojo.setText(userWord);
String requestJsonStr = JSON.toJSONString(requestPojo);
HashMap<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/json; charset=utf-8");
String resStr = OkHttp3Utils.doPostJsonStr(Constants.QI_WU_INTERFACE, headers, requestJsonStr);
return JSON.parseObject(resStr, AudioUrlAndText.class);
}
// static AudioUrlAndText requestTerminate(String word, String userId) {
// AudioUrlAndText store = new AudioUrlAndText();
// String audioUrl = "";
// String textContent = "请说推荐作品";
// CloseableHttpClient httpClient = null;
// CloseableHttpResponse httpResponse = null;
// try {
// httpClient = HttpClientBuilder.create().build();
// HttpPost post = new HttpPost(Constants.QI_WU_INTERFACE);
//
// HashMap<String, String> params = new HashMap<>();
// params.put("user_id", String.valueOf(userId));
// params.put("text", word);
// params.put("access",Constants.SERVICE_NAME);
//
// String paramsJsonFormat = JSON.toJSONString(params);
// StringEntity body = new StringEntity(paramsJsonFormat, "UTF-8");
// post.setHeader("Content-Type", "application/json;charset=utf-8");
// post.setEntity(body);
//
// httpResponse = httpClient.execute(post);
// HttpEntity responseBody = httpResponse.getEntity();
// if (responseBody != null) {
// String responseContent = EntityUtils.toString(responseBody);
// log.info("齐悟接口返回: "+ responseContent);
// JSONObject responseJsonFormat = JSONObject.parseObject(responseContent);
// audioUrl = (String) responseJsonFormat.get("audio");
// textContent = (String) responseJsonFormat.get("text");
// }
// } catch (IOException e) {
// log.error("请求齐悟接口出错:"+e.toString());
// return null;
// } finally {
// try {
// if (httpClient != null) httpClient.close();
// if (httpResponse != null) httpResponse.close();
// } catch (IOException e) {
// log.error("关闭与齐悟接口时出错:"+e.toString());
// }
// }
// store.setAudioUrl(audioUrl);
// store.setText(textContent);
// return store;
// }
}
......@@ -5,12 +5,10 @@ import ai.qiwu.baidu.xiaodu.common.Constants.ErrorMsg;
import ai.qiwu.baidu.xiaodu.common.Constants.EndMsg;
import ai.qiwu.baidu.xiaodu.common.Constants.WelcomeWord;
import ai.qiwu.baidu.xiaodu.common.OkHttp3Utils;
import ai.qiwu.baidu.xiaodu.common.TokenHolder;
import ai.qiwu.baidu.xiaodu.common.Utils;
import ai.qiwu.baidu.xiaodu.pojo.AudioUrlAndText;
import ai.qiwu.baidu.xiaodu.pojo.GetTokenByRefreshToken;
import ai.qiwu.baidu.xiaodu.pojo.GetUserInfoByToken;
import ai.qiwu.baidu.xiaodu.service.productManager.ProductManager;
import com.alibaba.fastjson.JSON;
import com.baidu.dueros.bot.AudioPlayer;
import com.baidu.dueros.data.request.*;
......@@ -29,10 +27,6 @@ import com.baidu.dueros.data.response.directive.audioplayer.AudioPlayerDirective
import com.baidu.dueros.data.response.directive.audioplayer.Content;
import com.baidu.dueros.data.response.directive.audioplayer.Play;
import com.baidu.dueros.data.response.directive.audioplayer.PlayerInfo;
import com.baidu.dueros.data.response.directive.audioplayer.control.BaseButton;
import com.baidu.dueros.data.response.directive.display.Hint;
import com.baidu.dueros.data.response.directive.display.RenderTemplate;
import com.baidu.dueros.data.response.directive.display.templates.*;
import com.baidu.dueros.data.response.directive.pay.Buy;
import com.baidu.dueros.data.response.directive.pay.Charge;
import com.baidu.dueros.model.Request;
......@@ -48,10 +42,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
import static ai.qiwu.baidu.xiaodu.common.Constants.EndMsg.BYE_BYE;
......@@ -224,12 +214,24 @@ public class ResponseEncapsulation extends AudioPlayer {
}
}
}else {
AudioUrlAndText data = RequestTerminal.requestTerminate(userWord, userId);
AudioUrlAndText data = null;
try {
data = RequestTerminal.requestTerminate(userWord, userId);
} catch (IOException e) {
logger.error("请求终端接口出错:", e.toString());
}
if (data == null) {
return buildErrorResponse(ErrorMsg.SORRY_UNCATCH);
}
String audioUrl = data.getAudioUrl();
logger.info("请求终端接口:"+data);
String audioUrl = data.getAudio();
logger.info(getSupportedInterfaces().getAudioPlayer() == null?"audio is null":"audio not null");
logger.info(getSupportedInterfaces().getScreen() == null?"screen is null":"screen not null");
if (getSupportedInterfaces().getScreen() == null) {
addDirective(buildNoScreenPlayDirec(audioUrl, AudioPlayerDirective.PlayBehaviorType.REPLACE_ALL));
}else {
addDirective(buildPlayDirective(audioUrl, data.getText(), AudioPlayerDirective.PlayBehaviorType.REPLACE_ALL));
}
// String uri = "https://aliyun-hz1.chewrobot.com/xiaodu/image/5b2d0a11/lvzhou/1564033095964d39f.jpg";
// ImageStructure imageStructure = new ImageStructure(uri, 512, 512);
......@@ -366,6 +368,10 @@ public class ResponseEncapsulation extends AudioPlayer {
return play;
}
private Play buildNoScreenPlayDirec(String audioUrl, AudioPlayerDirective.PlayBehaviorType type) {
return new Play(type, audioUrl, 0);
}
/**
* 不想对每个事件都进行处理,通过重写onDefaultEvent方法来统一处理。
* 任何事件都不允许开麦
......
#logging.path=/usr/mqw/logs/xiaodu
#logging.level.root = info
#spring.output.ansi.enabled=detect
logging.path=/usr/mqw/logs/xiaodu
logging.level.root = info
spring.output.ansi.enabled=detect
spring.thymeleaf.mode=HTML
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.servlet.content-type=text/html
#开发时关闭缓存,不然没法看到实时页面
spring.thymeleaf.cache=false
#spring.thymeleaf.cache=false
image.upload.path = /root/GameEditor/mqw/xiaodu/image/
server.port=8088
#server.port=8088
#spring.datasource.name=root
#spring.datasource.password=mysql
#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/do_product
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment