From 100a31e280e47eb60729fb3669607b6820b34f95 Mon Sep 17 00:00:00 2001 From: 苗权威 <1160292058@qq.com> Date: Wed, 9 Oct 2019 19:23:38 +0800 Subject: [PATCH] document --- .idea/workspace.xml | 515 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- tts_service/document/intro/interface.md | 255 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tts_service/readme.md | 257 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java | 8 ++++---- tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java | 2 +- xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/TempleUtils.java | 2 +- xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/onLunch/LunchUtils.java | 8 ++++---- xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayPojo.java | 8 ++++++++ xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayUtils.java | 71 +++++++++++++++++++++++++++++++++++++++++++---------------------------- xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/productInfo/ProductInfoUtils.java | 2 +- xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java | 2 +- xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/UserBehaviorData.java | 2 +- xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java | 2 +- 13 files changed, 842 insertions(+), 292 deletions(-) create mode 100644 tts_service/document/intro/interface.md diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c881282..ea7fe33 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -8,20 +8,15 @@ - - - - + - - + - @@ -65,93 +60,90 @@ - + - - + + - - - + + + + - + - - - - - + + - + - - + + - - - - + + + + + + + - - - - - - - - - - + - - + + - + + + - + - - + + - + - - + + + + + - + - - + + @@ -170,9 +162,6 @@ - $ - Constants.PRE_PRODUCT_IMG - pageNum rootFolder uploadFolder imgSrc @@ -200,6 +189,9 @@ LUNCH_LIST_CATEGORY_CON setMarginBottom Task + onlineCache + TTSResponse + reset OPENID_CACHE @@ -215,8 +207,6 @@ @@ -298,8 +290,8 @@ - @@ -311,6 +303,7 @@ + @@ -321,25 +314,31 @@ - + - + + + + + + + - + - + @@ -347,32 +346,39 @@ - + - + - + + + + + + + - - - + + + + - - + + @@ -381,10 +387,6 @@ - - - - @@ -394,9 +396,6 @@ - - - @@ -407,8 +406,6 @@ - - @@ -464,7 +461,6 @@ - @@ -478,7 +474,7 @@ - + @@ -1051,7 +1047,7 @@ - + @@ -1061,7 +1057,7 @@ - @@ -1073,7 +1069,7 @@ - + @@ -1083,17 +1079,17 @@ - + - + - + @@ -1104,7 +1100,7 @@ - + @@ -1160,100 +1156,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1281,13 +1183,6 @@ - - - - - - - @@ -1337,13 +1232,6 @@ - - - - - - - @@ -1390,13 +1278,6 @@ - - - - - - - @@ -1404,13 +1285,6 @@ - - - - - - - @@ -1453,91 +1327,236 @@ - + + + + + + + + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + + + + + - + - - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - + - - + + - + - + - + - - + + - - - + + - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tts_service/document/intro/interface.md b/tts_service/document/intro/interface.md new file mode 100644 index 0000000..039828c --- /dev/null +++ b/tts_service/document/intro/interface.md @@ -0,0 +1,255 @@ +###删除bot缓存 +#### Request +- URL:```/online_cache``` +- METHOD:**DELETE** +- URL Parameters|TYPE: JSON +``` +{ + "botname":"作品标识" +} +``` +#### Response +- ResponseBody: +```{"status":200,"message":"成功"}``` + +
+
+
+ +###获取所有角色离线上线信息 +#### Request +- URL:```/api/speakers``` +- METHOD:**GET** +#### Response +- ResponseBody: +``` +{ + "online": { + "A21": { + "name": "新新(男缓慢)", + "sex": "男", + "mood": [ + "正常" + ] + } + }, + "offline": { + "B20_offline": { + "name": "李艺(女沉着)", + "sex": "女", + "mood": [ + "正常", + "开心" + ] + } + } +} +``` + +
+
+
+ +###根据请求信息返回文件或该文件的请求链接 +#### Request +- URL:```/api/tts``` +- METHOD:**GET|PUT|POST** +- URL Parameters|TYPE: JSON +``` +{ + "_type": "json", + "person": "A04_offline", + "tone": "正常", + "text": "好的。苏琪家好像是住北城,我家乡刚好在北城隔壁,顺路。", + "botname": "miao", + "pitch": 0.4, + "speed": 1.2, + "volume": 2.5, + "npcName": "xiaoming", + "get_online": false +} +``` +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |_type | false |string |返回音频文件URL| - | json | + |botname| false |string|作品标识| 中控 | - | + |person|false|string|语音人物标识|正常|-| + |tone|false|string|情绪|正常|-| + |text|true|string|文本内容|-|-| + |pitch|false|double|语调|0|-| + |speed|false|double|语速|1|-| + |volume|false|double|音量|0|-| + |npcName|false|string|代表优先寻找人工语音文件|-|-| + |get_online|false|boolean|代表只请求线上地址|true|-| + +#### Response +- ResponseBody: +```{"status":200,"message":"成功","audio":"音频文件URL"}``` +- 返回字段说明:该方法就是根据请求信息下载音频数据,生成.mp3文件,若_type是json则返回获取该生成后的.mp3文件的请求URL,否则返回该.mp3文件 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |message | false |string|返回信息| + |audio|false|string|音频文件URL| + +
+
+
+ +###请求多个音频文件 +#### Request +- URL:```/api/tts_ls``` +- METHOD:**POST** +- URL Parameters|TYPE: JSON +``` +{ + "_type": "filename", + "platform": "xiaoai", + "botname": "miao", + "text_info_ls": [ + { + "person": "A12_offline", + "tone": "正常", + "text": "用来进行测试的碰碰车不是小孩努力学习皮皮再将它皮皮 。", + "pitch": 0, + "speed": 1.3, + "volume": 0, + "npcName": "xiaoming" + } + ] +} +``` +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |_type | false |string |获取b64文件名列表| - | filename | + |botname| false |string|作品标识| 中控 | - | + |platform| false |string| npc名称 | - | - | + |text_info_ls | true |arr| 请求信息列表 | -|-| + |person|false|string|语音人物标识|正常|-| + |tone|false|string|情绪|正常|-| + |text|true|string|文本内容|-|-| + |pitch|false|double|语调|0|-| + |speed|false|double|语速|1|-| + |volume|false|double|音量|0|-| + |npcName|false|string|代表优先寻找人工语音文件|-|-| +#### Response +- ResponseBody: +```{"status":200,"message":"成功","audio":"音频文件URL"}``` +- 返回字段说明:若plateform为xiaoai则返回合并后的文件的请求URL;否则根据_type来选择返回的是b64文件内容列表或是b64文件名列表 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |message | false |string|返回信息| + |audio|false|string|音频文件URL| + +
+
+
+ +###获取音频文件 +#### Request +- URL:```/api/tts/get_audio``` +- METHOD:**GET** +- URL Parameters: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |dirs| true |string|文件目录| - | - | + |filename| true |string| 文件名 | - | - | + |_type | false | String | 为file则可下载此文件 | - | - | + +#### Response +- ResponseBody: +```{"status":200,"message":"成功"}``` +- 返回字段说明 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |message | false |string|返回信息| + +
+
+
+ +###上传单个音频 +#### Request +- URL:```/api/upload/record/one_sen``` +- METHOD:**POST** +- Headers: + - Content-Type: multipart/form-data +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |tid | true |int |句子id| - | - | + |botName| true |string|作品账号名(非作品名)| - | - | + |npcName| true |string| npc名称 | - | - | + |text | true |string| 语音文件对应的句子 | - | - | + |file | true | file | 录音文件 | - | - | +#### Response +- 返回字段说明 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |msg | true |string|返回信息| + +
+
+
+ +### 批量音频文件 +#### Request +- Method: **POST** +- URL: ```/api/upload/record/one_npc``` +- Headers: + - Content-Type: ```multipart/form-data``` +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |botName| true |string|作品账号名(非作品名)| - | - | + |npcName| true |string| npc名称 | - | - | + |file | true | file | 录音文件zip压缩包 | - | - | + +#### Response +- 返回字段说明 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |msg | true |string|返回信息| + +
+
+
+ +### 删除单个音频文件 +#### Request +- Method: **DELETE** +- URL: ```/api/delete/record/one_sen``` +- Headers: + - Content-Type: ```application/json``` +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |tid | true |int |句子id| - | - | + |botName| true |string|作品账号名(非作品名)| - | - | + |npcName| true |string| npc名称 | - | - | + |text | true |string| 语音文件对应的句子 | - | - | + +#### Response +- 返回字段说明 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |msg | true |string|返回信息| \ No newline at end of file diff --git a/tts_service/readme.md b/tts_service/readme.md index a52844e..039828c 100644 --- a/tts_service/readme.md +++ b/tts_service/readme.md @@ -1,2 +1,255 @@ -upload.sh:将jar包上传到服务器; -start.sh:服务器上执行该文件,启动项目 \ No newline at end of file +###删除bot缓存 +#### Request +- URL:```/online_cache``` +- METHOD:**DELETE** +- URL Parameters|TYPE: JSON +``` +{ + "botname":"作品标识" +} +``` +#### Response +- ResponseBody: +```{"status":200,"message":"成功"}``` + +
+
+
+ +###获取所有角色离线上线信息 +#### Request +- URL:```/api/speakers``` +- METHOD:**GET** +#### Response +- ResponseBody: +``` +{ + "online": { + "A21": { + "name": "新新(男缓慢)", + "sex": "男", + "mood": [ + "正常" + ] + } + }, + "offline": { + "B20_offline": { + "name": "李艺(女沉着)", + "sex": "女", + "mood": [ + "正常", + "开心" + ] + } + } +} +``` + +
+
+
+ +###根据请求信息返回文件或该文件的请求链接 +#### Request +- URL:```/api/tts``` +- METHOD:**GET|PUT|POST** +- URL Parameters|TYPE: JSON +``` +{ + "_type": "json", + "person": "A04_offline", + "tone": "正常", + "text": "好的。苏琪家好像是住北城,我家乡刚好在北城隔壁,顺路。", + "botname": "miao", + "pitch": 0.4, + "speed": 1.2, + "volume": 2.5, + "npcName": "xiaoming", + "get_online": false +} +``` +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |_type | false |string |返回音频文件URL| - | json | + |botname| false |string|作品标识| 中控 | - | + |person|false|string|语音人物标识|正常|-| + |tone|false|string|情绪|正常|-| + |text|true|string|文本内容|-|-| + |pitch|false|double|语调|0|-| + |speed|false|double|语速|1|-| + |volume|false|double|音量|0|-| + |npcName|false|string|代表优先寻找人工语音文件|-|-| + |get_online|false|boolean|代表只请求线上地址|true|-| + +#### Response +- ResponseBody: +```{"status":200,"message":"成功","audio":"音频文件URL"}``` +- 返回字段说明:该方法就是根据请求信息下载音频数据,生成.mp3文件,若_type是json则返回获取该生成后的.mp3文件的请求URL,否则返回该.mp3文件 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |message | false |string|返回信息| + |audio|false|string|音频文件URL| + +
+
+
+ +###请求多个音频文件 +#### Request +- URL:```/api/tts_ls``` +- METHOD:**POST** +- URL Parameters|TYPE: JSON +``` +{ + "_type": "filename", + "platform": "xiaoai", + "botname": "miao", + "text_info_ls": [ + { + "person": "A12_offline", + "tone": "正常", + "text": "用来进行测试的碰碰车不是小孩努力学习皮皮再将它皮皮 。", + "pitch": 0, + "speed": 1.3, + "volume": 0, + "npcName": "xiaoming" + } + ] +} +``` +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |_type | false |string |获取b64文件名列表| - | filename | + |botname| false |string|作品标识| 中控 | - | + |platform| false |string| npc名称 | - | - | + |text_info_ls | true |arr| 请求信息列表 | -|-| + |person|false|string|语音人物标识|正常|-| + |tone|false|string|情绪|正常|-| + |text|true|string|文本内容|-|-| + |pitch|false|double|语调|0|-| + |speed|false|double|语速|1|-| + |volume|false|double|音量|0|-| + |npcName|false|string|代表优先寻找人工语音文件|-|-| +#### Response +- ResponseBody: +```{"status":200,"message":"成功","audio":"音频文件URL"}``` +- 返回字段说明:若plateform为xiaoai则返回合并后的文件的请求URL;否则根据_type来选择返回的是b64文件内容列表或是b64文件名列表 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |message | false |string|返回信息| + |audio|false|string|音频文件URL| + +
+
+
+ +###获取音频文件 +#### Request +- URL:```/api/tts/get_audio``` +- METHOD:**GET** +- URL Parameters: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |dirs| true |string|文件目录| - | - | + |filename| true |string| 文件名 | - | - | + |_type | false | String | 为file则可下载此文件 | - | - | + +#### Response +- ResponseBody: +```{"status":200,"message":"成功"}``` +- 返回字段说明 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |message | false |string|返回信息| + +
+
+
+ +###上传单个音频 +#### Request +- URL:```/api/upload/record/one_sen``` +- METHOD:**POST** +- Headers: + - Content-Type: multipart/form-data +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |tid | true |int |句子id| - | - | + |botName| true |string|作品账号名(非作品名)| - | - | + |npcName| true |string| npc名称 | - | - | + |text | true |string| 语音文件对应的句子 | - | - | + |file | true | file | 录音文件 | - | - | +#### Response +- 返回字段说明 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |msg | true |string|返回信息| + +
+
+
+ +### 批量音频文件 +#### Request +- Method: **POST** +- URL: ```/api/upload/record/one_npc``` +- Headers: + - Content-Type: ```multipart/form-data``` +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |botName| true |string|作品账号名(非作品名)| - | - | + |npcName| true |string| npc名称 | - | - | + |file | true | file | 录音文件zip压缩包 | - | - | + +#### Response +- 返回字段说明 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |msg | true |string|返回信息| + +
+
+
+ +### 删除单个音频文件 +#### Request +- Method: **DELETE** +- URL: ```/api/delete/record/one_sen``` +- Headers: + - Content-Type: ```application/json``` +- 参数说明: + + |参数 |必选 |类型 |说明 |默认值 |参考值 | + |---- |---- |---- |---- |---- |---- | + |tid | true |int |句子id| - | - | + |botName| true |string|作品账号名(非作品名)| - | - | + |npcName| true |string| npc名称 | - | - | + |text | true |string| 语音文件对应的句子 | - | - | + +#### Response +- 返回字段说明 + + |返回字段 |必有 |类型 | 说明 | + |---- |---- |---- |---- | + |status | true | int |返回状态| + |msg | true |string|返回信息| \ No newline at end of file diff --git a/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java b/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java index 6ec60ca..ddb8eac 100644 --- a/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java +++ b/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java @@ -369,7 +369,7 @@ public class TTService { return; } } catch (Exception e) { - log.error("获取结果出错:{}", e.toString()); + log.error("获取结果出错:{}", ExceptionUtils.getStackTrace(e)); TTServiceUtil.buildTTS_lsResponse(response, new TTSResponse(400), null, 400); return; } @@ -1061,8 +1061,8 @@ public class TTService { * @param response 响应信息 */ public void uploadOneSen(UploadOneSenData data, HttpServletResponse response, String head) { - //tid,botName,npcName,text,file皆不能为空,否则返回400 - //log.info("UploadOneSenData:{}",data); + // tid,botName,npcName,text,file皆不能为空,否则返回400 + // log.info("UploadOneSenData:{}",data); if (StringUtils.isAnyBlank(String.valueOf(data.getTid()),data.getBotName(), data.getNpcName(), data.getText()) || data.getFile().getName() == null) { TTServiceUtil.buildUploadResponse(response, new TTSResponse(400, "参数不能为空"), 400); return; @@ -1072,7 +1072,7 @@ public class TTService { Initialize.getUploadedDir(), data.getNpcName()},File.separator); // absolute filepath final String filename = StringUtils.join(new String[]{folder, TTSUtils.buildMP3Filename(data.getText())}, File.separator); - //log.info("filepath:{}",filename); + // log.info("filepath:{}",filename); // 删除之前已存在的文件 if (TTSUtils.doesFileExist(filename) ) { if (!new File(filename).delete()) { diff --git a/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java b/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java index 91a1414..2f70bf5 100644 --- a/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java +++ b/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java @@ -81,7 +81,7 @@ public class ThirdPartyService { log.error("写入mp3数据信息失败:{}", e.toString()); } } else { - String errorCode = (String) res.getResult().get("error_code"); + String errorCode = (String) res.getResult().get("err_no"); if ("SDK108".equals(errorCode)) { log.error("错误码:SDK108,错误信息:{}", "连接超时或读取数据超时"); }else { diff --git a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/TempleUtils.java b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/TempleUtils.java index 8b1c533..e681e20 100644 --- a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/TempleUtils.java +++ b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/TempleUtils.java @@ -62,7 +62,7 @@ public class TempleUtils { FRAME_RECOMMAND.getItems().get(1).getItems().get(0).setText("小度小度,打开推荐页"); FRAME_RECOMMAND.getItems().get(0).setText("推荐作品"); FRAME_CATEGORY = JSON.parseObject(getDPLTemple("static/json/frame.json"), FrameTemple.class); - FRAME_CATEGORY.getItems().get(1).getItems().get(0).setText("小度小度,打开第二十一个"); + FRAME_CATEGORY.getItems().get(1).getItems().get(0).setText("小度小度,打开第十七个"); FRAME_CATEGORY.getItems().get(0).setText("作品分类"); } diff --git a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/onLunch/LunchUtils.java b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/onLunch/LunchUtils.java index 36a26bd..f56b4f4 100644 --- a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/onLunch/LunchUtils.java +++ b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/onLunch/LunchUtils.java @@ -203,8 +203,8 @@ public class LunchUtils { logo.setType("Image"); logo.setPosition("absolute"); logo.setSrc("https://aliyun-hz1.chewrobot.com/xiaoduhome/image/history.png"); - logo.setWidth("40dp"); - logo.setHeight("40dp"); + logo.setWidth("36dp"); + logo.setHeight("36dp"); logo.setScaleType("centerInside"); logo.setTop("20dp"); logo.setRight("30dp"); @@ -217,8 +217,8 @@ public class LunchUtils { logo.setType("Image"); logo.setPosition("absolute"); logo.setSrc("https://aliyun-hz1.chewrobot.com/xiaoduhome/image/collec.png"); - logo.setWidth("40dp"); - logo.setHeight("40dp"); + logo.setWidth("36dp"); + logo.setHeight("36dp"); logo.setScaleType("centerInside"); logo.setTop("20dp"); logo.setRight("120dp"); diff --git a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayPojo.java b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayPojo.java index 86854bf..eb340c6 100644 --- a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayPojo.java +++ b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayPojo.java @@ -56,4 +56,12 @@ public class PlayPojo { private String marginLeft; private List hints; private List onClick; + @JsonProperty("line-height") + private String lineHeight; + @JsonProperty("padding-bottom") + private String paddingBottom; +// @JsonProperty("align-items") +// private String alignItems; +// @JsonProperty("justify-content") +// private String justifyContent; } diff --git a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayUtils.java b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayUtils.java index 41aa615..91bc46e 100644 --- a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayUtils.java +++ b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/play/PlayUtils.java @@ -41,8 +41,8 @@ public class PlayUtils { backGroundImg.setPosition("absolute"); backGroundImg.setRight("120dp"); backGroundImg.setTop("20dp"); - backGroundImg.setHeight("50dp"); - backGroundImg.setWidth("50dp"); + backGroundImg.setHeight("36dp"); + backGroundImg.setWidth("36dp"); backGroundImg.setSrc("https://aliyun-hz1.chewrobot.com/xiaoduhome/image/flower.png"); backGroundImg.setOnClick(Collections.singletonList(new Event("SendEvent", "playButton"))); backGroundImg.setScaleType("fitCenter"); @@ -56,8 +56,8 @@ public class PlayUtils { backGroundImg.setPosition("absolute"); backGroundImg.setRight("30dp"); backGroundImg.setTop("20dp"); - backGroundImg.setHeight("50dp"); - backGroundImg.setWidth("50dp"); + backGroundImg.setHeight("36dp"); + backGroundImg.setWidth("36dp"); backGroundImg.setComponentId("playCollect"); backGroundImg.setSrc("https://aliyun-hz1.chewrobot.com/xiaoduhome/image/collec.png"); backGroundImg.setOnClick(Collections.singletonList(new Event("SendEvent", "playButton"))); @@ -195,18 +195,23 @@ public class PlayUtils { whole.setHeight("100%"); whole.setWidth("100%"); whole.setComponentId("whole"); + whole.setTop("165dp"); PlayPojo textContainer = new PlayPojo(); textContainer.setType("Container"); - textContainer.setPadding("35dp"); + //textContainer.setPadding("45dp"); textContainer.setPosition("absolute"); - textContainer.setBottom("250dp"); + textContainer.setPaddingLeft("45dp"); + textContainer.setPaddingRight("45dp"); +// textContainer.setAlignItems("center"); +// textContainer.setJustifyContent("center"); PlayPojo text = new PlayPojo(); text.setType("Text"); text.setComponentId("text"); text.setFontSize("28dp"); text.setFontStyle("normal"); + text.setPaddingBottom("20dp"); text.setText(textContent); textContainer.setItems(Collections.singletonList(text)); @@ -252,7 +257,7 @@ public class PlayUtils { logo.setPosition("absolute"); logo.setSrc("https://aliyun-hz1.chewrobot.com/xiaoduhome/image/logo.png"); logo.setWidth("200dp"); - logo.setHeight("60dp"); + logo.setHeight("58dp"); logo.setTop("20dp"); logo.setLeft("10dp"); return logo; @@ -262,17 +267,16 @@ public class PlayUtils { PlayPojo asideContainer = new PlayPojo(); asideContainer.setType("Container"); asideContainer.setPosition("absolute"); - asideContainer.setLeft("115dp"); - asideContainer.setTop("185dp"); + asideContainer.setLeft("130dp"); + asideContainer.setTop("180dp"); - PlayPojo frame = new PlayPojo(); - frame.setType("Frame"); - frame.setWidth("70dp"); - frame.setPaddingLeft("50dp"); - frame.setPaddingRight("15dp"); - frame.setPaddingVertical("10dp"); - frame.setBorderRadius("10dp"); - frame.setBackgroundColor("rgba(0,0,0,0.4)"); +// PlayPojo frame = new PlayPojo(); +// frame.setType("Frame"); +// frame.setPaddingLeft("50dp"); +// frame.setPaddingRight("15dp"); +// frame.setPaddingTop("15dp"); +// frame.setBorderRadius("10dp"); +// frame.setBackgroundColor("rgba(0,0,0,0.4)"); PlayPojo text = new PlayPojo(); text.setType("Text"); @@ -280,8 +284,9 @@ public class PlayUtils { text.setComponentId("asideText"); text.setHeight("50dp"); - frame.setItems(Collections.singletonList(text)); - asideContainer.setItems(Collections.singletonList(frame)); +// frame.setItems(Collections.singletonList(text)); +// asideContainer.setItems(Collections.singletonList(frame)); + asideContainer.setItems(Collections.singletonList(text)); return asideContainer; } @@ -289,21 +294,21 @@ public class PlayUtils { PlayPojo asideContainer = new PlayPojo(); asideContainer.setType("Container"); asideContainer.setPosition("absolute"); - asideContainer.setLeft("35dp"); + asideContainer.setLeft("45dp"); asideContainer.setTop("167dp"); PlayPojo frame = new PlayPojo(); frame.setType("Frame"); - frame.setWidth("100dp"); - frame.setHeight("100dp"); + frame.setWidth("60dp"); + frame.setHeight("60dp"); frame.setBorderRadius("50dp"); PlayPojo image = new PlayPojo(); image.setType("Image"); image.setComponentId("asideImg"); image.setSrc(src); - frame.setWidth("100dp"); - image.setHeight("100dp"); + frame.setWidth("60dp"); + image.setHeight("60dp"); image.setScaleType("fitCenter"); frame.setItems(Collections.singletonList(image)); @@ -312,9 +317,19 @@ public class PlayUtils { } private static PlayPojo buildHints() { - PlayPojo hint = new PlayPojo(); - hint.setType("Footer"); - hint.setHints(Arrays.asList("我要送花", "收藏", "回到首页", "返回")); - return hint; + PlayPojo footerCon = new PlayPojo(); + footerCon.setType("Container"); + footerCon.setPosition("absolute"); + footerCon.setWidth("100%"); + footerCon.setLeft("0"); + footerCon.setBottom("0"); + + PlayPojo footer = new PlayPojo(); + footer.setType("Footer"); + footer.setHints(Arrays.asList("我要送花", "收藏", "返回")); + + footerCon.setItems(Collections.singletonList(footer)); + + return footerCon; } } diff --git a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/productInfo/ProductInfoUtils.java b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/productInfo/ProductInfoUtils.java index 9b4304f..89fc53b 100644 --- a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/productInfo/ProductInfoUtils.java +++ b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/productInfo/ProductInfoUtils.java @@ -45,7 +45,7 @@ public class ProductInfoUtils { coverImage.setType("Image"); coverImage.setWidth("280dp"); coverImage.setHeight("280dp"); - coverImage.setBorderRadius("30dp"); + coverImage.setBorderRadius("15dp"); coverImage.setScaleType("fitXY"); coverImage.setMarginLeft("50dp"); coverImage.setMarginTop("12dp"); diff --git a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java index 9caca18..84f5bd6 100644 --- a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java +++ b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java @@ -29,7 +29,7 @@ public class XiaoDuHomeController { //service.disableVerify(); service.enableVerify(); String str = service.run(); - log.info("响应信息:{}", str); + //log.info("响应信息:{}", str); return str; } catch (Exception e) { e.printStackTrace(); diff --git a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/UserBehaviorData.java b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/UserBehaviorData.java index 7a87ba9..a1bcf35 100644 --- a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/UserBehaviorData.java +++ b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/UserBehaviorData.java @@ -22,7 +22,7 @@ public class UserBehaviorData { // 用户是否收藏该作品 private volatile HashMap userBotId2Collected = new HashMap<>(); // 标记清除,每半小时标记一次 - private volatile Byte mark = 0; + private volatile Byte mark = 1; private volatile String jytUserId; } diff --git a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java index 419857b..ffc036c 100644 --- a/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java +++ b/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java @@ -1530,7 +1530,7 @@ public class DplBotService extends BaseBot { } String beforeBotAccount = getSessionAttribute("botAcc"); if (!botAccount.equals(beforeBotAccount)) { - DplbotServiceUtil. updateTheUserBehaviorDataMark(userId, botAccount, getAccessToken()); + DplbotServiceUtil.updateTheUserBehaviorDataMark(userId, botAccount, getAccessToken()); String productName = ScheduleService.PRODUCT_ID_DETAIL.get(botAccount).getName(); PlayDocument document = PlayUtils.getPlayDocument(correctName(productName), aside, -- libgit2 0.27.1