From 7ac0726ab7c52864e5eb06d3ad88bba523a3674d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=96=87=E9=9D=99?= <1319697849@qq.com> Date: Mon, 12 May 2025 15:46:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 + CHANGELOG.md | 512 +++++ Dockerfile | 32 + Jenkinsfile | 213 ++ README.md | 152 ++ conf | 1 - conf/config.yaml | 133 ++ dao/dao.go | 70 + dao/init.go | 62 + dao/recordsop.go | 159 ++ doc/music.md | 161 ++ global/bot.go | 60 + global/const.go | 14 + global/mid.go | 122 ++ global/service.go | 46 + global/setting.go | 23 + go.mod | 61 + go.sum | 728 +++++++ main.go | 265 +++ middleware/middlewares.go | 40 + model/models.go | 357 ++++ model/speech.go | 110 + model/speechNlpResp.go | 57 + model/tencentNlpResp.go | 458 +++++ nohup.out | 268 +++ pkg/consul/discover.go | 140 ++ pkg/consul/health.go | 19 + pkg/consul/kv.go | 32 + pkg/consul/register.go | 57 + pkg/consul/resolver.go | 127 ++ pkg/errCode/common_code.go | 20 + pkg/errCode/err_code.go | 27 + pkg/logger/gorm_trace.go | 118 ++ pkg/logger/logger.go | 225 ++ pkg/proto/TencentNluParseStream.json | 23 + pkg/proto/TencentNluParseStream_metadata.json | 15 + pkg/proto/music-spot.pb.go | 726 +++++++ pkg/proto/music-spot.proto | 52 + pkg/proto/music-spot_grpc.pb.go | 109 + pkg/proto/service.pb.go | 1690 +++++++++++++++ pkg/proto/service.proto | 143 ++ pkg/proto/tencent_nlp_skill.pb.go | 937 +++++++++ pkg/proto/tencent_nlp_skill.proto | 68 + pkg/setting/section.go | 95 + pkg/setting/setting.go | 37 + pkg/util/aes.go | 133 ++ pkg/util/ip.go | 61 + pkg/util/md5.go | 13 + pkg/util/utils.go | 40 + service/connect/find_grpc.go | 56 + service/connect/music.go | 58 + service/iot/dev_cmd.go | 74 + service/iot/dev_pack.go | 89 + service/service.go | 782 +++++++ service/speechNlu/constant.go | 155 ++ service/speechNlu/domain.go | 741 +++++++ service/speechNlu/register.go | 73 + service/speechNlu/reply.go | 117 ++ service/speechNlu/speech.go | 224 ++ service/speechNlu/speechWs.go | 246 +++ service/tencentNlu/auth.go | 81 + service/tencentNlu/check.go | 22 + service/tencentNlu/config.go | 22 + service/tencentNlu/constant.go | 145 ++ service/tencentNlu/domain.go | 1819 +++++++++++++++++ service/tencentNlu/domainWs.go | 971 +++++++++ service/tencentNlu/domainv2.go | 721 +++++++ service/tencentNlu/register.go | 76 + service/tencentNlu/registerWs.go | 110 + service/tencentNlu/registerv2.go | 44 + service/tencentNlu/reply.go | 117 ++ service/tencentNlu/semantic.go | 216 ++ service/tencentNlu/tencent.go | 239 +++ service/tencentNlu/tencentNlpSkill.go | 136 ++ service/tencentNlu/tencentWs.go | 458 +++++ service/tencentNlu/tencentv2.go | 256 +++ service/tencentNlu/utils.go | 40 + 77 files changed, 17105 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 Dockerfile create mode 100644 Jenkinsfile create mode 100644 README.md delete mode 100644 conf create mode 100644 conf/config.yaml create mode 100644 dao/dao.go create mode 100644 dao/init.go create mode 100644 dao/recordsop.go create mode 100644 doc/music.md create mode 100644 global/bot.go create mode 100644 global/const.go create mode 100644 global/mid.go create mode 100644 global/service.go create mode 100644 global/setting.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 main.go create mode 100644 middleware/middlewares.go create mode 100644 model/models.go create mode 100644 model/speech.go create mode 100644 model/speechNlpResp.go create mode 100644 model/tencentNlpResp.go create mode 100644 nohup.out create mode 100644 pkg/consul/discover.go create mode 100644 pkg/consul/health.go create mode 100644 pkg/consul/kv.go create mode 100644 pkg/consul/register.go create mode 100644 pkg/consul/resolver.go create mode 100644 pkg/errCode/common_code.go create mode 100644 pkg/errCode/err_code.go create mode 100644 pkg/logger/gorm_trace.go create mode 100644 pkg/logger/logger.go create mode 100644 pkg/proto/TencentNluParseStream.json create mode 100644 pkg/proto/TencentNluParseStream_metadata.json create mode 100644 pkg/proto/music-spot.pb.go create mode 100644 pkg/proto/music-spot.proto create mode 100644 pkg/proto/music-spot_grpc.pb.go create mode 100644 pkg/proto/service.pb.go create mode 100644 pkg/proto/service.proto create mode 100644 pkg/proto/tencent_nlp_skill.pb.go create mode 100644 pkg/proto/tencent_nlp_skill.proto create mode 100644 pkg/setting/section.go create mode 100644 pkg/setting/setting.go create mode 100644 pkg/util/aes.go create mode 100644 pkg/util/ip.go create mode 100644 pkg/util/md5.go create mode 100644 pkg/util/utils.go create mode 100644 service/connect/find_grpc.go create mode 100644 service/connect/music.go create mode 100644 service/iot/dev_cmd.go create mode 100644 service/iot/dev_pack.go create mode 100644 service/service.go create mode 100644 service/speechNlu/constant.go create mode 100644 service/speechNlu/domain.go create mode 100644 service/speechNlu/register.go create mode 100644 service/speechNlu/reply.go create mode 100644 service/speechNlu/speech.go create mode 100644 service/speechNlu/speechWs.go create mode 100644 service/tencentNlu/auth.go create mode 100644 service/tencentNlu/check.go create mode 100644 service/tencentNlu/config.go create mode 100644 service/tencentNlu/constant.go create mode 100644 service/tencentNlu/domain.go create mode 100644 service/tencentNlu/domainWs.go create mode 100644 service/tencentNlu/domainv2.go create mode 100644 service/tencentNlu/register.go create mode 100644 service/tencentNlu/registerWs.go create mode 100644 service/tencentNlu/registerv2.go create mode 100644 service/tencentNlu/reply.go create mode 100644 service/tencentNlu/semantic.go create mode 100644 service/tencentNlu/tencent.go create mode 100644 service/tencentNlu/tencentNlpSkill.go create mode 100644 service/tencentNlu/tencentWs.go create mode 100644 service/tencentNlu/tencentv2.go create mode 100644 service/tencentNlu/utils.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e608483 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +tencent-nlu-parse.exe +main.exe +.vscode/launch.json +__debug_*.exe +c2c.http +reqT0.http +reqT1.http diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e9af88b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,512 @@ +# 更新日志 +## [v1.1.47] - 2025年2月24日20:25:28 +### 新增 +* 新增 local ip. + +## [v1.1.46] - 2025年2月22日11:13:37 +### 新增 +* 新增 CGO_ENABLED=0 字段 + +## [v1.1.45] - 2025年2月21日15:56:07 +### 新增 +* 新增 log service 字段 + +## [v1.1.44-beta.1] - 2024年8月5日11:36:07 +### 新增 +* 新增 "gletkt_xlcj-1245258905417052160","ceshi-1149914105856290816","geliyoupingkongtiao-1289106967398617088","jhdpbxzswd-1364089899207012352","lxtest-1697504067777118921","lxtest-1697504245166677379","lchat-1736631343458063755" 的技能解析 + +## [v1.1.43-beta.28] - 2024年3月20日17:24:15 +### 变更 +* fm 细分码87654321 fm过滤m3u8 更改判断规则 + +## [v1.1.43-beta.27] - 2024年3月20日15:58:34 +### 变更 +* 腾讯切换正式环境 + +## [v1.1.43-beta.26] - 2024年3月20日10:47:31 +### 变更 +* 字段冲突 type更改为newsType + + +## [v1.1.43-beta.25] - 2024年3月4日16:44:11 +### 删除 +* 删除urltype判断逻辑 + +## [v1.1.43-beta.24] - 2024年3月4日15:57:55 +### 变更 +* appkey"a8814080829e11eda5c8e38bb1008e50" mid"10f05" 特殊处理同987654321设备一致 + +## [v1.1.43-beta.23] - 2024年3月4日15:15:19 +### 变更 +* appkey"a8814080829e11eda5c8e38bb1008e50" mid"10f05" 特殊处理同987654321设备一致 + +## [v1.1.43-beta.22] - 2024年2月1日17:17:05 +### 修复 +* 故事 title不存在则从selfData里找 + + +## [v1.1.43-beta.21] - 2024年1月24日15:11:11 +### 修复 +* 旧版 修复闹钟不同步的问题 + +## [v1.1.43-beta.20] - 2024年1月10日15:06:14 +### 变更 +* 旧版 屏蔽音乐的"search_prev_song"意图 + +## [v1.1.43-beta.19] - 2023年12月22日10:04:48 +### 变更 +* 旧版 更改baike获取回复语的方式 +### 新增 +* 流式 新增mchat的解析 + +## [v1.1.43-beta.18] - 2023年11月30日14:31:38 +### 新增 +* 增加对提醒native command指令的支持 + +## [v1.1.43-beta.17] - 2023年11月29日09:56:13 +### 新增 +* 新增homeId + +## [v1.1.43-beta.16] - 2023年11月28日10:39:22 +### 新增 +* tencentWs 接入闹钟提醒技能 +* 修复mid mac 未赋值的问题 + +## [v1.1.43-beta.15] - 2023年11月23日11:15:13 +### 变更 +* OtherDomainWs 的回复语策略 + +## [v1.1.43-beta.14] - 2023年11月23日10:24:06 +### 变更 +* OtherDomainWs 的回复语策略 + +## [v1.1.43-beta.13] - 2023年11月23日10:24:06 +### 变更 +* OtherDomainWs 的回复语策略 + +## [v1.1.43-beta.12] - 2023年11月22日14:22:55 +### 新增 +* 增加技能解析 + +## [v1.1.43-beta.11] - 2023年11月16日10:54:44 +### 新增 +* 增加注释 + +## [v1.1.43-beta.10] - 2023年11月10日09:45:08 +### 变更 +* 直播类型链接过滤逻辑增加mid midType限制 + +## [v1.1.43-beta.9] - 2023年11月8日10:21:15 +### 新增 +* 增加直播类型链接的过滤逻辑, 过滤后资源列表为空时返回回复语"小格没有找到相关的资源哦" + +## [v1.1.43-beta.8] - 2023年10月23日14:00:31 +### 新增 +* tencent wss 增加geography_kbqa general_question_answering htwhys_qa_pairs invention_qa_pairs 的解析 + +## [v1.1.43-beta.7] - 2023年10月23日14:00:31 +### 变更 +* tencent wss 增加language字段 + +## [v1.1.43-beta.6] - 2023年10月9日15:14:46 +### 变更 +* tencent wss 链接地址从consul env中获取 + +## [v1.1.43-beta.5] - 2023年10月9日14:05:08 +### 变更 +* tencent wss 链接地址从consul env中获取 + +## [v1.1.43-beta.4] - 2023年9月27日10:54:13 +### 新增 +* 新增 llm domain 的解析 + +## [v1.1.43-beta.3] - 2023年9月27日10:33:14 +### 删除 +* 去掉特殊处理(特殊处理部分设备切换到腾讯大语言模型bot) + +## [v1.1.43-beta.2] - 2023年9月27日09:58:38 +### 新增 +* 特殊处理部分设备切换到腾讯大语言模型bot + +## [v1.1.43-beta.1] - 2023年9月18日10:40:16 +### 新增 +* 腾讯流式接口 请求增加Location.City字段 +* 增加RewrittenQuery字段 + +## [v1.1.42-beta.2] - 2023年9月18日10:40:16 +### 修复 +* search_ancientpoem_meaning responseText转义字符引发json解析错误 + +## [v1.1.42-beta.1] - 2023年9月13日14:51:14 +### 修复 +* search_ancientpoem_meaning responseText转义字符引发json解析错误 + +## [v1.1.41-beta.4] - 2023年8月3日14:08:56 +### 修复 +* 修复鉴权服务挂掉时引发的错误 + +## [v1.1.41-beta.3] - 2023年7月27日17:18:03 +### 修复 +* 修复鉴权服务挂掉时引发的错误 +### 变更 +* dmsdk status为1时也获取dsn + +## [v1.1.41-beta.2] - 2023年7月27日11:03:12 +### 变更 +* 更改账号绑定\过期的提示话术 +* 完善log输出 + +## [v1.1.41-beta.1] - 2023年7月26日15:37:48 +### 变更 +* 取消globalCtrl下'确定' '取消' 的协议转换 + +## [v1.1.40-beta.40] - 2023年6月29日14:11:48 +### 变更 +* SessionComplete字段缺失问题 + +## [v1.1.40-beta.39] - 2023年6月25日10:59:37 +### 变更 +* 查询闹钟和提醒时, 内容过多就进行截断, 按照句子截断 + +## [v1.1.40-beta.38] - 2023年6月21日15:24:46 +### 变更 +* 优化 日志字段 + +## [v1.1.40-beta.37] - 2023年6月21日11:51:00 +### 新增 +* 增加 腾讯wss 的接入方式 +* 增加 流式grpc接口TencentNluParseStream +* 增加 日志字段 +* 增加 readme对查票接口的说明 + +## [v1.1.40-beta.36] - 2023年6月16日16:10:43 +### 变更 +* 解决weather回复语带有转义字符导致json解析失败的问题 +## [v1.1.40-beta.35] - 2023年6月16日11:28:26 +### 变更 +* 增加日志字段 +* 增加help domain的解析, 使用固定的回复 + +## [v1.1.40-beta.34] - 2023年6月12日15:33:00 +### 变更 +* 增加日志字段 + +## [v1.1.40-beta.33] - 2023年6月12日14:17:00 +### 变更 +* 增加日志字段 + +## [v1.1.40-beta.32] - 2023年6月12日13:36:44 +### 变更 +* 增加日志字段 + +## [v1.1.40-beta.31] - 2023年6月12日10:48:21 +### 变更 +* 增加日志字段 +* news 回复语修改 +* tencentV2 票据字段的校验及默认字段 + +## [v1.1.40-beta.30] - 2023年6月5日10:46:46 +### 变更 +* 从环境变量读取腾讯的配置信息 + +## [v1.1.40-beta.29] - 2023年5月17日09:22:17 +### 变更 +* 删除音乐资源扩充的代码逻辑 + +## [v1.1.40-beta.28] - 2023年5月11日09:36:58 +### 变更 +* 音乐资源扩充到30首, 分组排序方便终端测试 + +## [v1.1.40-beta.27] - 2023年5月10日13:51:52 +### 变更 +* 音乐资源扩充到20首用于测试 + +## [v1.1.40-beta.26] - 2023年5月10日10:37:31 +### 变更 +* 音乐资源扩充到30首用于测试 +* 增加音乐数目限制逻辑(mid非11011机型) + +## [v1.1.40-beta.25] - 2023年5月9日17:18:10 +### 变更 +* dmsdk status==0时 使用其返回的appkey accessToken + +## [v1.1.40-beta.24] - 2023年5月4日13:50:31 +### 变更 +* TokenSearch 使用增加mid vender字段查询dsn + +## [v1.1.40-beta.23] - 2023年4月27日15:36:54 +### 变更 +* 腾讯v2 增加世界之最的解析 +* 腾讯v2 古诗词鉴赏和意思, 拼接增加":" + + +## [v1.1.40-beta.22] - 2023年4月25日16:17:00 +### 变更 +* 腾讯v2 古诗domain中, 查询古诗含义, 查询古诗鉴赏, 拼接textContent 和 Text 进行返回 + +## [v1.1.40-beta.21] - 2023年4月24日13:59:24 +### 变更 +* 腾讯v2 增加mchat的解析 + +## [v1.1.40-beta.20] - 2023年4月19日11:16:51 +### 变更 +* 腾讯v2网关协议变更 auth字段放在http Header中 + +## [v1.1.40-beta.19] - 2023年4月14日11:27:34 +### 变更 +* 协议增加tRequestId字段 +* 腾讯v2 增加requestid参数 + +## [v1.1.40-beta.18] - 2023年4月10日13:58:07 +### 变更 +* 腾讯v2 增加globalctrl3技能的解析 + +## [v1.1.40-beta.17] - 2023年4月4日17:18:55 +### 变更 +* 腾讯v2 不再填充guid字段 + +## [v1.1.40-beta.16] - 2023年4月4日15:42:13 +### 新增 +* 新增guid字段 + +## [v1.1.40-beta.15] - 2023年3月28日15:04:41 +### 新增 +* tencentV2 screen_control volumectrl3 music +### 修复 +* tencentV2 guid的生成方式与旧接口的生成方式进行统一 + +## [v1.1.40-beta.14] - 2023年3月27日10:36:45 +### 修复 +* tencentV2 weather domain 的 text 校验 + +## [v1.1.40-beta.13] - 2023年3月27日10:03:54 +### 修复 +* tencentV2 weather domain 的 selfData 解析出错 + +## [v1.1.40-beta.12] - 2023年3月20日17:05:16 +### 新增 +* 增加鉴权信息字段, 腾讯v2 优先使用被传过来的鉴权信息 + +## [v1.1.40-beta.11] - 2023年3月17日09:06:01 +### 修复 +* 腾讯v2 newsdomain response_text 回复语过长, 替换成固定回复: "为你找到以下新闻:" + +## [v1.1.40-beta.10] - 2023年3月16日17:24:16 +### 修复 +* 删除resType 字段的获取 + +## [v1.1.40-beta.9] - 2023年3月16日11:48:10 +### 新增 +* 腾讯v2接口 新增 Command字段透传 + +## [v1.1.40-beta.8] - 2023年3月15日15:44:38 +### 新增 +* 腾讯v2接口 新增 default domain + +## [v1.1.40-beta.7] - 2023年3月15日15:24:10 +### 变更 +* 腾讯v2接口ip赋值更改为 Header X-Forwarded-For + +## [v1.1.40-beta.6] - 2023年3月15日14:37:59 +### 变更 +* 细分码存在非十进制数字的情况, 将 midType 重命名为vender, 相关的proto协议及数据库表进行更新 + +## [v1.1.40-beta.5] - 2023年3月13日10:43:56 +### 新增 +* 增加服务发现没有找到对应服务的校验机制 +### 变更 +* weather 删除mid限制 删除selfData的返回 +* chengyu 取消转为chat返回 + +## [v1.1.40-beta.4] - 2023年3月9日19:01:11 +### 新增 +* 模拟重定向 + +## [v1.1.40-beta.3] - 2023年3月3日08:49:51 +### 新增 +* 股票 星座 笑话 闲聊 体育 电台 古诗 新闻 节假日 + +## [v1.1.40-beta.2] - 2023年2月28日15:55:28 +### 变更 +* midAppKey 表增加midtype urltype字段, 读取进行兼容 +* 请求协议增加midtype字段 +* 增加新旧bot(接口)的访问逻辑, 指定的mid midtype(细分码)会访问新接口新bot +* 增加腾讯新接口的访问方式 +* 新接口 天气 和 闲聊 技能的解析逻辑 + +## [v1.1.40-beta] - 2023年1月15日11:02:59 +### 优化 +* grpc请求增加 grpc.WithNoProxy() + +## [v1.1.39] - 2023年1月12日11:08:53 +### 修复 +* 修复仅支持中英文翻译的判断逻辑 + +## [v1.1.38] - 2023年1月12日10:40:50 +### 优化 +* 变更consul服务信息获取方式 +* 不再兼容从dmsk获取dsn的http接口 + +## [v1.1.37] - 2023年1月12日09:56:24 +### 新增 +* 增加middleware中间件对panic捕获 + +## [v1.1.36] - 2022年11月18日17:37:12 +### 修复 +* replyWithChat() response_text中含有特殊字符(\n)导致的解析错误问题 +### 新增 +* 对翻译语言进行了限制(测试) + +## [v1.1.35] - 2022年10月28日10:23:16 +### 变更 +* newsDomain 取消replay_present不支持的回复语 + +## [v1.1.34] - 2022年10月21日11:14:33 +### 修复 +* poemDomain response_text中包含需转义的字符串导致json字符串无法加载的问题 + +## [v1.1.33] - 2022年10月14日14:19:37 +### 变更 +* poemDomain 对 "search_ancientpoem_meaning", "search_ancientpoem_appreciation", "search_ancientpoem_chains"意图 response_text进行拼接 + +## [v1.1.32] - 2022年9月14日19:17:35 +### 变更 +* poemDomain responst_text 为空时使用textContent + +## [v1.1.31] - 2022年9月13日14:40:58 +### 变更 +* dislike的协议转换变更为next + +## [v1.1.30] - 2022年9月5日09:31:12 +### 修复 +* fmDomain缺少mediaId +### 新增 +* music 增加playmore dislike的协议转换 +* poem 增加next的协议转换 +* fm 增加playmore next prev 的协议转换 + + +## [v1.1.29] - 2022年8月17日09:14:51 +### 优化 +* 优化consul client初始化方式 +### 新增 +* 增加对 globalctrl.turn_mid 协议转换 + +## [v1.1.28] - 2022年8月11日13:00:28 +### 优化 +* 优化通过consul获取host的方式 + +## [v1.1.27] - 2022年6月20日15:00:12 +### 优化 +* 天气技能 对内存不受限设备返回更多的天气数据 + +## [v1.0.15.1] - 2022年6月9日10:54:57 +### 新增 +- 天气技能 对无内存限制的设备返回更多的天气数据(vp柜机反馈缺少 温度,湿度,紫外线,七天天气数据,24小时温度数据) +### 说明 +- tag v1.0.15 对应CHANGELOG.md文档中的 v1.0.9 +- v1.0.15.1 表示在v1.0.15正式服版本基础上的修改 + +## [v1.1.26] - 2022年5月23日14:38:30 +### 新增 +* 天气技能 对有屏设备返回更多的天气数据(vp柜机反馈缺少 温度,湿度,紫外线,七天天气数据,24小时温度数据) +* config.yaml 配置文件 增加注释 + +## [v1.1.25] - 2022年5月23日10:17:48 +### 优化 +* 禅道 #64 对 music 下指定意图(pause pause_v2 next resume replay stop exit )进行协议转换 +* 禅道 #71 对 fm 下指定意图(change)进行支持, 对指定意图(pause exit stop)进行协议转换 + +## [v1.1.24] - 2022年4月28日10:13:28 +### 修复 +* 未能从dmsdk查票服务获取到Appkey AccessToken 时 通过mid去查AppKey AccessToken + +## [v1.1.23] - 2022年4月21日10:13:28 +### 修复 +* 更新docker file + +## [v1.1.22] - 2022年4月19日10:13:28 +### 修复 +* 更新docker file + +## [v1.1.21] - 2022年3月30日11:25:14 +### 新增 +* 请求叮当服务新增经纬度信息 + +## [v1.1.20] - 2022年3月25日15:26:40 +### 新增 +* 配置文件新增 11f06 10f05 相关的配置 +### 修复 +* 删除v1.1.18 "设备差异化的配置写死" 临时写死的逻辑 + +## [v1.1.19] - 2022年3月25日09:29:30 +### 修复 +* alarmDomain 返回字段格式问题 +* 优化consul实时获取服务消息 + +## [v1.1.18] - 2022年3月22日17:38:36 +### 新增 +* 设备差异化的配置写死 + +### 修复 +* 菜谱协议更改为listItems +* 优化http鉴权 + +## [v1.1.17] - 2022年3月4日15:11:00 +### 新增 +* dmsdk grpc服务不存在时则使用http接口获取鉴权dsn +* 实时从consul中获取服务信息 +* 增加grpc recover中间件 + +## [v1.1.16] - 2022年3月4日15:11:00 +### 修复 +* globalctrl 协议转换, 修复错误字段origin->orgin + +## [v1.1.15] - 2022年3月4日14:18:30 +### 修复 +* globalctrl 协议转换, turn_volume_to 分数 实体 转百分制数值 + +## [v1.1.10] - 时间 +### 新增 +* 接入grpc鉴权服务 + +### 修复 +* 超时采用闲聊兜底 + + +## [v1.0.10] - 2021年12月23日16:02:57 +### 新增 +* 增加"换一批歌曲"的解析 + +### 修复 +* 修复无资源列表返回时不使用服务定义的激活提示回复语 + +## [v1.0.9] - 2021年11月26日15:27:50 +### 新增 +* 从配置文件读取测试音频的链接 + +## [v1.0.8] - 2021年11月11日15:21:34 +### 修复 +* 增加"声道测试"音频资源 + +## [v1.0.7] - 2021年11月8日16:23:53 +### 修复 +* 修复jokeDomain 资源列表为空的时造成的错误 + +## [v1.0.6] - 2021年10月27日10:03:47 +### 修复 +* 增加music next 的返回数据的合法检测, 当腾讯解析返回错误数据时进行兜底回复 + +## [v1.0.5] - 2021年10月19日14:03:45 + +### 修复 +* 因腾讯问题返回jokeDomain资源列表为空时导致的数组越界问题 +* alarmDomain 增加对ret字段的判断,不等于0是不进行闹钟的插入 + +### 新增 +* mid 6400 及相应的appkey及token, 及相应的配置文件 +```sql +INSERT INTO chatroom.mid_appkey +(idmid_appkey, mid, appkey, access_token, mode, uri_type, created_at, updated_at, deleted_at) +VALUES(101, '6400', 'd636a7e02d8111eca6607b3e5760da03', 'f4765fb437d342e2b4bdcf774db81882', 0, 0, '2021-10-15 15:56:45', NULL, NULL); +``` diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d6a60b8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM golang:1.18 AS builder + +WORKDIR /usr/src/tencent-nlu-parse + +COPY ./go.mod /usr/src/tencent-nlu-parse/ + +COPY ./go.sum /usr/src/tencent-nlu-parse/ + +ENV GOPROXY=http://10.7.83.190:6666,https://proxy.golang.com.cn,direct CGO_ENABLED=0 + +RUN echo "hosts: files dns" > /etc/nsswitch.conf && \ + echo -e "112.19.0.219 goproxy.cn\n157.255.30.117 mirrors.aliyun.com">>/etc/hosts && \ + go mod download + +COPY . /usr/src/tencent-nlu-parse/ + +RUN go build -o tencent-nlu-parse + +FROM alpine as runner + +COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +COPY --from=builder /usr/src/tencent-nlu-parse/tencent-nlu-parse /tmp/ + +RUN echo -e "10.7.82.56 e-con-01\n10.7.83.97 m-nlp-03\n10.7.82.133 s-ipd-01\n10.7.80.153 c-gtw-01\n10.7.83.174 s-gtw-01">>/etc/hosts && \ + ls /tmp/tencent-nlu-parse && \ + chmod +x /tmp/tencent-nlu-parse + +CMD ["/tmp/tencent-nlu-parse","-config=env/v2,tencent_nlu_parse/conf","-consul=http://e-con-01:8500", "-name=tencent_nlu_parse","-token=c89cb8e1-dc45-b8d2-1b06-c02684e09b21"] + diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..7f8a315 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,213 @@ +#!/usr/bin/env groovy +pipeline{ + agent any + options { + gitLabConnection('xiejunjie') + gitlabBuilds(builds: ['checkout', 'build','publish','deploy','release']) +// skipDefaultCheckout true + } + environment { + tagName = """${sh(returnStdout: true, script: 'git describe --abbrev=0 --tags').trim()}""" + shortCommit ="""${sh(returnStdout: true, script: "git log -n 1 --pretty=format:'%h'").trim()}""" + registryDomain = ".gree.com" + repo = "docker_proxy" + port = 17971 + jobName ="tencent-nlu-parse" + node="s-otr-01" + index="fluentd-tencent_nlu_parse" + } + triggers{ + GenericTrigger( + genericVariables: [ + [key: 'ref', value: '$.ref'] + ], + causeString: 'Triggered on $ref', + token: 'tencent-nlu-parse-b73b246d4bc9c5c9', + printContributedVariables: true, + printPostContent: true, + silentResponse: false, + regexpFilterText: '$ref', + //regexpFilterExpression: '^refs/heads/(dev\\d*|test|master)$' + ) + } + stages{ + stage("checkout"){ + steps{ + updateGitlabCommitStatus name: 'checkout', state: 'running' + checkout([ + $class: 'GitSCM', + branches: [[ + name: "refs/tags/$tagName" + ]], + extensions: [[ + $class: 'CloneOption', + noTags: false, + reference: '', + shallow: false + ]], + userRemoteConfigs: [[ + credentialsId: 'b56f8c12-cad2-41f0-a85f-36b3b3dc3241', +// credentialsId: '4ec77ef2-5f46-4b8a-b55c-f047f6fdae7d', + url: 'https://api.gree.com/gitlab/560310/tencent-nlu-parse.git' + ]] + ]) + echo "Building shortCommit $tagName" + echo "Building ref $ref" + echo "get code from scm" + } + post { + failure { + updateGitlabCommitStatus name: 'checkout', state: 'failed' + } + aborted { + updateGitlabCommitStatus name: 'checkout', state: 'canceled' + } + success { + updateGitlabCommitStatus name: 'checkout', state: 'success' + } + } + } + stage("build"){ + when { + anyOf{ + environment name: 'deployEnv', value: 'testnlu' + environment name: 'deployEnv', value: 'nlu' + } + } + steps{ + updateGitlabCommitStatus name: 'build', state: 'running' + sh """ + docker build --add-host=goproxy.cn:112.54.108.85 --add-host=proxy.golang.com.cn:112.90.43.134 --add-host=mirrors.aliyun.com:182.89.221.213 --force-rm --no-cache --target runner -t $deployEnv$registryDomain/$repo/${jobName}:${tagName} -f Dockerfile . + """ + } + post { + failure { + updateGitlabCommitStatus name: 'build', state: 'failed' + } + aborted { + updateGitlabCommitStatus name: 'build', state: 'canceled' + } + success { + updateGitlabCommitStatus name: 'build', state: 'success' + } + } + } + stage("publish"){ + when { + anyOf{ + environment name: 'deployEnv', value: 'testnlu' + environment name: 'deployEnv', value: 'nlu' + } + } + steps{ + updateGitlabCommitStatus name: 'publish', state: 'running' + withDockerRegistry([url: "https://testnlu.gree.com",credentialsId: "83d26e44-426f-494a-b771-aac60d07cd7c"]){ + sh "docker push $deployEnv$registryDomain/$repo/${jobName}:${tagName}" + } + } + post { + failure { + updateGitlabCommitStatus name: 'publish', state: 'failed' + } + aborted { + updateGitlabCommitStatus name: 'publish', state: 'canceled' + } + success { + updateGitlabCommitStatus name: 'publish', state: 'success' + } + } + } + stage("deploy"){ + steps{ + echo "deployEnv $deployEnv" + updateGitlabCommitStatus name: 'deploy', state: 'running' + script{ + withCredentials([usernamePassword(credentialsId: '83d26e44-426f-494a-b771-aac60d07cd7c', passwordVariable: 'passwd', usernameVariable: 'user')]) { + if (env.deployEnv=='testnlu'){ + sshPublisher( + publishers: [sshPublisherDesc(configName: 'w-web-01', + transfers: [ + sshTransfer(cleanRemote: false, excludes: '', execCommand: "if [ `sudo docker service ls |grep -w ${jobName}|wc -l` -ge 1 ];then sudo docker service rm ${jobName};fi && \ + sudo docker login -u ${user} -p ${passwd} https://${deployEnv}${registryDomain} && \ + sudo docker service create --with-registry-auth --name ${jobName} -p mode=host,published=${port},target=${port} --network test_gree --replicas 1 --constraint node.platform.os==linux --constraint node.hostname==${node} --log-driver=fluentd --log-opt fluentd-address=10.7.82.112:24224 --log-opt mode=non-blocking --log-opt tag=${index} --restart-condition on-failure --update-delay 10s --update-parallelism 1 --mount type=bind,source=/etc/hosts,target=/etc/hosts --mount type=bind,source=/lib64,target=/lib64 --mount type=bind,source=/var/log/service/${jobName},target=/var/log/service/${jobName} ${deployEnv}${registryDomain}/${repo}/${jobName}:${tagName}", + execTimeout: 120000, + flatten: false, + makeEmptyDirs: false, + noDefaultExcludes: false, + patternSeparator: '[, ]+', + remoteDirectory: '', + remoteDirectorySDF: false, + removePrefix: '', + sourceFiles: '' + ) + ], + usePromotionTimestamp: false, + useWorkspaceInPromotion: false, + verbose: true + )]) + }else if (env.deployEnv=='nlu'){ + sshPublisher( + publishers: [sshPublisherDesc(configName: 'a-gtw-01', + transfers: [ + sshTransfer(cleanRemote: false, excludes: '', execCommand: "if [ `sudo docker ps |grep -w ${jobName}|wc -l` -ge 1 ];then sudo docker stop ${jobName};fi && \ + if [ `sudo docker ps -af status=exited|grep -w ${jobName}|wc -l` -ge 1 ];then sudo docker rm `sudo docker ps -qf status=exited`;fi && \ + sudo docker login -u ${user} -p ${passwd} https://${deployEnv}${registryDomain} && \ + sudo docker run -d --name ${jobName} -p ${port}:${port} ${deployEnv}${registryDomain}/${repo}/${jobName}:${tagName}", + execTimeout: 120000, + flatten: false, + makeEmptyDirs: false, + noDefaultExcludes: false, + patternSeparator: '[, ]+', + remoteDirectory: '', + remoteDirectorySDF: false, + removePrefix: '', + sourceFiles: '' + ) + ], + usePromotionTimestamp: false, + useWorkspaceInPromotion: false, + verbose: true + )]) + } + } + } + } + post { + failure { + updateGitlabCommitStatus name: 'deploy', state: 'failed' + } + aborted { + updateGitlabCommitStatus name: 'deploy', state: 'canceled' + } + success { + updateGitlabCommitStatus name: 'deploy', state: 'success' + } + } + } + stage("release") { + when { + anyOf{ + environment name: 'deployEnv', value: 'testnlu' + environment name: 'deployEnv', value: 'nlu' + } + } + steps { + updateGitlabCommitStatus name: 'release', state: 'running' + echo "Building $BRANCH_NAME" + echo "shortCommit $shortCommit" + //echo "Building $TAG_NAME" + } + post { + failure { + updateGitlabCommitStatus name: 'release', state: 'failed' + } + aborted { + updateGitlabCommitStatus name: 'release', state: 'canceled' + } + success { + updateGitlabCommitStatus name: 'release', state: 'success' + } + } + } +} +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b56dc9d --- /dev/null +++ b/README.md @@ -0,0 +1,152 @@ +### 控制服务 +* 项目:tencent-nlu-parse +* 语言:Go +* 框架:gRPC +* 版本号:v1.1.44 +* 版本控制:git-gitlab +* 用途:腾讯NLU协议转换服务 +* 端口号:由运维同学进入consul中对应的自定义yaml文件中修改配置,自行定义 +* 数据库: mysql:39服务器上的alarm_remind,test_content_url,mid_appkey表 +* 更新日期: 2021.5.25 +* author: 李立辉 +* 更新内容: + 1. 改为gRPC服务 + +--- + +#### 使用 +* 请求 + + 字段|类型|说明|默认值 + :---:|:---:|:---:|:---: + macWifi|string|macWifi|无,必填 + macVioce|string|macVoice|无,必填 + query|string|query|无,必填 + ip|string|ip|无,必填 + testID|string|testID|无,必填 + originQuery|string|originQuery|无,必填 + mid|string|设备的mid, 用于获取botKey和botSecret.|无,必填 + requestId|string|每次请求均不同且唯一,参考uuid. 为设备的请求服务时生成的requestId/uuid.|无,必填 + lbs|-|经纬度信息|无,非必选 + lbs.longitude|double(go对应float64)|经度|无,必选 + lbs.latitude|double(go对应float64)|纬度|无,必选 + +* 响应 + + 字段|类型|说明|默认值 + :---:|:---:|:---:|:---: + status|object|响应状态|无,必选 + status.code|int|0成功,非0失败|无,必选 + status.msg|string|错误信息|无,必选 + data|object|返回数据|无,必选 + data.semanticRespJsonData|string|解析后腾讯nlu的json字符串|无,必选 + +* 启动服务 + + ./test [-port=xxx] [-config=xxx] [-help] [-consul=xxx] [-token=xxx] [-debug=xxx] + 说明: + 1. -port int:启动端口,默认值在conf/config.yaml文件中设置; + 2. -config string:配置文件位置,默认是consul中的env/v1.yaml文件,支持多个配置文件,使用“,”分隔。 + 3. -help: help + 4. -consul string: consul地址, (default "http://172.28.5.39:8500") + 5. -token string: consul token, (default "092288b5-824f-854c-39aa-a958afd9a633") + 6. -debug bool: debug模式运行 + 注意:若需读取该服务自定义consul配置,需在config参数中填写包括env/v1.yaml文件和自定义文件! + +* 查看服务信息 + + ./test -version + +* 服务接入 + + 1. 将[proto文件](/pkg/proto/service.proto)的协议内容复制到所需接入的项目中的proto文件中进行编译, 一般放置在`Project/pkg`目录下. 执行以下指令进行编译`protoc -I=./ --go_out=plugins=grpc:. ./pkg/proto/service.proto` + 2. client接入示例代码 + ```golang + func TencentNluParseExample(macWifi, macVoice, query, ip, originQuery, mid, requestId string) (string, error) { + // TODO: 修改grpc接入的ip:port + conn, err := grpc.Dial("172.28.5.44:8081", grpc.WithInsecure()) + if err != nil { + return "", err + } + defer conn.Close() + + c := proto.NewTencentNluClient(conn) + // TODO: 修改超时时间 + ctx, cancel := context.WithTimeout(context.Background(), time.Second*2) + // import ct context + // ctx, cancel := ct.WithTimeout(ct.Background(), time.Second*2) + defer cancel() + + req := proto.SemanticRequest{MacWifi: macWifi, MacVoice: macVoice, Query: query, Ip: ip, OriginQuery: originQuery, Mid: mid, RequestId: requestId} + + rep, err := c.TencentNluParse(ctx, &req) + if err != nil { + return "", err + } + // TODO: 增加对Status的判断 + return rep.Data.SemanticRespJsonData, nil + } + + func goForTencentNluGrpc(reqStruct *semantic.SemanticReq, resJsonStr chan string, exitSig chan bool) { + var channelStr string + // TODO: requestId 一次请求一个requestId不重复, 一般由设备进行请求 + requestId := "test" + channelStr, err := TencentNluParseExample(reqStruct.MacWifi, reqStruct.MacVoice, reqStruct.Query, reqStruct.Ip, reqStruct.OriginQuery, reqStruct.Mid, requestId) + if err != nil { + return + } + select { + case <-exitSig: + return + case resJsonStr <- channelStr: + } + } + ``` + +### 说明 + +- GetAuthorizationByGRPC 关于票据查询 + code为200的时候切Appkey及accesstoken不为空时, 必然使用Appkey及accesstoken + 有且仅当tokenSearchResponse.Data.Status为2是使用Appkey, accesstoken, auth, dsn +#### mid-appkey + +* 测试服 + +|mid|appkey| +| ---- | ---- | +|11f03| 8d3b6076-3bb4-4c26-89c3-011447996044| +|11f00| 8d3b6076-3bb4-4c26-89c3-011447996044| +|10f04| ef9bc360baae11ea8cec1d1b4b4e3b98| +|10f05| 8d3b6076-3bb4-4c26-89c3-011447996044| +|11011| 8d3b6076-3bb4-4c26-89c3-011447996044| +|11009| 8d3b6076-3bb4-4c26-89c3-011447996044| +|10010| 8d3b6076-3bb4-4c26-89c3-011447996044| +|11008| 8d3b6076-3bb4-4c26-89c3-011447996044| +|10f10| 8d3b6076-3bb4-4c26-89c3-011447996044| +|11f02| 8d3b6076-3bb4-4c26-89c3-011447996044| +|10015_isdelete| 8d3b6076-3bb4-4c26-89c3-011447996044| +|10f03| 8d3b6076-3bb4-4c26-89c3-011447996044| +|10f00| 8d3b6076-3bb4-4c26-89c3-011447996044| + +* mid_appkey 表字段说明 + +|key|type|info| +|----|----|----| +|mid|varchar(50)|设备型号| +|appkey|varchar(200)|云小微平台应用下的Appkey| +|access_token|varchar(200)|云小微平台应用下的AccessToken| +|app_secret|varchar(200)|云小微平台应用下的AppSecret| +|mode|int(11)|类型 0 qq音乐授权 1 酷狗音乐授权(已弃用)2厂商账号授权 3中控boot| +|uri_type|int(11)|类型 0 tencent_v1(默认) 1 腾讯_v2| +|vender|varchar(255)|细分码,默认为空字符串| +|need_activate|tinyint(1)|用于判断是否需要激活, 默认为1| + + +#### 错误码 + +| Code | Msg | +| ---- | ------------------ | +| 0 | 成功 | +| 1500 | 内部服务错误 | +| 1503 | 叮当服务超时 | +| 1504 | 叮当服务请求过快 | diff --git a/conf b/conf deleted file mode 100644 index 8b13789..0000000 --- a/conf +++ /dev/null @@ -1 +0,0 @@ - diff --git a/conf/config.yaml b/conf/config.yaml new file mode 100644 index 0000000..23ac839 --- /dev/null +++ b/conf/config.yaml @@ -0,0 +1,133 @@ +Server: + RunMode: debug #release/debug/test + Name: speech_nlu_parse #注册到consul的服务名 + Tag: #注意是字符数组形式,不允许空数据 + IP: 172.28.124.110 #服务的IP + Port: 13302 #服务的端口 + ConsulAddr: 172.28.124.105:8500 #consul的地址 + Interval: 10 #健康检查间隔,单位:秒 + Deregister: 1 #注销时间,相当于过期时间,单位:分钟 + +Logger: + LogFileName: tencent-nlu-parse + LogFileExt: .log + LogSavePath: /var/log/service/tencent-nlu-parse + MaxSize: 100 #在进行切割之前,日志文件的最大大小(MB为单位) + MaxAge: 30 #保留旧文件的最大天数 + MaxBackups: 30 #保留旧文件的最大个数 + Compress: false #是否压缩/归档旧文件 + +Device: #举例 + Mids: #设备型号 + - xxxxx + AppID: 4875316992302057035 + AppKey: 8df39cf32e993d8325714e557c0dc865 + +DB: + Dsn: root:123456@tcp(172.28.124.105:3306)/chatroom?charset=utf8 + +MusicDomain: + IsQQMusicRemid: true # 是否替换为自定义的提醒 + QQMusicRemid: 。您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。 + AlbumList: [西厢记] + +Auth: + AuthorizationTimeout: 1 + # 关于酷狗的鉴权接口暂未上线正式服, 沿用旧版的鉴权服务 + AuthorizationUrl: https://testnlu.gree.com/semantic/air/dm-sdk/auth + # AuthorizationUrl: http://172.28.5.30:7994/semantic/air/dm-sdk/auth + +DingDang: + DingDangNluUrl: https://aiwx.html5.qq.com/api/v1/richanswerV2 + # DingDangNluUrl: https://aiwx.html5.qq.com/apiexp/v1/richanswerV2 # 测试服 https://aiwx.sparta.html5.qq.com/api + TencentSha256Secret: secretformacwifi@2018zww + +Others: + SoundTestUrl: https://yysbddzx.oss-cn-shenzhen.aliyuncs.com/audio-test/leftrighttest.mp3 # 声道测试音频 + +# 依赖的服务, 用于服务发现 +Services: + Dmsdk: dm-sdk # 授权查询服务 + +DevLimited: # 设备差异化的配置, 通过mid查询对应的配置 + - + Mids: ['10f03','test2'] # ap + Limited: + AlarmNum: -1 # 设置闹钟的数量限制, -1无限制 + Recipe: false # 菜谱播报是否受限. 带屏的可以返回菜谱; 无屏进行提示. true:受限(不返回菜谱, 只进行提示), false:不受限(正常返回菜谱) + FmDomainAlbumList: ['西厢记'] # fm需要屏蔽的Album, 限制播放的内容 + Memory: false # 内存是否受限, 无屏语音设备内存受限. true:受限, false:不受限 + Screen: false # 屏幕是否受限, true:受限(不带屏), false:不受限(带屏) + HistoryNum: -1 # historyDomain 的条数, 仅在内存受限才生效, 例如"历史的今天" 只会播报五条 + IsMusicRemid: true # 未授权的情况下是否进行授权提醒提醒, true:提醒, false:不提醒 + MusicRemidText: 您的设备尚未授权,请前往格力+手机应用绑定授权。 + # MusicRemidText: 您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。 # 未授权的设备进行提醒, 替换到腾讯的回复语 + ShieldedDomainList: [] # 需要进行屏蔽的 + - + Mids: ['10f04'] # 儿童空调(B分体智慧鸟) + Limited: + AlarmNum: 15 + Recipe: true + FmDomainAlbumList: ['西厢记'] + Memory: true + Screen: true + HistoryNum: 5 + IsMusicRemid: true # 测试服为true 暂不更新, 正式服为false; 正式服与测试服的也是有差异. 2022年2月14日11:27:43 + MusicRemidText: 您的设备尚未授权,请前往格力+手机应用绑定授权。 + # MusicRemidText: 您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击酷狗音乐进行授权,授权过程不产生任何费用。 + ShieldedDomainList: [] + - + Mids: ['default'] # 其他空调(一般的语音空调), 默认(mid未出现在上面则使用这个设置) + Limited: + AlarmNum: 15 + Recipe: true + FmDomainAlbumList: ['西厢记'] + Memory: true + Screen: true + HistoryNum: 5 + IsMusicRemid: true + MusicRemidText: 您的设备尚未授权,请前往格力+手机应用绑定授权。 + # MusicRemidText: 您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。 + ShieldedDomainList: [] + - + Mids: ['6400'] # 语音线控器 + Limited: + AlarmNum: -1 + Recipe: true + FmDomainAlbumList: ['西厢记'] + Memory: false + Screen: true + HistoryNum: 5 + # 该mid产品屏蔽了音乐领域, 该项不生效 + IsMusicRemid: false + # 该mid产品屏蔽了音乐领域, 该项不生效 + MusicRemidText: 您的设备尚未授权,请前往格力+手机应用绑定授权。 + # MusicRemidText: 您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。 + ShieldedDomainList: ['music'] + - + Mids: ['11f06'] # vp柜机 + Limited: + AlarmNum: -1 + Recipe: true + FmDomainAlbumList: ['西厢记'] + Memory: false + Screen: false + HistoryNum: -1 + IsMusicRemid: true + MusicRemidText: 您的设备尚未授权,请前往格力+手机应用绑定授权。 + # MusicRemidText: 您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。 + ShieldedDomainList: ['alarm','reminder_v2'] + - + Mids: ['10f05'] # 月亮女神 vp分体 + Limited: + AlarmNum: -1 + Recipe: false + FmDomainAlbumList: ['西厢记'] + Memory: true + Screen: true + HistoryNum: -1 + IsMusicRemid: true + MusicRemidText: 您的设备尚未授权,请前往格力+手机应用绑定授权。 + # MusicRemidText: 您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。 + ShieldedDomainList: [] + \ No newline at end of file diff --git a/dao/dao.go b/dao/dao.go new file mode 100644 index 0000000..0c56c55 --- /dev/null +++ b/dao/dao.go @@ -0,0 +1,70 @@ +package dao + +import ( + "errors" + "speech-nlu-parse/model" +) + +func GetTestContent(mac, query string) (err error, content, url string) { + selectSql := "select content, url from " + test_content_url + " where macwifi='" + mac + "' and query='" + query + "' limit 1" + + rows, err := conn.Query(selectSql) + if err != nil { + return err, "", "" + } + defer rows.Close() + isEmpty := true + for rows.Next() { + isEmpty = false + err := rows.Scan(&content, &url) + if err != nil { + return err, "", "" + } + } + + if isEmpty { + return errors.New("empty test content"), "", "" + } + return +} + +// 查询是否全局自定义 +func GetAnyTestContent(mac, query string) (err error, content, url string) { + selectSql := "select content, url from test_content_url where macwifi='any' and query='" + query + "'" + rows, err := conn.Query(selectSql) + if err != nil { + return err, "", "" + } + defer rows.Close() + isEmpty := true + for rows.Next() { + isEmpty = false + err := rows.Scan(&content, &url) + if err != nil { + return err, "", "" + } + } + if isEmpty { + return errors.New("empty test any content"), "", "" + } + return +} + +func GetMidAppKey() ([]*model.MidAppKey, error) { + sql := "select mid, appkey, access_token, vender, uri_type from " + mid_appkey + rows, err := conn.Query(sql) + if err != nil { + return nil, err + } + defer rows.Close() + midAppKeyArr := make([]*model.MidAppKey, 0) + for rows.Next() { + var midAppKey = &model.MidAppKey{} + err = rows.Scan(&midAppKey.Mid, &midAppKey.AppKey, &midAppKey.AccessToken, &midAppKey.Vender, &midAppKey.UrlType) + if err != nil { + return nil, err + } + midAppKeyArr = append(midAppKeyArr, midAppKey) + } + return midAppKeyArr, nil +} diff --git a/dao/init.go b/dao/init.go new file mode 100644 index 0000000..f070873 --- /dev/null +++ b/dao/init.go @@ -0,0 +1,62 @@ +package dao + +import ( + "database/sql" + "fmt" + "time" +) + +const ( + //devDB = "de_records_ctocst" //空调聊天记录数据表 + // devDB = "de_ctoclog_st" + //devDB = "de_records" + // asDB = "as_records" //语音助手聊条记录数据表 + arDB = "alarm_remind" //闹钟数据表 + // notsupportTB = "greenlu_notsupport" //格力NLU不支持的语句 + // errorLog = "ctoc_errorlog" + // greenlu_semantic = "ctoc_greenlu_semantic" + // tencent_senmantic = "ctoc_tencent_semantic_log" + // control_semantic = "ctoc_control_semantic" + // skillUseDB = "ctoc_skill_user_like" + // homeinfoDB = "de_homeinfo_conn" + // ctoc_req_ala = "ctoc_req_ala" + test_content_url = "test_content_url" + mid_appkey = "mid_appkey" +) + +const ( + DevRecords = 1 << iota //空调聊天记录标志 + AssRecords //语音助手聊条记录标志 +) + +const ( + alarm = "0" + remind = "1" + countdown = "2" +) + +var conn *sql.DB + +func GetConn() *sql.DB { + return conn +} + +func InitDB(dsn string) error { + var err error + conn, err = sql.Open("mysql", dsn) + if err != nil { + //log.Fatalln(err.Error() + " connect database error") + fmt.Println("ctocst[error]:connect database error!->" + err.Error()) + + //LogErrorToFile(logfileError, "database error:" + err.Error()) + return err + } + err = conn.Ping() + if err != nil { + return err + } + conn.SetConnMaxLifetime(time.Minute * 3) + return nil + //conn.SetMaxOpenConns(1000) + //conn.SetMaxIdleConns(500) +} diff --git a/dao/recordsop.go b/dao/recordsop.go new file mode 100644 index 0000000..42b1e02 --- /dev/null +++ b/dao/recordsop.go @@ -0,0 +1,159 @@ +package dao + +import ( + "database/sql" + "fmt" + "speech-nlu-parse/model" + "strconv" + "time" +) + +// 保存闹钟、提醒数据 +func insertAlarmRemind(alarmInfo model.AlarmRemindInfo, con *sql.DB) error { + errd := deleteOverDue(alarmInfo.Mac, con) + if errd != nil { + return errd + } + err, isExist := checkAlarmExist(alarmInfo, con) + if err != nil { + fmt.Println(err.Error() + "InsertAlarmRemind") + return err + } else { + if !isExist { + insertSql := "INSERT INTO " + arDB + "(mac,e_date,e_time,note,type,repeaet_type,status, " + + "countdown_duration, create_time, oid, url, content, speech_type) VALUES('" + alarmInfo.Mac + "'," + + "'" + alarmInfo.E_date + "','" + alarmInfo.E_time + "','" + alarmInfo.Note + "'," + + "'" + alarmInfo.E_type + "','" + strconv.Itoa(alarmInfo.Repeat_type) + "'," + + "'" + strconv.Itoa(alarmInfo.Status) + "','" + strconv.Itoa(alarmInfo.Countdown_duration) + "'," + + "'" + alarmInfo.Createtime + "','" + alarmInfo.Oid + "','" + alarmInfo.URL + "'," + + "'" + alarmInfo.Content + "'," + + "'" + alarmInfo.Speech_Type + "')" + _, err := con.Exec(insertSql) + if err != nil { + fmt.Println(err.Error() + insertSql) + } + return err + } else { + if alarmInfo.E_type == remind { + + updateSql := "UPDATE " + arDB + " SET note='" + alarmInfo.Note + "', " + + "content='" + alarmInfo.Content + "' WHERE mac='" + alarmInfo. + Mac + "' AND e_date='" + alarmInfo.E_date + "' AND e_time='" + alarmInfo.E_time + "' AND repeaet_type='" + strconv.Itoa(alarmInfo.Repeat_type) + "' AND type='" + alarmInfo.E_type + "'" + _, err := con.Exec(updateSql) + if err != nil { + fmt.Println("update remind failed") + return err + } + } + fmt.Println(time.Now().String()[:19], alarmInfo.Oid, " exists") + } + } + return nil + +} + +// 删除过期闹钟 +func deleteOverDue(mac string, con *sql.DB) error { + //select * from alarm_remind where repeaet_type = '1' AND (e_date <= date(now()) or (e_date <= date(now()) AND e_time <= time(now()))) + // + deleteSql := "delete from " + arDB + " where mac='" + mac + "' AND repeaet_type = '1' AND (e_date < date(now()) or (e_date <= date(now()) AND e_time < time(now())))" + _, err := con.Exec(deleteSql) + if err != nil { + fmt.Println(err.Error()) + return err + } + return nil + +} + +// 检查是否以及存在 +func checkAlarmExist(alarmInfo model.AlarmRemindInfo, con *sql.DB) (error, bool) { + selectSql := "SELECT 1 FROM " + arDB + " where mac='" + alarmInfo.Mac + "' AND e_date= '" + alarmInfo.E_date + "' AND e_time='" + alarmInfo.E_time + "' AND type='" + alarmInfo.E_type + "' AND repeaet_type='" + strconv.Itoa(alarmInfo.Repeat_type) + "' limit 1" + var rows *sql.Rows + rows, err := con.Query(selectSql) + if err != nil { + fmt.Println(err.Error() + "->CheckAlarmExist") + + } + defer rows.Close() + isExist := false + for rows.Next() { + isExist = true + } + return err, isExist + +} + +func deleteAlarm(alarmInfo model.AlarmRemindInfo, con *sql.DB) error { + errd := deleteOverDue(alarmInfo.Mac, con) + if errd != nil { + return errd + } + deleteSql := "DELETE FROM " + arDB + " WHERE mac='" + alarmInfo.Mac + "' AND oid= '" + alarmInfo.Oid + "'" + fmt.Println(deleteSql) + re, err := con.Exec(deleteSql) + if err != nil { + fmt.Println(err.Error() + " " + deleteSql) + return err + } + affectRows, err := re.RowsAffected() + if err != nil { + fmt.Println(err.Error()) + return err + } + fmt.Printf("affected rows:%v", affectRows) + return nil +} + +func deleteAllAlarm(mac string, con *sql.DB) error { + deleteSql := "DELETE FROM " + arDB + " WHERE mac='" + mac + "'" + // fmt.Println(deleteSql) + re, err := con.Exec(deleteSql) + if err != nil { + fmt.Println(err.Error() + " " + deleteSql) + return err + } + affectRows, err := re.RowsAffected() + if err != nil { + fmt.Println(err.Error()) + return err + } + fmt.Printf("deleteAllAlarm affected rows:%v\n", affectRows) + return nil +} + +// 保存闹钟提醒 +func SaveAlarmRemindData(alarmData model.AlarmRemindInfo) { + err := insertAlarmRemind(alarmData, conn) + if err != nil { + fmt.Println(err.Error()) + // utils.LogErrorToFile(*config.LogfileError, "database error(InsertAlarmRemind):"+err.Error()) + } +} + +// 取消闹钟 +func DeleteAlarmRemindData(alarmData model.AlarmRemindInfo) { + err := deleteAlarm(alarmData, conn) + if err != nil { + fmt.Println(err.Error()) + // utils.LogErrorToFile(*config.LogfileError, "database error(deleteAlarmRemindData):"+err.Error()) + } +} + +// 删除过期闹钟 +func DeleteOverdueAlarmRemindData(mac string) { + err := deleteOverDue(mac, conn) + if err != nil { + fmt.Println(err.Error()) + // utils.LogErrorToFile(*config.LogfileError, "database error(deleteOverdueAlarmRemindData):"+err.Error()) + } +} + +// 删除所有闹钟 +func DeleteAllAlarmRemindData(mac string) { + err := deleteAllAlarm(mac, conn) + if err != nil { + fmt.Println(err.Error()) + // utils.LogErrorToFile(*config.LogfileError, "database error(deleteOverdueAlarmRemindData):"+err.Error()) + } +} diff --git a/doc/music.md b/doc/music.md new file mode 100644 index 0000000..9bd353b --- /dev/null +++ b/doc/music.md @@ -0,0 +1,161 @@ +### play + +字段|类型|说明|默认值 +:---:|:---:|:---:|:---: +header|object|header|| +header.semantic|object|semantic|| +header.semantic.code|int|错误码|| +header.semantic.domain|string|技能名称|| +header.semantic.intent|string|意图|| +header.semantic.msg|string||| +header.semantic.session_complete|bool||| +header.semantic.skill_id|string||| +response_text|string|回复语|| +asr_recongize|string|输入话术|| +listItems|arr|资源列表|| +listItems[...].url|string|资源url|| +listItems[...].singer|string|歌手|| +listItems[...].song|string|歌名|| +listItems[...].mediaId|string|资源id|| +listItems[...].songId|string|音乐id|| + + + +原始json +```json +{ + "header": { + "semantic": { + "code": 0, + "domain": "music", + "intent": "play", + "msg": "", + "session_complete": true, + "skill_id": "990835315751129088" + } + }, + "response_text": "我挑了一些你可能会喜欢的歌,听听吧。", + "asr_recongize": "播放音乐", + "listItems": [{ + "url": "http://isure6.stream.qqmusic.qq.com/C400003giDjB32HJqA.m4a?guid=2000000128&vkey=17AF5AAD48EE41F67C6F6ECD74BC5934E8E12DF3ACB131179BFADE4B6881BBD5C196E8C6F5D653CB44BDFC4458C16BDA16E3DC22A7ACD7B3&uin=&fromtag=184", + "singer": "dsslio", + "song": "黄碧云", + "mediaId": "234635158", + "songId": "234635158" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400000ZSjDB2nweDF.m4a?guid=2000000128&vkey=844781655A7CC1251C74818E2A4EC96CCCB4450B5557A08032AD3C9539E14D0BBFB33A5E4C475E258331889AC4582F91A6CC6142DC5CA494&uin=&fromtag=184", + "singer": "陈书宇ShuYu", + "song": "谁伸出援手", + "mediaId": "214004688", + "songId": "214004688" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400003GBheu2tDooN.m4a?guid=2000000128&vkey=8366F7355C57482F3B338D3543C8AB7D0CE4216DCA33650C4A62F3AABA0C0D989B69D882CAC9C9A67025905F3027576DA12050C0AB6D4008&uin=&fromtag=184", + "singer": "Setback Line", + "song": "29", + "mediaId": "233317760", + "songId": "233317760" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C4000041eN6V4ZM15Q.m4a?guid=2000000128&vkey=4F28F18137E3B53C6099075D1D8E5D110BE7148464AA05AD09A5FB979C5442C068AB2B8D08AF4F36A9B4111968A5B1E7EE9D219E8B282CF3&uin=&fromtag=184", + "singer": "好歌", + "song": "最后也没有", + "mediaId": "219220572", + "songId": "219220572" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C4000018VSdr3E89uK.m4a?guid=2000000128&vkey=525423C3178F462572772401674BD103D5E73BC1F40218AA922EB5834E6216DE1AA9B0B273470E48FAEC806B449BCB01006ADCBCF8583245&uin=&fromtag=184", + "singer": "小春", + "song": "苏州河边", + "mediaId": "236170226", + "songId": "236170226" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400001Ltf7646BNbb.m4a?guid=2000000128&vkey=41D071F8F8A11CB953BC552B8DAF033EEEDFE9DA0425DE288D9865EFC9AB7FE09B7A710329A00E4E4634A0C500E45283770C5ADCBF83ED6B&uin=&fromtag=184", + "singer": "圈儿", + "song": "旋律在心中", + "mediaId": "231086619", + "songId": "231086619" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400001oJ8Ac3h9dJW.m4a?guid=2000000128&vkey=E398AABFC01681D5C5D55FF1E7E0C5279CF18F9C0B28779789FC0023F128E149C576AD0C8E053182F2FC7D6C0165CF749E6F87D22F1D7D08&uin=&fromtag=184", + "singer": "紫薇", + "song": "云霞曲", + "mediaId": "212796064", + "songId": "212796064" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400002v68SZ2ulL5f.m4a?guid=2000000128&vkey=08797EA95ED28B72C0D9EA72A36E1B2E9DE0C2FE718E5F3A750BF9E162F506D655CF0AF14C6EA88C0669ED7D91B88CB427E2A280A5B0A9E9&uin=&fromtag=184", + "singer": "好歌", + "song": "不是快乐", + "mediaId": "219220805", + "songId": "219220805" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400004B6bhX323Tqa.m4a?guid=2000000128&vkey=2C771A0A2D524065E9D0AE3787E10AB83D618B029380BB5FAF0A9A0B6369F34CF1AFD6F3CDC277ED6273A09FEF82B137933E0C83756DDE23&uin=&fromtag=184", + "singer": "东缘阁", + "song": "洒脱", + "mediaId": "239478828", + "songId": "239478828" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400000JdxKl49vqUe.m4a?guid=2000000128&vkey=DF0F2B5BBA48F1B364631BB7003FDD9F11071E4BBFCB0D3DA236444577BE921DC20158BF02BD7BE70EB10437ECF4B4A72C71BA4A287C97BB&uin=&fromtag=184", + "singer": "全代扬", + "song": "长发", + "mediaId": "231270353", + "songId": "231270353" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400001cWLgO48eOCx.m4a?guid=2000000128&vkey=51070ABB7F7861664135D9DFDF6A1296409DD1FADC336DC363C8146B18DEE8353875407157DE94FA37E0FBAE11DC636F8050ADF684590DC0&uin=&fromtag=184", + "singer": "单沫文", + "song": "原谅我爱失落", + "mediaId": "232270316", + "songId": "232270316" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400004TcR2O3NEtOv.m4a?guid=2000000128&vkey=24A36E023350DF3FB9D1A0FD05E662FD238C988A9461B7DF452F90A8450D069B3B6E84842506CD11E48DC7DBEF21206E52A15D58267780A9&uin=&fromtag=184", + "singer": "圣殿骑士乐队", + "song": "翡翠号角", + "mediaId": "213767301", + "songId": "213767301" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400002ykGt01wbKzV.m4a?guid=2000000128&vkey=27663413B81AA926F172C7DAE9C8A367B0BBB773AC4145C41F503946523B325EDD041C5E402D48D9040F51CECC08F19EB99118EEA0C999DE&uin=&fromtag=184", + "singer": "田茜娜", + "song": "爱情宣告", + "mediaId": "231536655", + "songId": "231536655" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400002lol8s0AeGcb.m4a?guid=2000000128&vkey=002710C3915F5074EE3C5B27D10FEC9AF9699320F8977654335DE1419A6DAA28A86B1E40775F0C350A8C3B2ADEEB9CC600A2D3ABC6CC4012&uin=&fromtag=184", + "singer": "范书雅 Shuya", + "song": "李察吉尔", + "mediaId": "234435286", + "songId": "234435286" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400004bIQBJ4Gk4Dp.m4a?guid=2000000128&vkey=6B8784FB7EE323F66BC4886172C8608893A07A49EA6127CA4E17240FC1E5DD0E54229E229D1A60E4A1F30C9CA3FEB7B42B89B608B2DB3ECC&uin=&fromtag=184", + "singer": "戴阳", + "song": "到老好不好", + "mediaId": "101794547", + "songId": "101794547" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C40000367gQN3qmX87.m4a?guid=2000000128&vkey=1AF8F2F17F737D7C3F53A0B3F39FFAEE7BFC1BC0220E7DA36859A47E550AFABFC4FA36E7159923E8B102CC9E7ADB6C96590FAC070F74A117&uin=&fromtag=184", + "singer": "好歌", + "song": "又没有救", + "mediaId": "219220738", + "songId": "219220738" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400001MGRGL1jRUKn.m4a?guid=2000000128&vkey=ECA0D1729A4B6E20B8581354BF4EBBAEEFCB689B5BBF5866347CDA9A5C2BB076B39C425759810E46A0F2FF5CA8C85E341F39887B972B92AE&uin=&fromtag=184", + "singer": "P!SCO", + "song": "怎哭了", + "mediaId": "105540124", + "songId": "105540124" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C4000023KRcu16OSPK.m4a?guid=2000000128&vkey=1E172A71886CC8FF5D8E07DFDBD007C74A76EE9889F8704538DBED2393214681D465EB853D2EDB9F5AE438125A11CACD68EFC22DE1A08615&uin=&fromtag=184", + "singer": "人性先觉", + "song": "韧性", + "mediaId": "200871036", + "songId": "200871036" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400001pb5JS3sZGxu.m4a?guid=2000000128&vkey=C464413681724FE4D94AF67832C36DA491D680B9F6487D96171678B19FBDE48FBA1FE5D9F019C77A3FA71101C471B893F4B011F21F3E8D13&uin=&fromtag=184", + "singer": "LYRA", + "song": "如果", + "mediaId": "105532858", + "songId": "105532858" + }, { + "url": "http://isure6.stream.qqmusic.qq.com/C400004MHkkD43xKma.m4a?guid=2000000128&vkey=E3645FEF6EEAB5F983DCAB2700B92A3D09CDB5DFBF6EE00AD897E8A4FC35A44021A265B89D722EFA6B5006058BAD26372541C829C97385DF&uin=&fromtag=184", + "singer": "孙爱光/台北YMCA圣乐合唱团", + "song": "忆秦淮", + "mediaId": "202792220", + "songId": "202792220" + }] +} +``` \ No newline at end of file diff --git a/global/bot.go b/global/bot.go new file mode 100644 index 0000000..b4166d2 --- /dev/null +++ b/global/bot.go @@ -0,0 +1,60 @@ +package global + +import ( + "speech-nlu-parse/dao" + "speech-nlu-parse/model" +) + +// 叮当 bot, key 和 secret, 服务启动从数据库查询并加载 + +// var DingDangBot map[string]*model.DingDangBot +var DingDangBot Bot + +type Bot struct { + DingDangBot map[string]map[string]*model.DingDangBot // mid-midtype-bot +} + +func NewBot() Bot { + return Bot{ + DingDangBot: make(map[string]map[string]*model.DingDangBot), + } +} + +func (this *Bot) Get(mid string, midType string) (*model.DingDangBot, bool) { + _, ok := this.DingDangBot[mid] + if !ok { + // mid不存在 + return nil, false + } + bot, ok := this.DingDangBot[mid][midType] + if !ok { + // midType不存在 + bot, ok = this.DingDangBot[mid][""] + if !ok { + // 默认的也不存在 + Logger.Errorf("GetDingDangBot error.mid: %v, midType: %v", mid, midType) + return nil, false + } + return bot, true + } else { + return bot, true + } +} + +func InitDingDangBot() error { + midAppKeyArr, err := dao.GetMidAppKey() + if err != nil { + return err + } + + temp := NewBot() + for i := 0; i < len(midAppKeyArr); i++ { + if temp.DingDangBot[midAppKeyArr[i].Mid] == nil { + temp.DingDangBot[midAppKeyArr[i].Mid] = make(map[string]*model.DingDangBot) + } + temp.DingDangBot[midAppKeyArr[i].Mid][midAppKeyArr[i].Vender] = &model.DingDangBot{Key: midAppKeyArr[i].AppKey, Secret: midAppKeyArr[i].AccessToken, UrlType: midAppKeyArr[i].UrlType} + } + DingDangBot = temp + + return nil +} diff --git a/global/const.go b/global/const.go new file mode 100644 index 0000000..6885b49 --- /dev/null +++ b/global/const.go @@ -0,0 +1,14 @@ +package global + +const ( + DOMAIN_PLAYCONTROL = "PlayControl" + + INTENT_CONTROL_PAUSE = "control_pause" + INTENT_CONTROL_EXIT = "control_exit" + INTENT_CONTROL_STOP = "control_stop" + INTENT_CONTROL_NEXT = "control_next" + INTENT_CONTROL_RESUME = "control_resume" + INTENT_CONTROL_REPLAY = "control_replay" + INTENT_CONTROL_PREVIOUS = "control_previous" + INTENT_QUERY_SONG = "query_song" +) diff --git a/global/mid.go b/global/mid.go new file mode 100644 index 0000000..c9ae047 --- /dev/null +++ b/global/mid.go @@ -0,0 +1,122 @@ +package global + +import ( + "speech-nlu-parse/pkg/setting" +) + +// 设备差异化 + +var DevLimitedArr []*setting.DevLimitedS + +var limitedSetting map[string]*setting.LimitedS + +// 临时写死 +func InitDevLimitedArr() { + DevLimitedArr = append(DevLimitedArr, &setting.DevLimitedS{ + Mids: []string{"default"}, + Limited: setting.LimitedS{ + AlarmNum: 15, + Recipe: true, + FmDomainAlbumList: []string{"西厢记"}, + Memory: true, + Screen: true, + HistoryNum: 5, + IsMusicRemid: true, + MusicRemidText: "您的设备尚未授权,请前往格力+手机应用绑定授权。", + ShieldedDomainList: []string{}, + }, + }) + DevLimitedArr = append(DevLimitedArr, &setting.DevLimitedS{ + Mids: []string{"10f03"}, + Limited: setting.LimitedS{ + AlarmNum: -1, // 设置闹钟的数量限制, -1无限制 + Recipe: false, // 菜谱播报是否受限. 带屏的可以返回菜谱; 无屏进行提示. true:受限(不返回菜谱, 只进行提示), false:不受限(正常返回菜谱) + FmDomainAlbumList: []string{"西厢记"}, // fm需要屏蔽的Album, 限制播放的内容 + Memory: false, // 内存是否受限, 无屏语音设备内存受限. true:受限, false:不受限 + Screen: false, // 屏幕是否受限, true:受限(不带屏), false:不受限(带屏) + HistoryNum: -1, // historyDomain 的条数, 仅在内存受限才生效, 例如"历史的今天" 只会播报五条 + IsMusicRemid: true, // 未授权的情况下是否进行授权提醒提醒, true:提醒, false:不提醒 + MusicRemidText: "您的设备尚未授权,请前往格力+手机应用绑定授权。", // MusicRemidText: 您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。 # 未授权的设备进行提醒, 替换到腾讯的回复语 + ShieldedDomainList: []string{}, // 需要进行屏蔽的 + }, + }) + DevLimitedArr = append(DevLimitedArr, &setting.DevLimitedS{ + Mids: []string{"10f04"}, + Limited: setting.LimitedS{ + AlarmNum: 15, + Recipe: true, + FmDomainAlbumList: []string{"西厢记"}, + Memory: true, + Screen: true, + HistoryNum: 5, + IsMusicRemid: false, // 测试服为true, 正式服为false; 正式服与测试服的也是有差异, 原因: 未切换酷狗音乐. 2022年2月14日11:27:43 + MusicRemidText: "您的设备尚未授权,请前往格力+手机应用绑定授权。", // MusicRemidText: 您的语音空调尚未激活,请尽快更新格力+APP,进入语音空调语音技能页面,点击酷狗音乐进行授权,授权过程不产生任何费用。 + ShieldedDomainList: []string{}, + }, + }) + DevLimitedArr = append(DevLimitedArr, &setting.DevLimitedS{ + Mids: []string{"6400"}, + Limited: setting.LimitedS{ + AlarmNum: -1, + Recipe: true, + FmDomainAlbumList: []string{"西厢记"}, + Memory: false, + Screen: true, + HistoryNum: 5, + IsMusicRemid: false, // 该mid产品屏蔽了音乐领域, 该项不生效 + MusicRemidText: "您的设备尚未授权,请前往格力+手机应用绑定授权。", // 该mid产品屏蔽了音乐领域, 该项不生效 + ShieldedDomainList: []string{"music"}, + }, + }) + DevLimitedArr = append(DevLimitedArr, &setting.DevLimitedS{ + Mids: []string{"11f06"}, + Limited: setting.LimitedS{ + AlarmNum: -1, + Recipe: false, + FmDomainAlbumList: []string{"西厢记"}, + Memory: false, + Screen: false, + HistoryNum: -1, + IsMusicRemid: false, + MusicRemidText: "您的设备尚未授权,请前往格力+手机应用绑定授权。", + ShieldedDomainList: []string{}, + }, + }) + DevLimitedArr = append(DevLimitedArr, &setting.DevLimitedS{ + Mids: []string{"10f05"}, + Limited: setting.LimitedS{ + AlarmNum: -1, + Recipe: false, + FmDomainAlbumList: []string{"西厢记"}, + Memory: true, + Screen: true, + HistoryNum: -1, + IsMusicRemid: false, + MusicRemidText: "您的设备尚未授权,请前往格力+手机应用绑定授权。", + ShieldedDomainList: []string{}, + }, + }) +} + +func InitLimitedSetting() { + limitedSetting = make(map[string]*setting.LimitedS) + // 临时写死 + // 删除写死操作 + // InitDevLimitedArr() + // 初始化 + for i := 0; i < len(DevLimitedArr); i++ { + for j := 0; j < len(DevLimitedArr[i].Mids); j++ { + limitedSetting[DevLimitedArr[i].Mids[j]] = &DevLimitedArr[i].Limited + } + } +} + +// 通过mid获取配置 +func GetLimitedSetting(mid string) *setting.LimitedS { + value, ok := limitedSetting[mid] + if ok { + return value + } else { + return limitedSetting["default"] + } +} diff --git a/global/service.go b/global/service.go new file mode 100644 index 0000000..dc9249d --- /dev/null +++ b/global/service.go @@ -0,0 +1,46 @@ +package global + +import ( + "math/rand" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/consul" + + "github.com/hashicorp/consul/api" +) + +// 从consul中获取 +var serviceMap map[string][]*model.Service +var ( + consulUrl string + consulToken string +) + +var ConsulCient *api.Client + +func InitConsulCient(url, token string) { + config := api.DefaultConfig() + config.Address = url + config.Token = token + var err error + ConsulCient, err = api.NewClient(config) + if err != nil { + panic(err) + } +} + +func InitServiceMap(url string, token string) { + consulUrl = url + consulToken = token + InitConsulCient(consulUrl, consulToken) +} + +func GetService(name string) *model.Service { + // 重新从consul上获取 + services := consul.GetService2(ConsulCient, name, "") + if services == nil || len(services) <= 0 { + return nil + } else { + index := rand.Intn(len(services)) + return &model.Service{Address: services[index].Service.Address, Port: services[index].Service.Port} + } +} diff --git a/global/setting.go b/global/setting.go new file mode 100644 index 0000000..367018f --- /dev/null +++ b/global/setting.go @@ -0,0 +1,23 @@ +package global + +import ( + "speech-nlu-parse/pkg/consul" + "speech-nlu-parse/pkg/logger" + "speech-nlu-parse/pkg/setting" +) + +var ( + ServerSetting *consul.ConsulSettingS + LoggerSetting *setting.LogSettingS + DeviceSetting *setting.DeviceSettingS + Logger *logger.Logger + InternalRemoteSetting *setting.InternalRemoteSettingS + DBSetting *setting.DBSettingS + MusicDomainSetting *setting.MusicDomainSettingS + AuthSetting *setting.AuthSettingS + TencentSetting *setting.TencentSettingS + OthersSetting *setting.OthersSettingS + ServiceSetting *setting.ServiceSettingS + ConsulObj *consul.ConsulObj + TencentGwSetting *setting.TencentGwSetting +) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..28e1633 --- /dev/null +++ b/go.mod @@ -0,0 +1,61 @@ +module speech-nlu-parse + +go 1.18 + +require ( + github.com/go-sql-driver/mysql v1.7.1 + github.com/golang/protobuf v1.5.3 + github.com/gorilla/websocket v1.5.0 + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 + github.com/hashicorp/consul/api v1.21.0 + github.com/jinzhu/gorm v1.9.16 + github.com/json-iterator/go v1.1.12 + github.com/parnurzeal/gorequest v0.2.16 + github.com/spf13/viper v1.16.0 + github.com/tidwall/gjson v1.14.4 + go.uber.org/zap v1.24.0 + google.golang.org/grpc v1.56.0 + google.golang.org/protobuf v1.30.0 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 +) + +require ( + github.com/armon/go-metrics v0.4.0 // indirect + github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-rootcerts v1.0.2 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/serf v0.10.1 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/smartystreets/goconvey v1.8.0 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.4.2 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.8.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + moul.io/http2curl v1.0.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..de0f199 --- /dev/null +++ b/go.sum @@ -0,0 +1,728 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= +github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 h1:RIB4cRk+lBqKK3Oy0r2gRX4ui7tuhiZq2SuTtTCi0/0= +github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/hashicorp/consul/api v1.21.0 h1:WMR2JiyuaQWRAMFaOGiYfY4Q4HRpyYRe/oYQofjyduM= +github.com/hashicorp/consul/api v1.21.0/go.mod h1:f8zVJwBcLdr1IQnfdfszjUM0xzp31Zl3bpws3pL9uFM= +github.com/hashicorp/consul/sdk v0.13.1 h1:EygWVWWMczTzXGpO93awkHFzfUka6hLYJ0qhETd+6lY= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= +github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= +github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= +github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= +github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= +github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/parnurzeal/gorequest v0.2.16 h1:T/5x+/4BT+nj+3eSknXmCTnEVGSzFzPGdpqmUVVZXHQ= +github.com/parnurzeal/gorequest v0.2.16/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/smartystreets/assertions v1.13.1 h1:Ef7KhSmjZcK6AVf9YbJdvPYG9avaF0ZxudX+ThRdWfU= +github.com/smartystreets/goconvey v1.8.0 h1:Oi49ha/2MURE0WexF052Z0m+BNSGirfjg5RL+JXWq3w= +github.com/smartystreets/goconvey v1.8.0/go.mod h1:EdX8jtrTIj26jmjCOVNMVSIYAtgexqXKHOXW2Dx9JLg= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= +github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.56.0 h1:+y7Bs8rtMd07LeXmL3NxcTLn7mUkbKZqEpPhMNkwJEE= +google.golang.org/grpc v1.56.0/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8= +moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/main.go b/main.go new file mode 100644 index 0000000..68b64b2 --- /dev/null +++ b/main.go @@ -0,0 +1,265 @@ +package main + +import ( + "errors" + "flag" + "fmt" + "log" + "net" + "net/url" + "runtime" + "strings" + "time" + + "speech-nlu-parse/dao" + "speech-nlu-parse/global" + "speech-nlu-parse/middleware" + "speech-nlu-parse/pkg/consul" + "speech-nlu-parse/pkg/logger" + "speech-nlu-parse/pkg/proto" + "speech-nlu-parse/pkg/setting" + "speech-nlu-parse/service" + + grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" + + "google.golang.org/grpc" + "google.golang.org/grpc/health/grpc_health_v1" + "google.golang.org/grpc/reflection" + "gopkg.in/natefinch/lumberjack.v2" +) + +var ( + serverName string + serverTag string + ip string + port int + consulAddr string + config string + runMode string + + isHelp bool + isVersion bool + buildTime string + buildVersion string + author string + consulToken string + consulUrl string +) + +func setup() error { + // 命令行读取参数 + err := setupFlag() + if err != nil { + log.Fatalf("init.setupFlag err: %v", err) + return err + } + // 判断help + if isHelp { + fmt.Println("编译后\n" + + "Linux可执行: ./tencent-nlu-parse [command=xxx]\n" + + "Windows可执行: ./tencent-nlu-parse.exe [command=xxx]\n\n" + + "option:") + flag.PrintDefaults() + return errors.New("missing params.") + } + + if isVersion { + fmt.Println("build_time: ", buildTime) + fmt.Println("build_version: ", buildVersion) + fmt.Println("go_version: ", runtime.Version()) + fmt.Println("author: ", author) + return errors.New("missing params.") + } + + err = setupSetting() + if err != nil { + log.Fatalf("init.setupSetting err: %v", err) + return err + } + err = setupLogger() + if err != nil { + log.Fatalf("init.setupLogger err: %v", err) + return err + } + return nil +} + +func main() { + var err error + // 初始化, 加载配置 + err = setup() + if err != nil { + return + } + + lis, err := net.Listen("tcp", fmt.Sprintf(":%v", global.ServerSetting.Port)) + if err != nil { + log.Fatalf("listen error:%v", err) + } + + server := grpc.NewServer( + grpc.StreamInterceptor(grpc_middleware.ChainStreamServer( + middleware.StreamGSError500(), + )), + grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer( + middleware.UnaryGSError500(), + )), + ) + proto.RegisterTencentNluServer(server, &service.TencentNlu{}) + + _ = consul.RegisterService(global.ServerSetting) //将服务注册到注册中心 + grpc_health_v1.RegisterHealthServer(server, &consul.HealthImpl{}) //执行健康检查 + + reflection.Register(server) //使用grpcurl、grpcui工具需添加该行 + + global.Logger.Info("service is running......") + + if err = server.Serve(lis); err != nil { + log.Fatalf("start service error:%v", err) + } +} + +func setupFlag() error { + flag.BoolVar(&isHelp, "help", false, "帮助") + flag.StringVar(&serverName, "name", "", "注册到注册中心的服务名") + flag.StringVar(&serverTag, "tag", "", "注册到注册中心的标签") + flag.StringVar(&ip, "ip", "", "IP") + flag.IntVar(&port, "port", 0, "端口") + flag.StringVar(&consulUrl, "consul", "http://172.28.124.105:8500", "consul服务地址") + flag.StringVar(&config, "config", "env/v2,speech_nlu_parse/conf", "指定要使用的配置文件路径") + flag.BoolVar(&isVersion, "version", false, "编译信息") + flag.StringVar(&consulToken, "token", "092288b5-824f-854c-39aa-a958afd9a633", "consul token") + flag.StringVar(&runMode, "mode", "", "启动模式(debug|release|test)") + + flag.Parse() + + return nil +} + +func setupSetting() error { + // 设置 consul 地址 token及路径 + s, err := setting.NewSetting(consulUrl, consulToken, strings.Split(config, ",")...) + if err != nil { + return err + } + err = s.ReadSection("Server", &global.ServerSetting) + if err != nil { + return err + } + err = s.ReadSection("Logger", &global.LoggerSetting) + if err != nil { + return err + } + err = s.ReadSection("Device", &global.DeviceSetting) + if err != nil { + return err + } + err = s.ReadSection("gree", &global.InternalRemoteSetting) + if err != nil { + return err + } + err = s.ReadSection("DB", &global.DBSetting) + if err != nil { + return err + } + err = s.ReadSection("MusicDomain", &global.MusicDomainSetting) + if err != nil { + return err + } + err = s.ReadSection("Auth", &global.AuthSetting) + if err != nil { + return err + } + err = s.ReadSection("DingDang", &global.TencentSetting) + if err != nil { + return err + } + err = s.ReadSection("Others", &global.OthersSetting) + if err != nil { + return err + } + err = s.ReadSection("Services", &global.ServiceSetting) + if err != nil { + return err + } + // 改由配置文件读取 + err = s.ReadSection("DevLimited", &global.DevLimitedArr) + if err != nil { + return err + } + err = s.ReadSection("tencentV2", &global.TencentGwSetting) + if err != nil { + return err + } + + consulUrlParse, err := url.Parse(consulUrl) + if err != nil { + return err + } + global.ServerSetting.ConsulAddr = consulUrlParse.Host + + // 初始化依赖服务的信息 + global.InitServiceMap(consulUrl, consulToken) + // global.CheckServiceMap() + // global.PrintServiceMap() + + // 初始化设备差异化配置, 需要先加载设置设置 + global.InitLimitedSetting() + + // 初始化数据库连接, 依赖于设置 + err = dao.InitDB(global.DBSetting.Dsn) + if err != nil { + return err + } + // 从数据库中加载, 依赖于数据库连接 + err = global.InitDingDangBot() + if err != nil { + return err + } + + global.ServerSetting.Interval *= time.Second + global.ServerSetting.Deregister *= time.Minute + + if serverName != "" { + global.ServerSetting.Name = serverName + } + if serverTag != "" { + global.ServerSetting.Tag = strings.Split(serverTag, ",") + } + if ip != "" { + global.ServerSetting.IP = ip + } + if port != 0 { + global.ServerSetting.Port = port + } + if consulToken != "" { + global.ServerSetting.ConsulToken = consulToken + } + if consulToken != "" { + global.ServerSetting.ConsulToken = consulToken + } + if runMode != "" { + global.ServerSetting.RunMode = runMode + } + + global.ConsulObj, err = consul.NewConsulObj(consulUrl, consulToken) + if err != nil { + return err + } + + return nil +} + +func setupLogger() error { + fileName := global.LoggerSetting.LogSavePath + "/" + + global.LoggerSetting.LogFileName + "_" + time.Now().Format("20060102150405") + global.LoggerSetting.LogFileExt + global.Logger = logger.NewLogger(&lumberjack.Logger{ + Filename: fileName, + MaxSize: global.LoggerSetting.MaxSize, + MaxAge: global.LoggerSetting.MaxAge, + MaxBackups: global.LoggerSetting.MaxBackups, + Compress: global.LoggerSetting.Compress, + }, global.ServerSetting.RunMode, global.ServerSetting.Name) + + return nil +} diff --git a/middleware/middlewares.go b/middleware/middlewares.go new file mode 100644 index 0000000..874553b --- /dev/null +++ b/middleware/middlewares.go @@ -0,0 +1,40 @@ +package middleware + +import ( + "context" + "runtime/debug" + "speech-nlu-parse/global" + "speech-nlu-parse/pkg/logger" + + "google.golang.org/grpc" +) + +// StreamGSError500 捕捉流式代码致命错误 +func StreamGSError500() grpc.StreamServerInterceptor { + return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error) { + + defer func() { + if err := recover(); err != nil { + //打印错误堆栈信息 + // global.Logger.WithFields(logger.Fields{}).Panicf("panic: %v", err) + global.Logger.Panicf("panic: %v, stack: %v", err, string(debug.Stack())) + + } + }() + return handler(srv, stream) + } +} + +// UnaryGSError500 捕捉简单代码致命错误 +func UnaryGSError500() grpc.UnaryServerInterceptor { + return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (_ interface{}, err error) { + + defer func() { + if err := recover(); err != nil { + //打印错误堆栈信息 + global.Logger.WithFields(logger.Fields{"request": req}).Panicf("panic: %v, stack: %v", err, string(debug.Stack())) + } + }() + return handler(ctx, req) + } +} diff --git a/model/models.go b/model/models.go new file mode 100644 index 0000000..e6d969e --- /dev/null +++ b/model/models.go @@ -0,0 +1,357 @@ +package model + +type Lbs struct { + Longitude float64 `json:"longitude"` + Latitude float64 `json:"latitude"` +} + +type AddressInfo struct { + Province string `json:"province"` + City string `json:"city"` + County string `json:"county"` +} + +type SemanticReqNativeData struct { + // TODO: Native API协议数据, 由云端和客户端一起定义 +} + +type SemanticReqNative struct { + Name string `json:"name"` + SeqID string `json:"seqID"` + Code int `json:"code"` + Message string `json:"message"` + DataVersion string `json:"dataVersion"` + Data *SemanticReqNativeData `json:"data"` +} + +type SemanticReqSDKExtend struct { + CarDOA int `json:"carDOA"` + LastRspType string `json:"lastRspType"` + LastRspResult string `json:"lastRspResult"` + LastSessionStatus int `json:"lastSessionStatus"` + LastCompleteCmdResult string `json:"lastCompleteCmdResult"` +} + +// SemanticReq store data come from client request json. +type SemanticReq struct { + // CheckStr string `json:"checkstr,omitempty"` + // ServiceID string `json:"serviceId,omitempty"` + // SessionID string `json:"sessionId,omitempty"` + // AppId string `json:"appId,omitempty"` + // //Token string `json:"token,omitempty"` + // Mac string `json:"mac,omitempty"` + MacWifi string `json:"macWifi,omitempty"` + MacVoice string `json:"macVoice,omitempty"` + // Barcode string `json:"barcode,omitempty"` + Query string `json:"query,omitempty"` + Ip string `json:"ip,omitempty"` + // TimeStamp string `json:"timestamp,omitempty"` + // Classify string `json:"classify,omitempty"` + TestID string `json:"testId,omitempty"` + // //UserID string `json:"uid,omitempty"` + // //VerServer string `json:"ver,omitempty"` + // HomeId string `json:"homeId,omitempty"` + // City string `json:"city,omitempty"` + // BotKey string `json:"botKey,omitempty"` + // Appver string `json:"appVer,omitempty"` + // RequestData string `json:"requestBody,omitempty"` + OriginQuery string `json:"oriQuery,omitempty"` + // Mode string `json:"mode"` //是否儿童模式 + Mid string `json:"mid,omitempty"` + // Version string `json:"version,omitempty"` + RequestId string + Lbs *Lbs `json:"lbs,omitempty"` // 经纬度 + Vender string `json:"vender,omitempty"` // 细分码 + Appkey string `json:"appKey"` + AccessToken string `json:"accessToken"` + Qua string `json:"qua"` + Auth string `json:"auth"` + Dsn string `json:"dsn"` + Guid string `json:"guid"` + Exist bool `json:"exist"` + TRequestId string `json:"tRequestId"` + RequestType string `json:"requestType"` + CommType string `json:"commType"` + CharacterID string `json:"characterID"` + Event string `json:"event"` + Nativate *SemanticReqNative `json:"nativate"` + SDKExtend *SemanticReqSDKExtend `json:"sdkExtend"` + AddressInfo *AddressInfo `json:"addressInfo"` + Language string `json:"language"` +} + +// Tencent report data +type TencentReport struct { + UserId string + Domain string + Intent string + ResourceId string + DataSource string +} + +type RicAnswer struct { + Header struct { + Guid string `json:"guid,omitempty"` + Device struct { + SerialNum string `json:"serial_num,omitempty"` + } `json:"device,omitempty"` + User struct { + Auth string `json:"authorization,omitempty"` + } `json:"user"` + Qua string `json:"qua"` + Ip string `json:"ip,omitempty"` + Lbs *Lbs `json:"lbs,omitempty"` + } `json:"header,omitempty"` + Payload struct { + Query string `json:"query"` + } `json:"payload"` +} + +type AlarmRemindInfo struct { + Mac string + E_date string + E_time string + Note string + E_type string + Repeat_type int + Start_time int + Status int + Last_update_time int + Countdown_duration int + Createtime string + Oid string + URL string + Content string + Speech_Type string +} + +// domain 方法的参数 +type DomainParams struct { + JsonData []byte + Mac string + Query string + Domain string + Mid string + TokenSearchResponse *TokenSearchResponse +} + +// domain 方法返回的结果 +type DomainRes struct { + JsonByte []byte + ReportDatas []TencentReport +} + +type DingDangBot struct { + Key string + Secret string + UrlType int // url类型, 用于新旧设备的区分 +} + +type MidAppKey struct { + Mid string + AppKey string + AccessToken string + Vender string // 细分码 + UrlType int // url类型, 用于新旧设备的区分 +} + +type GreeNluProtocol struct { + Status struct { + Code int `json:"code"` + ErrorType string `json:"errorType"` + } `json:"status"` + Query string `json:"query"` + Semantic *map[string]interface{} `json:"semantic"` + Result struct { + Hint string `json:"hint"` + ResultData *map[string]interface{} `json:"resultData"` + } `json:"result"` +} + +type ParamsStr struct { + Origin string `json:"orgin"` + Norm string `json:"norm"` + Code int `json:"code"` +} + +type OutputContextStr struct { + Context string `json:"context"` + Service string `json:"service"` + Class string `json:"class"` + Scene string `json:"scene"` +} + +type TokenSearchRequest struct { + Mac string `json:"mac"` + RequestId string `json:"requestId"` +} + +type TokenSearchResponse struct { + Status struct { + Code int32 `json:"code"` + Msg string `json:"msg"` + } `json:"status"` + Data struct { + Dsn string `json:"dsn"` + Authorization string `json:"authorization"` + AccessToken string `json:"accessToken"` + AppKey string `json:"appKey"` + Status int32 `json:"status"` + UriType int32 `json:"uriType"` + HomeId string `json:"homeId"` + } `json:"data"` +} + +// 服务 +type Service struct { + Address string + Port int +} + +type Location struct { + Longitude float32 `json:"Longitude"` + Latitude float32 `json:"Latitude"` + City string `json:"City,omitempty"` +} + +type TencentNlp struct { + Header struct { + QUA string `json:"QUA"` + DSN string `json:"DSN"` + GUID string `json:"GUID,omitempty"` + Location *Location `json:"Location,omitempty"` + } `json:"Header"` + Payload struct { + Semantic struct { + Query string `json:"Query"` + } `json:"Semantic"` + RequestType string `json:"RequestType,omitempty"` + CommType string `json:"CommType,omitempty"` + } `json:"Payload"` +} + +type DomainParamsV2 struct { + TencentNlpResp *TencentNlpResp + Mac string + Query string + Domain string + Mid string + MidType string + TokenSearchResponse *TokenSearchResponse + RequestId string +} + +type PayloadDataNative struct { + Name string `json:"Name"` + SeqID string `json:"SeqID"` + Timeout int `json:"Timeout"` + Param map[string]string `json:"Param"` +} + +type PayloadData struct { + Class string `json:"Class"` + Native PayloadDataNative `json:"Native"` +} + +type ResponseBody struct { + Header struct { + Semantic struct { + Code int `json:"code"` + Domain string `json:"domain"` + Intent string `json:"intent"` + Msg string `json:"msg"` + SessionComplete bool `json:"session_complete"` + SkillId string `json:"skill_id"` + Slots []map[string]interface{} `json:"slots,omitempty"` + Command interface{} `json:"Command,omitempty"` + ResponseType string `json:"ResponseType,omitempty"` + Data *PayloadData `json:"Data,omitempty"` + } `json:"semantic"` + } `json:"header"` + ResponseText string `json:"response_text"` + AsrRecongize string `json:"asr_recongize"` + ListItems []map[string]interface{} `json:"listItems"` +} + +type SDKExtend struct { + CarDOA int `json:"CarDOA"` + LastRspType string `json:"LastRspType"` + LastRspResult string `json:"LastRspResult"` + LastSessionStatus int `json:"LastSessionStatus"` + LastCompleteCmdResult string `json:"LastCompleteCmdResult"` +} + +type Native struct { + Name string `json:"Name"` + SeqID string `json:"SeqID"` + Code int `json:"Code"` + Message string `json:"Message"` + DataVersion string `json:"DataVersion"` + Data struct { + DataArr []map[string]string `json:"List"` + } `json:"Data"` +} + +// ws req 协议 +type TencentNlpWs struct { + Header struct { + RequestID string `json:"RequestID,omitempty"` + DialogID string `json:"DialogID,omitempty"` + GUID string `json:"GUID,omitempty"` + QUA string `json:"QUA,omitempty"` + AppKey string `json:"AppKey,omitempty"` + DSN string `json:"DSN,omitempty"` + Location *Location `json:"Location,omitempty"` + } `json:"Header"` + Payload struct { + RequestType string `json:"RequestType,omitempty"` + CommType string `json:"CommType,omitempty"` + Common struct { + GUID string `json:"GUID,omitempty"` + QUA string `json:"QUA,omitempty"` + AppeKey string `json:"AppeKey,omitempty"` + DSN string `json:"DSN,omitempty"` + CharacterID string `json:"CharacterID,omitempty"` + } `json:"Common"` + SDKExtend *SDKExtend `json:"SDKExtend,omitempty"` + Semantic struct { + Query string `json:"Query,omitempty"` + Event string `json:"Event,omitempty"` + Language string `json:"Language,omitempty"` + } `json:"Semantic,omitempty"` + Native *Native `json:"Native,omitempty"` + } `json:"Payload"` +} + +type DomainParamsWs struct { + TencentNlpResp *TencentNlpWsResp + Query string + RequestId string + Mac string + Domain string + Mid string + MidType string + TokenSearchResponse *TokenSearchResponse + SessionId string + TencentNlpWs interface{} + HomeId string + AppKey string +} + +type TencentNluParseStreamMetaData struct { + MacWifi string `json:"macWifi,omitempty"` + MacVoice string `json:"macVoice,omitempty"` + Ip string `json:"ip,omitempty"` + Mid string `json:"mid,omitempty"` + RequestId string + Vender string `json:"vender,omitempty"` // 细分码 + Appkey string `json:"appKey"` + AccessToken string `json:"accessToken"` + Qua string `json:"qua"` + Auth string `json:"auth"` + Dsn string `json:"dsn"` + Exist bool `json:"exist"` + TRequestId string `json:"tRequestId"` + SessionId string `json:"sessionId"` + HomeId string `json:"homeId"` +} diff --git a/model/speech.go b/model/speech.go new file mode 100644 index 0000000..552040a --- /dev/null +++ b/model/speech.go @@ -0,0 +1,110 @@ +package model + +type SpeechDomainParams struct { + SpeechWsResp *SpeechWsResp + Query string + RequestId string + Mac string + Domain string + Mid string + MidType string + SessionId string + HomeId string + AppKey string +} + +type SpeechWsResp struct { + RequestId string `json:"requestId"` + Dm *struct { + Param *struct { + Period string `json:"period"` + Object string `json:"object"` + Time string `json:"time"` + Date string `json:"date"` + Operation string `json:"operation"` + Event string `json:"event"` + Repeat string `json:"repeat"` + Operate string `json:"operate"` + Number string `json:"number"` + } `json:"param"` + IntentName string `json:"intentName"` + Input string `json:"input"` + IntentId string `json:"intentId"` + RunSequence string `json:"runSequence"` + Widget *struct { + WidgetName string `json:"widgetName"` + SubTitle string `json:"subTitle"` + Name string `json:"name"` + Extra struct { + ContentTranslation string `json:"content_translation"` + Title string `json:"title"` + } `json:"extra"` + Title string `json:"title"` + Buttons []struct { + Name string `json:"name"` + } `json:"buttons"` + DuiWidget string `json:"duiWidget"` + Type string `json:"type"` + Count int `json:"count"` + CurrentPage int `json:"currentPage"` + TotalPages int `json:"totalPages"` + ItemsPerPage int `json:"itemsPerPage"` + Match int `json:"match"` + Content interface{} `json:"content"` + //Content []struct { + // LinkUrl string `json:"linkUrl"` + // ImageUrl string `json:"imageUrl"` + // SubTitle string `json:"subTitle"` + // Album string `json:"album"` + // Parameters struct { + // ResType string `json:"resType"` + // } `json:"parameters"` + // Title string `json:"title"` + // Author string `json:"author"` + // Text string `json:"text"` + // Extra struct { + // Dynasty string `json:"dynasty"` + // ResType string `json:"resType"` + // } `json:"extra"` + //} `json:"content"` + } `json:"widget"` + Nlg string `json:"nlg"` + Task string `json:"task"` + ShouldEndSession bool `json:"shouldEndSession"` + Api string `json:"api"` + Command *struct { + Param *struct { + Volume string `json:"volume"` + Mode string `json:"mode"` + } `json:"param"` + Api string `json:"api"` + } `json:"command"` + } `json:"dm"` + SpeakUrl string `json:"speakUrl"` + SkillId string `json:"skillId"` + Skill string `json:"skill"` + ContextId string `json:"contextId"` + Error *struct { + ErrId interface{} `json:"errId"` + ErrMsg string `json:"errMsg"` + } `json:"error"` + RecordId string `json:"recordId"` + SessionId string `json:"sessionId"` +} + +type Content struct { + LinkUrl string `json:"linkUrl"` + ImageUrl string `json:"imageUrl"` + SubTitle string `json:"subTitle"` + Album string `json:"album"` + Parameters struct { + ResType string `json:"resType"` + } `json:"parameters"` + Title string `json:"title"` + Author string `json:"author"` + Text string `json:"text"` + Extra struct { + Dynasty string `json:"dynasty"` + ResType string `json:"resType"` + } `json:"extra"` +} diff --git a/model/speechNlpResp.go b/model/speechNlpResp.go new file mode 100644 index 0000000..e86e910 --- /dev/null +++ b/model/speechNlpResp.go @@ -0,0 +1,57 @@ +package model + +func (d *SpeechDomainParams) CheckDm() bool { + if d.SpeechWsResp.Dm == nil { + return false + } + return true +} + +func (d *SpeechDomainParams) CheckWidget() bool { + if !d.CheckDm() || d.SpeechWsResp.Dm.Widget == nil { + return false + } + return true +} + +func (d *SpeechDomainParams) CheckDmParam() bool { + if !d.CheckDm() || d.SpeechWsResp.Dm.Param == nil { + return false + } + return true +} + +func (d *SpeechDomainParams) CheckEvent() bool { + if !d.CheckDmParam() || d.SpeechWsResp.Dm.Param.Event == "" { + return false + } + return true +} + +func (d *SpeechDomainParams) CheckDate() bool { + if !d.CheckDmParam() || d.SpeechWsResp.Dm.Param.Date == "" { + return false + } + return true +} + +func (d *SpeechDomainParams) CheckRepeat() bool { + if !d.CheckDmParam() || d.SpeechWsResp.Dm.Param.Repeat == "" { + return false + } + return true +} + +func (d *SpeechDomainParams) CheckDmCommand() bool { + if !d.CheckDm() || d.SpeechWsResp.Dm.Command == nil { + return false + } + return true +} + +func (d *SpeechDomainParams) CheckCommandParam() bool { + if !d.CheckDmCommand() || d.SpeechWsResp.Dm.Command.Param == nil { + return false + } + return true +} diff --git a/model/tencentNlpResp.go b/model/tencentNlpResp.go new file mode 100644 index 0000000..d828e79 --- /dev/null +++ b/model/tencentNlpResp.go @@ -0,0 +1,458 @@ +package model + +type ListItem struct { + Title string `json:"title"` + TextContent string `json:"textContent"` + Audio struct { + Stream struct { + Url string `json:"url"` + } `json:"stream"` + } `json:"audio"` + MediaId string `json:"mediaId"` + SelfData string `json:"selfData"` +} + +type TencentNlpResp struct { + Header *struct { + RequestID string `json:"RequestID"` + SessionID string `json:"SessionID"` + DialogID string `json:"DialogID"` + Code int `json:"Code"` + Message string `json:"Message"` + } `json:"Header"` + Payload *struct { + Semantic *struct { + Query string `json:"Query"` + SessionStatus int `json:"SessionStatus"` + TurnType string `json:"TurnType"` + Results []struct { + Nlu *struct { + Domain string `json:"Domain"` + Intent string `json:"Intent"` + // Slots []struct { + // Name string `json:"Name"` + // Value string `json:"Value"` + // RawValue string `json:"RawValue"` + // Type string `json:"Type"` + // } `json:"Slots"` + Slots []map[string]interface{} `json:"Slots"` + Confidence float32 `json:"Confidence"` + } `json:"Nlu"` + Dm *struct { + SessionID string `json:"SessionID"` + Text string `json:"Text"` + Skill *struct { + Version string `json:"Version"` + ExecutionOrder string `json:"ExecutionOrder"` + AskCount int `json:"AskCount"` + CacheTTS int `json:"CacheTTS"` + Operation struct { + Control struct { + Name string `json:"Name"` + Param interface{} `json:"Param"` + } `json:"Control"` + } `json:"Operation"` + Widget *struct { + Name string `json:"Name"` + Type string `json:"Type"` + Data *struct { + ControlInfo *struct { + Version string `json:"version"` + Type string `json:"type"` + TextSpeak string `json:"textSpeak"` + } `json:"controlInfo"` + GlobalInfo struct { + BackgroundImage interface{} `json:"backgroundImage"` + SeeMore string `json:"seeMore"` + } `json:"globalInfo"` + ListItems []ListItem `json:"listItems"` + } `json:"Data"` + Recommend interface{} `json:"Recommend"` + } `json:"Widget"` + Command map[string]interface{} `json:"Command"` + // Command struct { + // Name string `json:"Name"` + // Param interface{} `json:"Param"` + // TextList interface{} `json:"TextList"` + // Inner interface{} `json:"Inner"` + // } `json:"Command"` + } `json:"Skill"` + IsLocalEntity int `json:"IsLocalEntity"` + SessionComplete int `json:"SessionComplete"` + } `json:"Dm"` + Status struct { + Code int `json:"Code"` + Msg string `json:"Msg"` + } `json:"Status"` + } `json:"Results"` + } `json:"Semantic"` + } `json:"Payload"` +} + +func (this *TencentNlpResp) CheckHeader() bool { + if this.Header == nil { + return false + } + return true +} + +func (this *TencentNlpResp) CheckPayload() bool { + if this.Payload == nil { + return false + } + return true +} + +func (this *TencentNlpResp) CheckSemantic() bool { + if !this.CheckPayload() || this.Payload.Semantic == nil { + return false + } + return true +} + +func (this *TencentNlpResp) CheckResults() bool { + if !this.CheckSemantic() || len(this.Payload.Semantic.Results) == 0 { + return false + } + return true +} + +func (this *TencentNlpResp) CheckNlu() bool { + if !this.CheckResults() || this.Payload.Semantic.Results[0].Nlu == nil { + return false + } + return true +} + +func (this *TencentNlpResp) CheckDm() bool { + if !this.CheckResults() || this.Payload.Semantic.Results[0].Dm == nil { + return false + } + return true +} + +func (this *TencentNlpResp) CheckSkill() bool { + if !this.CheckDm() || this.Payload.Semantic.Results[0].Dm.Skill == nil { + return false + } + return true +} + +func (this *TencentNlpResp) CheckWidget() bool { + if !this.CheckDm() || this.Payload.Semantic.Results[0].Dm.Skill.Widget == nil { + return false + } + return true +} + +func (this *TencentNlpResp) CheckWidgetData() bool { + if !this.CheckWidget() || this.Payload.Semantic.Results[0].Dm.Skill.Widget.Data == nil { + return false + } + return true +} + +func (this *TencentNlpResp) CheckControlInfo() bool { + if !this.CheckWidgetData() || this.Payload.Semantic.Results[0].Dm.Skill.Widget.Data.ControlInfo == nil { + return false + } + return true +} + +func (this *TencentNlpResp) GetCode() int { + return this.Header.Code +} + +func (this *TencentNlpResp) GetMessage() string { + return this.Header.Message +} + +func (this *TencentNlpResp) GetDomain() string { + return this.Payload.Semantic.Results[0].Nlu.Domain +} + +func (this *TencentNlpResp) GetIntent() string { + return this.Payload.Semantic.Results[0].Nlu.Intent +} + +func (this *TencentNlpResp) GetSessionComplete() int { + return this.Payload.Semantic.Results[0].Dm.SessionComplete +} + +func (this *TencentNlpResp) GetSessionID() string { + return this.Header.SessionID +} + +func (this *TencentNlpResp) GetListItems() []ListItem { + return this.Payload.Semantic.Results[0].Dm.Skill.Widget.Data.ListItems +} + +func (this *TencentNlpResp) GetSlots() []map[string]interface{} { + return this.Payload.Semantic.Results[0].Nlu.Slots +} + +func (this *TencentNlpResp) GetText() string { + return this.Payload.Semantic.Results[0].Dm.Text +} + +func (this *TencentNlpResp) GetType() string { + return this.Payload.Semantic.Results[0].Dm.Skill.Widget.Data.ControlInfo.Type +} + +func (this *TencentNlpResp) GetCommand() map[string]interface{} { + return this.Payload.Semantic.Results[0].Dm.Skill.Command +} + +type Command struct { + Name string `json:"Name"` + Param map[string]string `json:"Param"` + TextList []struct { + Status string `json:"Status"` + Text string `json:"Text"` + PlaceholderList []string `json:"PlaceholderList"` + } `json:"TextList"` + Inner interface{} `json:"Inner"` +} + +type TencentNlpWsRespNative struct { + Name string `json:"Name"` + SeqID string `json:"SeqID"` + Timeout int `json:"Timeout"` + Param map[string]string `json:"Param"` +} + +// wss 返回结果 +type TencentNlpWsResp struct { + Header *struct { + RequestID string `json:"RequestID"` + DialogID string `json:"DialogID"` + Code int `json:"Code"` + Message string `json:"Message"` + } `json:"Header"` + Payload *struct { + ResponseType string `json:"ResponseType"` + Data *struct { + Class string `json:"Class"` + AssistantStatus string `json:"AssistantStatus"` + // VirtualMan string `json:"VirtualMan"` // TODO: object类型, 说明文档错误 + Semantic *struct { + Query string `json:"Query"` + RewrittenQuery string `json:"RewrittenQuery"` + SessionStatus int `json:"SessionStatus"` + TurnType string `json:"TurnType"` + IsNeedShield int `json:"IsNeedShield"` + Inner struct { + SegmentID int `json:"SegmentID"` + IsNeedShield int `json:"IsNeedShield"` + // CompoundQuery.IsCompoundQuery // TODO: 说明文档中有, 实际返回缺失该字段 + // CompoundQuery.Confidence // TODO: 说明文档中有, 实际返回缺失该字段 + } `json:"Inner"` + Results []struct { + Nlu *struct { + Domain string `json:"Domain"` + Intent string `json:"Intent"` + IsNeedShield int `json:"IsNeedShield"` + Inner struct { + SessionComplete int `json:"SessionComplete"` + Confidence float32 `json:"Confidence"` + IsLocalEntity int `json:"IsLocalEntity"` + IsNeedShield int `json:"IsNeedShield"` + } `json:"Inner"` + Slots []map[string]interface{} `json:"Slots"` + // Confidence float32 `json:"Confidence"` + } `json:"Nlu"` + Dm *struct { + SessionID string `json:"SessionID"` + Text string `json:"Text"` + Skill *struct { + Version string `json:"Version"` + ExecutionOrder string `json:"ExecutionOrder"` + AskCount int `json:"AskCount"` + CacheTTS int `json:"CacheTTS"` + Operation struct { + Control struct { + Name string `json:"Name"` + Param interface{} `json:"Param"` + } `json:"Control"` + } `json:"Operation"` + Widget *struct { + Name string `json:"Name"` + Type string `json:"Type"` + Data *struct { + ControlInfo *struct { + Version string `json:"version"` + Type string `json:"type"` + TextSpeak string `json:"textSpeak"` + } `json:"controlInfo"` + GlobalInfo struct { + BackgroundImage interface{} `json:"backgroundImage"` + SeeMore string `json:"seeMore"` + } `json:"globalInfo"` + ListItems []ListItem `json:"listItems"` + } `json:"Data"` + Recommend interface{} `json:"Recommend"` + } `json:"Widget"` + // Command map[string]interface{} `json:"Command"` + Command Command `json:"Command"` + } `json:"Skill"` + IsLocalEntity int `json:"IsLocalEntity"` + SessionComplete int `json:"SessionComplete"` // TODO: 无该字段 + } `json:"Dm"` + Status struct { + Code int `json:"Code"` + Msg string `json:"Msg"` + } `json:"Status"` + } `json:"Results"` + } `json:"Semantic"` + // SemanticID // TODO: 说明文档缺少该字段的说明 + Native *TencentNlpWsRespNative `json:"Native"` + } `json:"Data"` + CommType string `json:"CommType"` + SDKExtend struct { + } `json:"SDKExtend"` + } `json:"Payload"` +} + +func (this *TencentNlpWsResp) CheckHeader() bool { + if this.Header == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckPayload() bool { + if this.Payload == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckData() bool { + if !this.CheckPayload() || this.Payload.Data == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckNative() bool { + if !this.CheckData() || this.Payload.Data.Native == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckSemantic() bool { + if !this.CheckData() || this.Payload.Data.Semantic == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckResults() bool { + if !this.CheckSemantic() || len(this.Payload.Data.Semantic.Results) == 0 { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckNlu() bool { + if !this.CheckResults() || this.Payload.Data.Semantic.Results[0].Nlu == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckDm() bool { + if !this.CheckResults() || this.Payload.Data.Semantic.Results[0].Dm == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckSkill() bool { + if !this.CheckDm() || this.Payload.Data.Semantic.Results[0].Dm.Skill == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckWidget() bool { + if !this.CheckDm() || this.Payload.Data.Semantic.Results[0].Dm.Skill.Widget == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckWidgetData() bool { + if !this.CheckWidget() || this.Payload.Data.Semantic.Results[0].Dm.Skill.Widget.Data == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) CheckControlInfo() bool { + if !this.CheckWidgetData() || this.Payload.Data.Semantic.Results[0].Dm.Skill.Widget.Data.ControlInfo == nil { + return false + } + return true +} + +func (this *TencentNlpWsResp) GetCode() int { + return this.Header.Code +} + +func (this *TencentNlpWsResp) GetMessage() string { + return this.Header.Message +} + +func (this *TencentNlpWsResp) GetDomain() string { + return this.Payload.Data.Semantic.Results[0].Nlu.Domain +} + +func (this *TencentNlpWsResp) GetIntent() string { + return this.Payload.Data.Semantic.Results[0].Nlu.Intent +} + +func (this *TencentNlpWsResp) GetSessionComplete() int { + return this.Payload.Data.Semantic.Results[0].Dm.SessionComplete +} + +func (this *TencentNlpWsResp) GetListItems() []ListItem { + return this.Payload.Data.Semantic.Results[0].Dm.Skill.Widget.Data.ListItems +} + +func (this *TencentNlpWsResp) GetSlots() []map[string]interface{} { + return this.Payload.Data.Semantic.Results[0].Nlu.Slots +} + +func (this *TencentNlpWsResp) GetText() string { + return this.Payload.Data.Semantic.Results[0].Dm.Text +} + +func (this *TencentNlpWsResp) GetType() string { + return this.Payload.Data.Semantic.Results[0].Dm.Skill.Widget.Data.ControlInfo.Type +} + +func (this *TencentNlpWsResp) GetCommand() Command { + return this.Payload.Data.Semantic.Results[0].Dm.Skill.Command +} + +func (this *TencentNlpWsResp) GetQuery() string { + return this.Payload.Data.Semantic.Query +} + +func (this *TencentNlpWsResp) GetResponseType() string { + return this.Payload.ResponseType +} + +func (this *TencentNlpWsResp) GetClass() string { + return this.Payload.Data.Class +} + +func (this *TencentNlpWsResp) GetNativate() *TencentNlpWsRespNative { + return this.Payload.Data.Native +} + +func (this *TencentNlpWsResp) GetSessionStatus() int { + return this.Payload.Data.Semantic.SessionStatus +} diff --git a/nohup.out b/nohup.out new file mode 100644 index 0000000..c480546 --- /dev/null +++ b/nohup.out @@ -0,0 +1,268 @@ +service is running...... +{"level":"info","time":"2022-08-24 13:56:10","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"历史的今天\",\"ip\":\"121.35.103.189\",\"originQuery\":\"历史的今天\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:56:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:56:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:56:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"历史的今天\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:56:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"history\",\"intent\":\"search_today\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990846160136704000\",\"slots\":[{\"name\":\"datetime\",\"value\":\"2022-08-24\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"titleSpeak\":\"false\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"textContent\":\"\\n1998年 英一教授将芯片植入自己手臂内获得成功\\n1997年 世界烟草或健康大会在北京举行\\n1992年 中国与韩国正式建交\\n1992年 德国发生排外风潮\\n1973年 中共第十次全国代表大会召开\\n1966年 老舍在北京投湖自尽\\n1966年 著名哲学家、中共一大代表李达逝世\\n1958年 伦敦发生种族骚乱\\n1954年 巴西总统瓦加斯自杀\\n1947年 美国总统特使魏德迈结束在中国的考察\\n1946年 尼赫鲁任印度临时政府首脑\\n1937年 《救亡日报》创刊\\n1936年 苏联领导人加米涅夫和季诺维也夫被判死刑\\n1925年 刘海粟使用裸体模特儿引起争议\\n1922年 长辛店铁路工人罢工\\n1911年 邮传部接管邮政、驿站\\n1862年 北京同文馆成立\\n1645年 “嘉定三屠”开始\\n1101年 苏轼逝世\\n79年 庞贝城被埋没\",\"title\":\"\"}]}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661320570332144_e6LMkk5OcPIwa"}} +{"level":"debug","time":"2022-08-24 13:56:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"history\",\"intent\":\"search_today\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990846160136704000\",\"slots\":[{\"name\":\"datetime\",\"value\":\"2022-08-24\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"titleSpeak\":\"false\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"textContent\":\"\\n1998年 英一教授将芯片植入自己手臂内获得成功\\n1997年 世界烟草或健康大会在北京举行\\n1992年 中国与韩国正式建交\\n1992年 德国发生排外风潮\\n1973年 中共第十次全国代表大会召开\\n1966年 老舍在北京投湖自尽\\n1966年 著名哲学家、中共一大代表李达逝世\\n1958年 伦敦发生种族骚乱\\n1954年 巴西总统瓦加斯自杀\\n1947年 美国总统特使魏德迈结束在中国的考察\\n1946年 尼赫鲁任印度临时政府首脑\\n1937年 《救亡日报》创刊\\n1936年 苏联领导人加米涅夫和季诺维也夫被判死刑\\n1925年 刘海粟使用裸体模特儿引起争议\\n1922年 长辛店铁路工人罢工\\n1911年 邮传部接管邮政、驿站\\n1862年 北京同文馆成立\\n1645年 “嘉定三屠”开始\\n1101年 苏轼逝世\\n79年 庞贝城被埋没\",\"title\":\"\"}]}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 13:56:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\n\t\t\t\t\t\"header\": {\n\t\t\t\t\t\t\"semantic\": {\n\t\t\t\t\t\t\t\"code\": 0,\n\t\t\t\t\t\t\t\"domain\": \"chat\",\n\t\t\t\t\t\t\t\"intent\": \"chat\",\n\t\t\t\t\t\t\t\"msg\": \"\",\n\t\t\t\t\t\t\t\"session_complete\": true,\n\t\t\t\t\t\t\t\"skill_id\": \"history.search_today\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"response_text\": \"1998年 英一教授将芯片植入自己手臂内获得成功,1997年 世界烟草或健康大会在北京举行,1992年 中国与韩国正式建交,1992年 德国发生排外风潮,1973年 中共第十次全国代表大会召开,\"\n\t\t\t\t}"}}} +{"level":"info","time":"2022-08-24 13:56:10","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\n\\t\\t\\t\\t\\t\\t\\\"semantic\\\": {\\n\\t\\t\\t\\t\\t\\t\\t\\\"code\\\": 0,\\n\\t\\t\\t\\t\\t\\t\\t\\\"domain\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"intent\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"msg\\\": \\\"\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"session_complete\\\": true,\\n\\t\\t\\t\\t\\t\\t\\t\\\"skill_id\\\": \\\"history.search_today\\\"\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t},\\\"response_text\\\":\\\"1998年 英一教授将芯片植入自己手臂内获得成功,1997年 世界烟草或健康大会在北京举行,1992年 中国与韩国正式建交,1992年 德国发生排外风潮,1973年 中共第十次全国代表大会召开,\\\",\\\"asr_recongize\\\":\\\"历史的今天\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:58:06","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"国庆节是哪天\",\"ip\":\"121.35.103.189\",\"originQuery\":\"国庆节是哪天\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:58:06","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:58:06","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:58:06","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"国庆节是哪天\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 13:58:06","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"holiday\",\"intent\":\"search_date\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990847224047079424\",\"slots\":[{\"name\":\"datetime\",\"value\":\"2022-10-01\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"titleSpeak\":\"false\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"国庆节\",\"sources\":[{\"heightPixels\":1200,\"size\":\"SMALL\",\"url\":\"https://softimtt.myapp.com/browser/smart_service/holiday/img/nationalDay.jpg\",\"widthPixels\":1920}]},\"seeMore\":\"\"},\"listItems\":[{\"selfData\":{\"holiday\":\"国庆节\"},\"textContent\":\"今年国庆节是10月1日,星期六。\",\"title\":\"\"}]}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661320686370035_E50uuubXvgINz"}} +{"level":"debug","time":"2022-08-24 13:58:06","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"holiday\",\"intent\":\"search_date\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990847224047079424\",\"slots\":[{\"name\":\"datetime\",\"value\":\"2022-10-01\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"titleSpeak\":\"false\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"国庆节\",\"sources\":[{\"heightPixels\":1200,\"size\":\"SMALL\",\"url\":\"https://softimtt.myapp.com/browser/smart_service/holiday/img/nationalDay.jpg\",\"widthPixels\":1920}]},\"seeMore\":\"\"},\"listItems\":[{\"selfData\":{\"holiday\":\"国庆节\"},\"textContent\":\"今年国庆节是10月1日,星期六。\",\"title\":\"\"}]}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 13:58:06","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"holiday\",\"intent\":\"search_date\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990847224047079424\",\"slots\":[{\"name\":\"datetime\",\"value\":\"2022-10-01\"}]}},\"response_text\":\"今年国庆节是10月1日,星期六。\"}"}}} +{"level":"info","time":"2022-08-24 13:58:06","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"holiday\\\",\\\"intent\\\":\\\"search_date\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990847224047079424\\\",\\\"slots\\\":[{\\\"name\\\":\\\"datetime\\\",\\\"value\\\":\\\"2022-10-01\\\"}]}},\\\"response_text\\\":\\\"今年国庆节是10月1日,星期六。\\\",\\\"asr_recongize\\\":\\\"国庆节是哪天\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:00:50","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"讲个笑话\",\"ip\":\"121.35.103.189\",\"originQuery\":\"讲个笑话\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:00:50","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:00:50","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:00:50","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"讲个笑话\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:00:50","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"joke\",\"intent\":\"tell\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835372646862848\"}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"true\",\"backgroundImageValid\":\"true\",\"orientation\":\"portrait\",\"subTitleSpeak\":\"true\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\",\"version\":\"1.0.0\"},\"listItems\":[{\"audio\":{\"stream\":{\"url\":\"http://softfile.3g.qq.com/myapp/trom_l/dobby/joke/201804/20180423/D_J_2018042316.mp3\"}},\"mediaId\":\"7f33d4cf54e9306f9ee1c94fe53394aa\",\"textContent\":\"在一次足球赛开始前,教练给队员打气。\\n\\n教练说:“面对对手,千万不要手软。”\\n\\n一位初次上场的队员回答:“我就是有点脚软。”\",\"title\":\"\"}]}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661320850768079_SDRVTb8S0aZfm"}} +{"level":"debug","time":"2022-08-24 14:00:50","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"joke\",\"intent\":\"tell\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835372646862848\"}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"true\",\"backgroundImageValid\":\"true\",\"orientation\":\"portrait\",\"subTitleSpeak\":\"true\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\",\"version\":\"1.0.0\"},\"listItems\":[{\"audio\":{\"stream\":{\"url\":\"http://softfile.3g.qq.com/myapp/trom_l/dobby/joke/201804/20180423/D_J_2018042316.mp3\"}},\"mediaId\":\"7f33d4cf54e9306f9ee1c94fe53394aa\",\"textContent\":\"在一次足球赛开始前,教练给队员打气。\\n\\n教练说:“面对对手,千万不要手软。”\\n\\n一位初次上场的队员回答:“我就是有点脚软。”\",\"title\":\"\"}]}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:00:50","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"joke\",\"intent\":\"tell\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835372646862848\"}},\"response_text\":\"\",\"listItems\":[{\"url\":\"http://softfile.3g.qq.com/myapp/trom_l/dobby/joke/201804/20180423/D_J_2018042316.mp3\",\"content\":\"在一次足球赛开始前,教练给队员打气。\\n\\n教练说:“面对对手,千万不要手软。”\\n\\n一位初次上场的队员回答:“我就是有点脚软。”\"}]}"}}} +{"level":"info","time":"2022-08-24 14:00:50","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"joke\\\",\\\"intent\\\":\\\"tell\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835372646862848\\\"}},\\\"response_text\\\":\\\"\\\",\\\"asr_recongize\\\":\\\"讲个笑话\\\",\\\"listItems\\\":[{\\\"url\\\":\\\"http://softfile.3g.qq.com/myapp/trom_l/dobby/joke/201804/20180423/D_J_2018042316.mp3\\\",\\\"content\\\":\\\"在一次足球赛开始前,教练给队员打气。\\\\n\\\\n教练说:“面对对手,千万不要手软。”\\\\n\\\\n一位初次上场的队员回答:“我就是有点脚软。”\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:05:07","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"查下今天大乐透的开奖信息\",\"ip\":\"121.35.103.189\",\"originQuery\":\"查下今天大乐透的开奖信息\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"查下今天大乐透的开奖信息\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没有听懂,你可不可以换个方式问我呀?\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我没有听懂,你可不可以换个方式问我呀?\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661321107366594_KDRQA1UZhfdTc"}} +{"level":"debug","time":"2022-08-24 14:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没有听懂,你可不可以换个方式问我呀?\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我没有听懂,你可不可以换个方式问我呀?\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没有听懂,你可不可以换个方式问我呀?\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"我没有听懂,你可不可以换个方式问我呀?\"}"}}} +{"level":"info","time":"2022-08-24 14:05:07","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"我没有听懂,你可不可以换个方式问我呀?\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"我没有听懂,你可不可以换个方式问我呀?\\\",\\\"asr_recongize\\\":\\\"查下今天大乐透的开奖信息\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:08:10","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放音乐\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放音乐\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:08:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:08:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:08:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放音乐\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:08:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"selfData\":{\"displayFormat\":1,\"playMode\":2}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":236000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000032pGcS0vXu7x.m4a?fromtag=384&guid=2000000128&uin=0&vkey=F808C722D645ED705CFF94294C8112922BE5A223E148AF3BC443BDC1451D18DF8BA419B1B445D8FB4623C436B50EEEF3C2E2923625663049\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=0032pGcS0vXu7x\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001FJcgI2NEX4n_1.jpg\"}]},\"mediaId\":\"238600954\",\"selfData\":{\"album\":\"第七百夜的雪\",\"albumId\":\"8082340\",\"albumPubTime\":\"2019-09-18\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"川雪\",\"singerId\":\"3964177\",\"singerPics\":[],\"song\":\"第七百夜的雪\",\"songId\":\"238600954\",\"songMid\":\"0032pGcS0vXu7x\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":960887,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"川雪\",\"textContent\":\"第七百夜的雪\",\"title\":\"第七百夜的雪\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":196000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000016Vh8Y1RS2ow.m4a?fromtag=384&guid=2000000128&uin=0&vkey=4D6DA98F9EA521ECD4180AD760D91AB97D0EFEAE59B526BA414B9D7982AB8F42390FE7C4262BBF8A71D62640930592439BF0876AC9B714F8\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000wiqd900zfDG\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000004dkkK40DCdEH_1.jpg\"}]},\"mediaId\":\"101794350\",\"selfData\":{\"album\":\"抽象的画\",\"albumId\":\"928983\",\"albumPubTime\":\"2014-12-05\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"戴阳\",\"singerId\":\"944603\",\"singerPics\":[],\"song\":\"越过的寒冬\",\"songId\":\"101794350\",\"songMid\":\"000wiqd900zfDG\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"戴阳\",\"textContent\":\"抽象的画\",\"title\":\"越过的寒冬\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":406000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C40000201a2T2zk5gt.m4a?fromtag=384&guid=2000000128&uin=0&vkey=556733F893268D3EA58CF4B951A0B568A0482CDB0E094DEF38FFEB91276C9CE5FC6CF639AC11C13F9715420426B46CD78D60DA6C4EC326AC\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004BOADJ2ARou9\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000003GlLhR3i4s6p_1.jpg\"}]},\"mediaId\":\"213463349\",\"selfData\":{\"album\":\"福噪系列演出之“秋高气不爽“live合辑\",\"albumId\":\"3975075\",\"albumPubTime\":\"2018-03-30\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"麻乐队\",\"singerId\":\"1182051\",\"singerPics\":[],\"song\":\"疯人愿\",\"songId\":\"213463349\",\"songMid\":\"004BOADJ2ARou9\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"麻乐队\",\"textContent\":\"福噪系列演出之“秋高气不爽“live合辑\",\"title\":\"疯人愿\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"最喜欢和你一起听音乐的时光啦。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661321290486745_zcKdYbmVZUVKq"}} +{"level":"debug","time":"2022-08-24 14:08:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"selfData\":{\"displayFormat\":1,\"playMode\":2}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":236000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000032pGcS0vXu7x.m4a?fromtag=384&guid=2000000128&uin=0&vkey=F808C722D645ED705CFF94294C8112922BE5A223E148AF3BC443BDC1451D18DF8BA419B1B445D8FB4623C436B50EEEF3C2E2923625663049\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=0032pGcS0vXu7x\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001FJcgI2NEX4n_1.jpg\"}]},\"mediaId\":\"238600954\",\"selfData\":{\"album\":\"第七百夜的雪\",\"albumId\":\"8082340\",\"albumPubTime\":\"2019-09-18\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"川雪\",\"singerId\":\"3964177\",\"singerPics\":[],\"song\":\"第七百夜的雪\",\"songId\":\"238600954\",\"songMid\":\"0032pGcS0vXu7x\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":960887,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"川雪\",\"textContent\":\"第七百夜的雪\",\"title\":\"第七百夜的雪\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":196000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000016Vh8Y1RS2ow.m4a?fromtag=384&guid=2000000128&uin=0&vkey=4D6DA98F9EA521ECD4180AD760D91AB97D0EFEAE59B526BA414B9D7982AB8F42390FE7C4262BBF8A71D62640930592439BF0876AC9B714F8\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000wiqd900zfDG\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000004dkkK40DCdEH_1.jpg\"}]},\"mediaId\":\"101794350\",\"selfData\":{\"album\":\"抽象的画\",\"albumId\":\"928983\",\"albumPubTime\":\"2014-12-05\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"戴阳\",\"singerId\":\"944603\",\"singerPics\":[],\"song\":\"越过的寒冬\",\"songId\":\"101794350\",\"songMid\":\"000wiqd900zfDG\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"戴阳\",\"textContent\":\"抽象的画\",\"title\":\"越过的寒冬\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":406000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C40000201a2T2zk5gt.m4a?fromtag=384&guid=2000000128&uin=0&vkey=556733F893268D3EA58CF4B951A0B568A0482CDB0E094DEF38FFEB91276C9CE5FC6CF639AC11C13F9715420426B46CD78D60DA6C4EC326AC\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004BOADJ2ARou9\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000003GlLhR3i4s6p_1.jpg\"}]},\"mediaId\":\"213463349\",\"selfData\":{\"album\":\"福噪系列演出之“秋高气不爽“live合辑\",\"albumId\":\"3975075\",\"albumPubTime\":\"2018-03-30\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"麻乐队\",\"singerId\":\"1182051\",\"singerPics\":[],\"song\":\"疯人愿\",\"songId\":\"213463349\",\"songMid\":\"004BOADJ2ARou9\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"麻乐队\",\"textContent\":\"福噪系列演出之“秋高气不爽“live合辑\",\"title\":\"疯人愿\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"最喜欢和你一起听音乐的时光啦。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:08:10","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\"}},\"response_text\":\"您的设备尚未授权,请前往格力+手机应用绑定授权。\",\"listItems\":[{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000032pGcS0vXu7x.m4a?fromtag=384&guid=2000000128&uin=0&vkey=F808C722D645ED705CFF94294C8112922BE5A223E148AF3BC443BDC1451D18DF8BA419B1B445D8FB4623C436B50EEEF3C2E2923625663049\",\"singer\":\"川雪\",\"song\":\"第七百夜的雪\",\"mediaId\":\"238600954\",\"songId\":\"238600954\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000016Vh8Y1RS2ow.m4a?fromtag=384&guid=2000000128&uin=0&vkey=4D6DA98F9EA521ECD4180AD760D91AB97D0EFEAE59B526BA414B9D7982AB8F42390FE7C4262BBF8A71D62640930592439BF0876AC9B714F8\",\"singer\":\"戴阳\",\"song\":\"越过的寒冬\",\"mediaId\":\"101794350\",\"songId\":\"101794350\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C40000201a2T2zk5gt.m4a?fromtag=384&guid=2000000128&uin=0&vkey=556733F893268D3EA58CF4B951A0B568A0482CDB0E094DEF38FFEB91276C9CE5FC6CF639AC11C13F9715420426B46CD78D60DA6C4EC326AC\",\"singer\":\"麻乐队\",\"song\":\"疯人愿\",\"mediaId\":\"213463349\",\"songId\":\"213463349\"}]}"}}} +{"level":"info","time":"2022-08-24 14:08:10","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"music\\\",\\\"intent\\\":\\\"play\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835315751129088\\\"}},\\\"response_text\\\":\\\"您的设备尚未授权,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放音乐\\\",\\\"listItems\\\":[{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C4000032pGcS0vXu7x.m4a?fromtag=384\\u0026guid=2000000128\\u0026uin=0\\u0026vkey=F808C722D645ED705CFF94294C8112922BE5A223E148AF3BC443BDC1451D18DF8BA419B1B445D8FB4623C436B50EEEF3C2E2923625663049\\\",\\\"singer\\\":\\\"川雪\\\",\\\"song\\\":\\\"第七百夜的雪\\\",\\\"mediaId\\\":\\\"238600954\\\",\\\"songId\\\":\\\"238600954\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C4000016Vh8Y1RS2ow.m4a?fromtag=384\\u0026guid=2000000128\\u0026uin=0\\u0026vkey=4D6DA98F9EA521ECD4180AD760D91AB97D0EFEAE59B526BA414B9D7982AB8F42390FE7C4262BBF8A71D62640930592439BF0876AC9B714F8\\\",\\\"singer\\\":\\\"戴阳\\\",\\\"song\\\":\\\"越过的寒冬\\\",\\\"mediaId\\\":\\\"101794350\\\",\\\"songId\\\":\\\"101794350\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C40000201a2T2zk5gt.m4a?fromtag=384\\u0026guid=2000000128\\u0026uin=0\\u0026vkey=556733F893268D3EA58CF4B951A0B568A0482CDB0E094DEF38FFEB91276C9CE5FC6CF639AC11C13F9715420426B46CD78D60DA6C4EC326AC\\\",\\\"singer\\\":\\\"麻乐队\\\",\\\"song\\\":\\\"疯人愿\\\",\\\"mediaId\\\":\\\"213463349\\\",\\\"songId\\\":\\\"213463349\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:13:34","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"来点新闻\",\"ip\":\"121.35.103.189\",\"originQuery\":\"来点新闻\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:13:34","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:13:34","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:13:34","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"来点新闻\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:13:35","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"news\",\"intent\":\"search\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835378435002368\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"false\",\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\",\"version\":\"\"},\"globalInfo\":{\"backgroundAudio\":{\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"listUpdateType\":\"COVER\",\"seeMore\":\"\"},\"innerInfo\":{\"defaultPlayAction\":true,\"subType\":\"\"},\"listItems\":[{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/309fc3cd0255969a44c524fdd1dfc4e2/1661320903175.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15193266192_150120/0,http://inews.gtimg.com/newsapp_ls/0/15193266205_150120/0,http://inews.gtimg.com/newsapp_ls/0/15193266199_150120/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A03JS800\",\"selfData\":{\"newsFrom\":\"豫商览天下\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"当今世界,很多国家惧怕中国的飞速发展从而反华来压制中国的发展,为首的便是美国,日本,英国这几个国家,但是从去年的时候开始,立陶宛这个本来与中国没有什么仇的国家莫名其妙的在国际上所表现出的反华情绪十分高涨,在国际上更是多次挑衅我国。 而这个国家最近更在这个台海问题严重的时刻,公然挑拨中国台湾和中国大陆的关系,试图破坏两岸坚持的一个中国的原则。 立陶宛为何如此敌视中国 很显然,立陶宛对中国的敌视,并不是因为中国在国际上的影响或是形象不好所以主动仇视中国的,而是因为美国对待中国的态度是仇视的,所以他们对中国的态度才是仇视的。替美国办事帮美国说话的原因就是因为美国长期以来的都是通过所谓的民主基金等渠道,对一些国家“合法”地进行“赞助”和“资助”,用这个方法来控制住那些被资助的和赞助的国家。而被美国以这种方式资助过的国家,很少有能从中脱离出来的,否则它们将要面对美国对他们在各种国际行为上的职责和生事。尤其是那些自身国力大大不如美国的国家,美国基本都是通过“赞助”“资助”等等“公关”方法,将这些小的国家变成没有想法只听美国话的木偶。因为这些国家政要最容易被接触到,最容易开展“公关”,他们的决策程序简单快捷,见效最快。 立陶宛挑衅中国,中国霸气反击 早在很久之前,立陶宛就曾无视中方严正抗议和反复交涉,允许台湾当局单独设立设立“驻立陶宛台湾代表处”。此举公然在国际上挑拨中国与台湾的关系,严重的损害到了我国在国际上的形象,侵害了我国的利益,强行干预我国的内政。中国对立陶宛的行为十分不满并对损害我国统一的行为表示严重抗议,针对此事,中方将两国的外交关系下降为代办级。 而之前的教训,并没有让立陶宛长记性。前不久,美国国会议长佩洛西窜访台湾之后,相关人等蠢蠢欲动。美国众议院议长佩洛西一意孤行地窜访台湾地区,此举动已经让中美双方关系僵硬,中国也对美国所做的行为做出了回应,并对美国进行了不同方面的制裁,但是瓦伊丘凯维丘特却并不将此事放在心上,反而率团公然窜访台湾地区,践踏一个中国原则,损害中国的主权。 这无疑是对中方公然的挑衅,对于这种行为,中方也在第一时间就对立陶宛予以制裁。而对于瓦伊丘凯维丘特明知故犯地挑衅行为,中方也坚决回击。中国外交部对此事也作出回应称:中方日前决定制裁瓦伊丘凯维丘特,并对立陶宛采取了两项措施第一个是暂停和立陶宛交通与通讯部所有形式的来往,第二个是暂停与立陶宛的道路运输领域交流合作。 立陶宛颠倒黑白抹黑中方形象 然而,针对中方合理合法的反制措施,立陶宛政府却颠倒黑白地抨击、抹黑中方,向中方提出所谓的正式抗议并要求中方撤销相关决定。立陶宛外交部口口声声说,无论是制裁瓦伊丘凯维丘特,还是暂停中立双边交通运输领域的相关合作,中方的决定都是片面的、缺乏正当性的,这不仅违反国际法,还侵犯了立陶宛的主权。 而对于自己反复挑衅中国底线,在国际制造矛盾与冲突,破坏一个中国的的原则,面对中国的反复警告依旧我行我素这些行为却是只字未提,中国对立陶宛实施的制裁,既是对立陶宛对此此事的影响作出的回应,也是向立陶宛表明中华人民共和国的尊严不可挑衅。 中方实施反击合情合理 事实上,中国的这种举措,也是十分正常的。首先,一个中国的原则是我们所一直坚持的原则,不管是中国台湾还是中国大陆,都是中华人民共和国,认同这一基本原则,是中国同立陶宛发展双边关系的政治基础。当初两国建交的时候,白纸黑字都写的很清楚,立陶宛是拿着国家信用来背书的。立陶宛政府曾承诺过,立陶宛不会和台湾地区建立官方关系,基于立陶宛对中方的承诺,中国和立陶宛才进行的建交,那这个承诺必然也是中国和立陶宛建交的基础,立陶宛的行为多次视此承诺于无物,那中国取消与立陶宛的经济文化交流也是理所应当的. 其次,中国和立陶宛之间,往日无怨近日无仇,他们会站在中国的对立面,疯狂攻击中国,是可忍孰不可忍?立陶宛以牺牲中国主权的方式来满足自己的私利,这种行为不管是对任何国家来说都是对其尊严的挑衅绝对不会被允许的行为。 第三,我们之前已经有过明确警告。在去年的时候立陶宛对中国尊严的挑衅行为,中国已经撤出了在立陶宛驻地的大使,并且遣返了立陶宛在中国驻地的大使,在将中立两国外交关系降为代办级的同时,也明确强调过,“立陶宛政府必须承担由此产生的一切后果。对于我国的利益和我国的领土完整性我国在对待此类问题上一定是寸步不让的。立陶宛所作的这些行为,中国已经是事前警告过了,“勿谓言之不预”。 立陶宛要求中方取消制裁 面对中国对立陶宛实施的制裁,立陶宛当局表示,中国不可以停止与立陶宛的经济贸易往来,不可以对立陶宛实施制裁。立陶宛当局还称:“中国的单方面决定是毫无道理的,它违背了立陶宛的主权和国际法。” 就在立陶宛要求中方取消制裁、并对中方进行无端指责的同一天,立陶宛总理英格丽达还正式将自己的顾问保利乌斯任命为所谓的“立陶宛首位驻台湾地区代表”,并宣布他将于下个月抵达台北并开设正式的外交办事处。 很难想象,立陶宛是怎么敢在这种情况下要求中方取消制裁的——与台湾地区建立所谓的“外交关系”,这是严重侵犯我国的主权和领土完整的行为,这是我方已多次在国际上强调、并得到大多数国家同意的主张。 立陶宛的行为到底为何 立陶宛的这一系列不知为何的举措其实是陷入了政治上的“两极陷阱”中。立陶宛自成立以来,就一直信奉所谓的“去东方化”,长期以来想方设法往欧美靠近,并坚决与中俄划清界限。而美国单方面夸大的所谓的“中俄威胁”,更加剧了立陶宛的“反东方情绪”。 在美国不断试图靠台海局势搞“以台制华”的把戏时,立陶宛作为一个典型的亲美反华国家,必然想要借此机会给美国“献殷勤”,并以此为由向美国请求更多的经济或军事援助。而事实上,立陶宛的把戏也确实奏效了:美国同意与立陶宛签署协议,向立陶宛提供6亿美元的国际信贷支持。 有学者已经明确指出,立陶宛的战略,就是一边凭借地理位置的优越性,使得它笃定地相信中方不会对其采取军事报复,一边想方设法找中国的麻烦,逼迫中国对立陶宛进行报复,然后再跑到欧美国家面前“卖惨”,借此换取政治和经济上的利益。而就目前欧盟方面的表态来看,欧美国家显然也挺乐意吃它这一套。 但值得注意的是,立陶宛现在国内也是一团糟,大量立陶宛民众对政府一厢情愿的反华政策十分反感,认为这只会“引火烧身”、“玩火自焚”。历史已经无数次地证明,任何甘当美国“政治棋子”的国家,最后都不会有什么好下场。 总而言之,瓦伊丘凯维丘特窜访台湾地区,公然侵犯中国主权,中国对其的制裁也是合理合法的,造成这样的局面,也是她明知故犯的结果,咎由自取、责无可逃。作为国际社会的一员,立陶宛政府该做的是承认自己的错误,承担相应的后果,清理自己的门户,守护好自身的国家信用,而不是拿各种借口粉饰自己官员的行为,在错误的道路上一去不回,最终搬起石头砸自己的脚,沦为国际笑柄。 \",\"title\":\"知道怕了?中方反制奏效,立陶宛急了:要求取消制裁恢复合作\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/2aff7e209fdd2c68e537f4e811c70ace/1661317930639.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://soft.imtt.qq.com/browser/smart_service/fm/news_background/news_bg.jpg\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A02XB300\",\"selfData\":{\"newsFrom\":\"界面新闻\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"据中国常驻联合国代表使团网站,8月23日,中国常驻联合国代表团发表声明,对伯利兹等国常驻联合国代表当日就台海局势发表所谓“联合声明”散布错误言论予以严正驳斥。 中国常驻联合国代表团声明指出,伯利兹、斯威士兰、危地马拉、圣文森特和格林纳丁斯等极少数国家的常驻联合国代表于8月23日就台湾问题和当前台海局势发表联合声明,不辨是非、无端指责中国维护国家主权和领土完整的正当举措,严重干涉中国内政。中方对此表示坚决反对和强烈谴责。 声明强调,世界上只有一个中国,台湾是中国领土不可分割的一部分,中华人民共和国政府是代表全中国的唯一合法政府。1971年联大第2758号决议对此予以明确确认。坚持一个中国原则是国际社会的普遍共识,也是遵守国际关系基本准则的应有之义。发表联合声明的这些国家同台湾保持所谓“外交关系”,严重侵犯中国主权和领土完整,干涉了中国的内政,错误地站在世界上绝大多数国家的对立面,现在又发表歪曲事实、颠倒黑白的错误言论,无疑是错上加错。 声明指出,这些国家发表的联合声明称“中国目前在台湾周边区域开展的军事演训对地区和平构成威胁”。中国采取的措施,包括在中国台湾岛周边海空域进行正常军事演训行动,是针对美国国会众议院议长佩洛西窜访中国台湾地区、外部势力蓄意挑衅采取的必要回应,是正当、必要、适度的,符合国内法、国际法和国际惯例。近期台海紧张局势的来龙去脉一清二楚,是非曲直一目了然。挑起事端的不是中国,制造危机的不是中国。这些国家对近期外部势力破坏中国主权和领土完整的事实视而不见,反而无理指责中方的正当举措,丧失了最起码的是非观、公正性和独立性。 声明指出,这些国家发表的联合声明声称“希望维持现状”,台湾问题的现状是什么?台湾从来不是一个国家,中国只有一个,两岸同属于一国,这就是台湾问题从古至今的现状。需要指出的是,恰恰是美国等一些外部势力支持怂恿“台独”势力加紧进行分裂活动,不断破坏台海现状。这是导致台海局势出现紧张和严峻挑战的根本原因。这些国家还提到所谓“海峡中线”,要知道台湾是中国领土的一部分,在台湾海峡根本不存在什么“中线”。 声明强调,这些国家声称要维护“以规则为基础的国际秩序”,他们应该知道,世界只有一套规则,就是以联合国宪章宗旨和原则为基础的国际关系基本准则。联合国宪章规定了尊重国家主权和领土完整、不干涉内政等重要原则。中方采取必要行动维护国家主权和领土完整,是在行使国际法所赋予的神圣权利,也是在捍卫国际关系的基本准则。如果任由主权平等、不干涉内政这样的重要原则被抛弃,世界将重回丛林法则,超级大国将更加肆无忌惮地霸凌其他国家,这样受害最深的肯定是广大发展中国家和中小国家。伯利兹等国家历史上长期遭受殖民主义和外来干涉之害,理应对维护联合国宪章宗旨和原则,尊重主权和领土完整的重要性有深刻认识,现在却不辨是非、颠倒黑白,显然是站在错误一边,站在公平正义的对立面。 声明表示,己所不欲,勿施于人。中国外交历来坚持主权平等和相互尊重。我们致力于同所有热爱和平、主持公道的国家一道,共同捍卫联合国宪章的宗旨和原则,共同维护地区稳定与世界和平。我们敦促发表联合声明的这些国家切实遵守一个中国原则和联大第2758号决议规定,以实际行动维护联合国宪章的权威性,不要在错误道路上越走越远。 声明强调,中国政府和中国人民在台湾问题上的立场一以贯之。坚决维护国家主权和领土完整是14亿多中国人民的坚定意志,实现祖国完全统一是全体中华儿女的共同心愿和神圣职责。任何国家、任何势力、任何人都不要错估中国政府和人民捍卫国家主权和领土完整的坚强决心、坚定意志、强大能力。我们有信心、有决心最终实现国家完全统一和中华民族伟大复兴。 \",\"title\":\"中国常驻联合国代表团发表声明强烈谴责个别国家在台湾问题上干涉中国内政\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/ff510cf01a913300fba29b1313369331/1661316152684.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://soft.imtt.qq.com/browser/smart_service/fm/news_background/news_bg.jpg\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A022SL00\",\"selfData\":{\"newsFrom\":\"极目新闻\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"只有高效做好统筹疫情防控和经济社会发展工作,坚持两手都要抓、都要硬,才能最大限度减少疫情对经济社会发展的影响,推动经济平稳健康发展。 只有疫情被有效控制住,经济发展和正常生活才能具备有利条件;疫情越早得到控制,经济发展受到的影响就越小。 货物进出口总额同比增长16.6%,比上月加快2.3个百分点;全国城镇调查失业率为5.4%,比上月下降0.1个百分点;规模以上工业增加值、服务业生产指数、进出口、社会消费品零售总额、固定资产投资同比均保持增长……国家统计局前不久公布的7月经济数据显示,随着高效统筹疫情防控和经济社会发展各项政策持续显效,国民经济延续恢复态势。这彰显了中国经济的韧性和活力,有力印证了我国疫情防控政策的科学性、有效性。 疫情防控是“国之大者”,经济建设是中心任务。习近平总书记强调:“全面落实疫情要防住、经济要稳住、发展要安全的要求是一个整体,要一体认识、一体落实、一体评估,巩固经济回升向好趋势,力争实现最好结果。”疫情防控和正常生产生活、经济社会发展不是非此即彼的“单选题”,而是相辅相成、辩证统一的关系。只有高效做好统筹疫情防控和经济社会发展工作,坚持两手都要抓、都要硬,才能最大限度减少疫情对经济社会发展的影响,推动经济平稳健康发展。 面对百年不遇的新冠肺炎疫情,有效的疫情防控是经济社会发展的基础。只有疫情被有效控制住,经济发展和正常生活才能具备有利条件;疫情越早得到控制,经济发展受到的影响就越小。今年以来,面对复杂严峻的国际环境和艰巨繁重的国内改革发展稳定任务,在以习近平同志为核心的党中央坚强领导下,我们高效做好统筹疫情防控和经济社会发展工作,疫情防控取得积极成效,经济社会发展取得新成绩。两年多的疫情防控实践充分证明,我国疫情防控效果是好的、效率是高的,有良好的成本效益比。如果搞“集体免疫”“躺平”之类的防控政策,疫情势必会对经济社会发展产生严重冲击,势必会造成更大的损失。 抗击疫情是个系统工程,需要同时考虑三个方面:一是控制疫情,二是保障老百姓正常生活,三是确保经济社会必要运行。可以说,坚持动态清零从来就不意味着放弃经济发展,恰恰相反,是要为经济发展创造良好条件。应该看到,7月份经济虽然延续恢复发展态势,但受多重因素影响,仍有小幅波动。推动经济持续恢复,保持经济运行在合理区间,仍然面临着不少风险和挑战。从国际看,全球疫情蔓延,产业链供应链不畅,地缘政治冲突外溢影响持续,世界经济下行风险加大;从国内看,经济目前处在恢复进程中,经济回升的基础还有待巩固。势要起而不可落。当前正处于经济回稳最吃劲的节点,我们必须以时不我待的紧迫感,高效统筹疫情防控和经济社会发展,巩固经济恢复发展基础。 统筹好疫情防控和经济社会发展,“精准”是道必答题。基于疫情防控形势变化、病毒变异特点以及疫情防控实战的经验总结,动态调整优化防控措施,提高疫情防控的科学性、精准性,是“最大限度减少疫情对经济社会发展的影响”的必然要求。《新型冠状病毒肺炎防控方案(第九版)》对入境人员、密切接触者以及中高风险区的管控周期进行了优化,正是坚持科学精准、动态清零的具体体现。但应看到,优化防控措施绝不是放松防控,决不能松懈厌战。近期,周边国家疫情快速反弹,我国外防输入压力持续增大,同时,奥密克戎BA.5亚分支已经成为全球主要流行株,与以往的变异株相比传播力明显增强。在这样的背景下,我们必须慎终如始,保持战略定力,抓实抓细疫情防控各项工作,坚决巩固来之不易的防控成果。 疫情尚未远去,大考仍在继续,发展不能停步。深刻认识抗疫斗争的复杂性和艰巨性,坚持人民至上、生命至上,坚持外防输入、内防反弹,坚持动态清零,该管的坚决管住,该保的坚决保住,一手抓战“疫”,一手抓发展,我们就一定能打赢疫情防控这场大仗硬仗,实现疫情防控和经济社会发展双胜利。 (来源:人民日报) \",\"title\":\"经济发展和疫情防控两手都要抓、都要硬\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/914ba7136c02f12896e6a4a95c179f5d/1661314275947.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://soft.imtt.qq.com/browser/smart_service/fm/news_background/news_bg.jpg\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A01LJX00\",\"selfData\":{\"newsFrom\":\"台海网\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"[新闻页-台海网] 中新社北京8月23日电? ? 欧洲议会7月将核能、天然气列为“永续分类标准”(即绿能清单),原主张“弃核”的德国今冬势必以核电填补能源缺口。上述发展让以欧洲尤其以德为师的民进党当局,近来在能源问题上陷入无法自圆其说的窘境。 效法西方“进步价值”的“非核”主张,是民进党在“台独”之外的另一张“神主牌”,历次选举中借其站上道德高地、击打竞争对手。不巧,面对今年底胶着的“九合一”选举之际,德、法、日、韩相继政策急转弯,或停止淘汰核能电厂,或重启闲置核反应炉乃至于新建核电厂,让“非核”主张反倒成为政治负资产。 这一背景下,民进党当局8月10日依然通过环评,让台湾电力公司核电二厂正式进入淘汰产能的“除役执行阶段”。当前台湾四座核电厂之中,核电一厂已启动除役,四厂则封存并将燃料棒运往美国,有关二厂的新举措无疑是朝向“非核”再迈一大步。 只是,台湾能源已暴露出大问题。今年3月3日全台大停电及此后不时出现的局部停电,冲击着民众生活、企业生产。制造业代表性团体台湾工业总会哀告,产业界亟需保持供电稳定性,盼当局不排除任何选项。另一重要财经团体“三三会”负责人林伯丰甚至建议,台湾应考虑使用新一代安全核电技术,提高核能发电至30%。台湾美国商会6月份发出年度白皮书,也强调越来越担心台湾的稳定供电问题。 能源问题已常态化、长期化,民进党当局终于决定7月1日起电价上调8.4%,以高压、超高压为主的产业用电大户调涨15%,理由是国际燃料价格上涨。但岛内专家陈立诚认为,症结点在于,台湾正以昂贵能源取代便宜能源。过去,台电六部核电机组正常运转,每年发电400亿度,每度电成本仅1元(新台币,下同);而今用以取代核电的风电、太阳能发电,平均成本是5元。 民进党当局舍得将“十年不涨电价”的选举支票一笔勾销,原因在于长年压低能源价格带来的高额债务。民意代表高金素梅引用今年初台“立法院”预算中心报告,累加台电2020年底负债总额(1.8万亿元)及此后两年负债增速,推估该公司负债或已跨过2.5万亿元。让岛内工商业焦虑的是,第二次、第三次涨价恐为期不远,生产成本将继续攀升。 能源危机就是产业危机。作为支撑当前台湾GDP增长的支柱,以半导体为代表的电子产业无疑是高耗能产业,低电价是其参与市场竞争的重要优势之一。民进党当局将电价上涨压力转移到这些用电大户身上,又无法解决尖峰时刻供电不稳问题,别说进一步扩大投资,未来如何留住相关产业链都要打个问号。 涨价、让市场发挥调节功能,不足以应对当前能源供应问题。此起彼伏的停电事故,暴露出台湾供电备载容量不足、各电厂产能濒于极限,一个小小错误都可能造成全面性问题。在可预见的将来,只能以火力发电填补绿电发展迟缓带来的空缺,而急剧恶化的空污问题及高碳排压力将酿成更多民怨及制造业出口面临课征重税的风险。 欧洲及日、韩核电政策转弯,给了民进党政客丢掉“非核”政策的机会之窗。但面对岛内舆论建言,当局经济事务主管部门下辖能源局回应称“供应无虞”。显然,问题进一步恶化之前,对于只问选举的民进党来说,“神主牌”不能丢。 讳疾忌医,小病也会酿成大灾。就算此刻民进党当局政策急转弯,据台清华大学工程与系统科学系特聘教授李敏评估,要让尚在运转的核电机组延后“除役”都需要一年半时间。被民进党“非核”意识形态套牢,在民生、经济被卷进更黑暗时刻之前,台湾的能源问题仍然无解。(来源:中新网 记者 刘舒凌) \",\"title\":\"欧洲转核能为绿能 民进党照旧抱紧“非核”意识形态?\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/8618821276b08ec4c5d4e0e05d480a33/1661315600368.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15192595587_150120/0,http://inews.gtimg.com/newsapp_ls/0/15192595581_150120/0,http://inews.gtimg.com/newsapp_ls/0/15192595588_150120/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A00JC800\",\"selfData\":{\"newsFrom\":\"秦安战略\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"【编者按】本文为作者本人授权,在秦安战略独家原创刊发,转载自公众号“或渊视点”,有很多精彩内容,欢迎大家关注。 乌克兰疯了!在刚袭击了克里米亚的俄罗斯空军基地,并且给俄军造成了相当的损失后,竟然把目光盯向了俄罗斯国内。 当地时间8月21日凌晨,俄罗斯莫斯科州发生了一起汽车爆炸事件。俄罗斯知名地缘政治家杜金的女儿杜金娜在爆炸中身亡。 俄罗斯联邦侦查委员会当日披露了案件细节,称杜金娜案是不明人士幕后策划的一种刺杀。初步调查显示有大约400克威力巨大的TNT炸药被事先安放在汽车内,随后通过遥控引爆。 爆炸发生后,汽车继续向前行驶,撞上了一栋大楼,杜金娜飞出车外,当场死亡。 在事情发生后第一时间,乌克兰总统办公室主任顾问波多利亚克表示,乌克兰与发生在俄罗斯莫斯科的汽车爆炸事件没有关系。 然而,当地时间22日,塔斯社援引俄罗斯联邦安全局消息,杜金娜案已破。 俄罗斯安全局指出,杀害杜金娜的犯罪行为是由乌克兰特勤部门策划和实施的。具体的执行者是一位43岁名叫娜塔莉亚.帕夫洛夫娜.沃夫克的乌克兰公民。 她于7月23日携带自己12岁的女儿从爱沙尼亚入境俄罗斯。在暗杀前为了收集有关杜金娜的生活规律信息,特别在杜金娜居住的大楼里租住了一套公寓。 然后用一辆宝马MINI Cooper对其进行跟踪。 21日她在用手机引爆了事先装置在杜金娜汽车上的炸弹后,开车经普斯科夫放州逃往爱沙尼亚,最后回到乌克兰。 那么,此次事件是否为乌克兰所为?而乌克兰又为何要制造这场明显可能彻底激怒俄罗斯的暗杀事件? 我们的观点是,该事件是乌克兰亲美分子与美国势力一起导演的一个旨在加剧俄乌矛盾及冲突烈度的一个精心策划的行动。 该事件与不久前乌克兰攻击克里米亚俄罗斯空军基地的目的一样,都是为了升级战争所进行的挑拨。 从美国的利益看,俄乌冲突持续的时间越长越好,冲突的强度越大越好。 而从近期俄乌冲突走势看,由于欧洲各国普遍受通胀影响,经济普遍下滑,使得以欧洲为主的西方主要国家对乌援助有减缓的趋势。这是不利于乌克兰继续坚持对抗俄罗斯的。 所以,需要一种额外的加码的刺激,以便让乌克兰继续成为世界的热点,热度持续维持。 完全不用怀疑,接下来俄罗斯方面一定会祭出强烈的报复措施!而需要思考的是普京会采取什么样的报复措施,以及这个报复会对俄乌战场会产生什么样的新局面? 也许有一种观点会认为,如果此事真的为美国操纵乌克兰极端势力所为,那么普京的报复不是正好落入美国升级俄乌战争的圈套了吗? 好像是,但事实又不是。 即使这是美国的所谓“圈套”那么俄罗斯也必然要做出强烈的报复! 就像当年美国明知日本炸了珍珠港是为了引美国进入二战乱局时也要对日宣战的道理是一样的。 乌克兰,不管是哪种势力对俄罗斯首都莫斯科发动的袭击事件都是非常具有象征意义的严重事件。 它表明乌克兰竟然可以打击俄罗斯的政治中心!而较乌克兰袭击克里米亚不同,俄罗斯是无论如何也不能容忍自己的首都都成为一个不安全的地方。 所以,我们的观点是俄罗斯的报复目标极可能会直接指向乌克兰首都基辅!大家可以观察。 而更可怕的是,在俄罗斯安全局的案情调查出炉后,普京却依然沉默! 但普京一定会出手的! 虽然,普京在当地时间21日宣布承认乌东地区的“顿涅茨克人民共和国“和”卢甘斯克人民共和国“为独立国家,并且签署了俄罗斯与两国的友好合作互助条约,但这并不会是此事件的终结。 最新消息是来自中国外交部及中国驻乌使馆的消息,要求近期中国公民不要赴往乌克兰。 这是一个非常清晰的信号,也意味着乌克兰近期将面临极大的风险。 从2月24日俄罗斯在乌克兰发动“特别军事行动”开始已经半年了,但这场局部战争在美国的强烈推动及欧洲各国如同芬兰总理如同热舞一样游乐心态的力挺下,不但没有结束的迹象,反而不断升级。 历史重演的概率是很大的,参考前两次世界大战的氛围看,这是一个很危险的信号! \",\"title\":\"国师之女惨遭暗杀,俄报复或直接打击基辅!中国公民勿前往乌克兰\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/a1db432d3738ea0c59cac92293569c0c/1661310086641.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://soft.imtt.qq.com/browser/smart_service/fm/news_background/news_bg.jpg\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A01FCN00\",\"selfData\":{\"newsFrom\":\"金台资讯\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"本报上海8月23日电 (记者刘士安、巨云鹏)8月中旬,2022年度长三角G60科创走廊科技成果拍卖会现场成交3.27亿元,新一轮科技成果累计成交额超过50亿元,远高于上一年度的10.23亿元。科创要素的加速集聚,折射出长三角一体化高质量发展的坚实步伐。 2020年8月,习近平总书记在扎实推进长三角一体化发展座谈会上强调,要深刻认识长三角区域在国家经济社会发展中的地位和作用,结合长三角一体化发展面临的新形势新要求,坚持目标导向、问题导向相统一,紧扣一体化和高质量两个关键词抓好重点工作,真抓实干、埋头苦干,推动长三角一体化发展不断取得成效。 从138个政务服务事项在长三角地区41座城市跨省市通办,到合作共建长三角国家技术创新中心,再到长三角生态绿色一体化发展示范区38项制度创新成果向长三角和全国其他有条件的重点地区复制推广……沪苏浙皖三省一市深入贯彻落实习近平总书记重要讲话精神,紧扣一体化和高质量两个关键词,紧密携手、各展所长、协同发力,发展动能更加强劲,进展成效更加凸显。 推进科技高水平自立自强。三省一市深入实施创新驱动发展战略,共同强化战略科技力量,优化重大科技基础设施布局,搭建科技创新合作平台,加快科技资源开放共享。位于上海张江高科技园区的长三角国家技术创新中心,由沪苏浙皖合作共建,旨在打造长三角“产学研用”深度融合创新枢纽和国家技术创新体系战略节点,以高水平的技术供给支撑区域高质量发展。2021年,长三角地区获评国家科学技术奖137项,在全国占比超过50%;获得发明专利18.2万件,在全国占比约26%;国家重点实验室数量达104家,在全国占比约20%。“长三角地区以一体化的思路和举措,有力推动了创新要素在更大范围畅通流动。”长三角国家技术创新中心主任刘庆说。 打造世界级产业集群。围绕集成电路、生物医药、人工智能等战略性新兴产业和先进制造业,长三角地区着力打造优势产业集群,不断提升在全球价值链中的地位。目前,长三角地区集成电路产业规模占全国58.3%,生物医药和人工智能产业规模均占全国约1/3。去年,长三角地区集成电路、生物医药、新能源汽车、人工智能四大产业链联盟揭牌。沪苏浙皖完善产业链供应链跨区域协调机制,加快推进产业链补链固链强链行动,联合开展机器人、新型电力装备、节能与新能源汽车等产业链研究。 构筑改革开放新高地。长三角地区持续深化开放合作,优化区域营商环境,不断增强国际竞争合作新优势。去年5月,长三角自由贸易试验区联盟成立,积极推动三省一市自由贸易试验区深度合作。2021年,沪苏浙皖自由贸易试验区货物进出口总额达3.1万亿元,占全国自由贸易试验区的46.2%;实际使用外资共计1042.6亿元,占全国自由贸易试验区的48.9%。虹桥国际开放枢纽促进长三角深化改革、协同开放,以占长三角不到2%的区域面积,贡献了近10%的经济总量。 着力高效统筹疫情防控和经济社会发展,长三角三省一市为稳定全国经济大盘作出积极贡献。统计数据显示,2021年,长三角地区生产总值占全国比重达24.1%,研发经费投入占比29.8%,进出口总额占比36.1%,固定资产投资同比增速高于全国平均增速3.2个百分点。 “以更高质量的一体化助力现代化建设的新实践,以一体化发展的确定性应对外部环境的不确定性,奋力谱写长三角一体化发展新篇章”,日前在上海举行的2022年度长三角地区主要领导座谈会指出,要拿出更加有力的措施,展开更加务实的行动,坚定不移将长三角一体化发展引向深入。 《 人民日报 》( 2022年08月24日 01 版) \",\"title\":\"长三角扎实推进一体化高质量发展\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/5cba312900646da48db42c253e4dc3ad/1661310157065.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"https://inews.gtimg.com/newsapp_ls/0/15192771103_196130/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A019LL00\",\"selfData\":{\"newsFrom\":\"海峡导报社\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"民进党当局检廉单位在今年1月13日大动作搜索宜兰县长官邸等处所后,历经7个多月,宜兰地检署昨(23)日侦结起诉县长林姿妙等15人。检方声称林姿妙所涉犯4案,其中2案是违反“贪污治罪条例”,要法院将林姿妙母女从重量刑。林姿妙23日也正面回击,强调对方掌握选举节奏,赶在选举登记前起诉她,很明显是政治追杀。她一生清清白白,没有做对不起县民的事情,选民会用选票还她公道。国民党县议员也抨击,蔡英文才来宜兰下达“军令”要在年底拿回宜兰,检廉单位就有动作,时间点太巧合。 台当局选务机构将在下周一(8月29日)至下周五(9月2日),受理县市长候选人登记。林姿妙已获国民党提名参选宜兰县长、争取连任,她说,预计在9月1日上午9时登记参选县长,为公平正义、为宜兰而战。 而民进党当局检廉单位拟声称,林姿妙所犯有伪造文书、洗钱,及“贪污治罪条例”的违背职务行为收取不正利益罪、财产来源不明等罪嫌,是遭起诉的15人中,所犯最多者。此次15位被告中,有10位是公务员,当中康立和、卢天龙、黄志良、吴朝琴四人为宜兰县政府局处长。另有5名非公务员,包括林姿妙的女儿林羿伶。 林姿妙表示,很早就断定,对手一定会用起诉作手段影响选举,目的非常明显就是政治追杀。两天前看到民调显示自己赢对手,她心里也很清楚,很快就要被起诉了。这完全说明,对手用行政机器打击,完全没有公平正义。 她说,自己在登记前被起诉,一点不感到意外,只是很心痛很委屈,对手用肮脏污蔑手段,无所不用其极达到胜选目的,这不是“民主社会”该发生事情。她也很遗憾地检署再也不是公正客观的机构,已沦为政治打手,即便未来证明是清白的,选举已结束,迟来的正义有用吗? 国民党县议员黄琤婷说,蔡英文上周来宜兰,检廉单位随即就有动作,相信这一切都看在民众眼里。县议员林岳贤与庄淑如也指出,县民不是傻子,愈是抨击、县长会愈坚强,相信选民的眼睛是雪亮,会用选票力挺县长。 国民党声明表示,林姿妙长期深耕宜兰,政绩卓着,为县民称许,司法绝不能有颜色,更不能成为政治的打手。国民党尊重司法程序,但也吁司法勿成民进党的选举工具,盼检调机关与法院务必秉公执法,给林姿妙及县政府团队公平、公正机会证明清白。 国民党也质疑,此案首波侦查开始已有特定媒体指导办案方向,更有特定人取得比当事人更完整重点口供与资料,让特定媒体捕风捉影,甚至在官邸遭搜索时还有特定媒体记者到现场录影拍照,都让人质疑有“政治追杀”企图。昔日大动作搜索与马拉松式约谈,更有违“比例原则”和“法治原则”。 台湾“中时新闻网”报道,国民党宜兰县长林姿妙在选举登记领表前夕被检方起诉,由于林姿妙亲和力佳,在基层中颇具声望,目前仍领先对手民进党参选人江聪渊。但随着起诉的冲击发酵,势必拉近林、江二人差距,中间选民的动向,将是左右年底选战的关键。 据报道,今年1月检廉搜索林姿妙等官员之前,林姿妙与江聪渊民调支持度差距相当大,绿营当时士气低迷,党内人士坦言“很难选”。但林姿妙接连两次遭到搜索、四次应讯,二人差距不断拉近,也让江聪渊阵营看到翻转的契机。 林姿妙在获得交保后,依旧勤于经营基层,加上国民党宜兰县议会党团猛打江聪渊“盗采砂石案”助攻,蓝军选情渐渐回稳。江聪渊一直难以拉近与林姿妙的民调差距,对民进党而言,宜兰县依旧是“艰困选区”。 检方在年底选前侦结,原本就在蓝绿预料之内,但起诉书中重批林姿妙母女“紊乱县府行政体制”、“操弄县府官员于股掌之间”及请求“从重量刑”,句句无一不是绿营制作文宣的绝佳材料。 外界认为,检方的起诉虽可能伤及林姿妙的选情,但因距投票日还有3个月时间,目前仍难断定对选情影响范围有多大。此外,“司法不公”、“选择性办案”也可能凝聚蓝军的向心力。更何况,当初迫于侦查不公开而无法对外说明的林姿妙,在遭起诉后是否会破釜沉舟提出证据释疑,也成为另个变数。 台媒认为,绿营穷尽洪荒之力,盼借由此案出现关键的破口,以收复党内视之为“民主圣地”的宜兰县。但对宜兰县民来说,未来县政的规划与方向,毋宁较蓝绿互揭疮疤来得更为重要,起诉是否成为震撼弹仍有待观察。(林静娴/编辑) \",\"title\":\"宜兰县长林姿妙控遭政治追杀,台媒:中间选民动向成年底选战关键\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/2cfa65a64e9063a7213618dfba0abe38/1661308343591.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15190763285_240180/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220823A044QP00\",\"selfData\":{\"newsFrom\":\"泛史寘\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"最近欧洲天然气价格创出历史新高,其实,不仅仅是能源紧张,欧美圣诞节都有点悬了,如何过好今年的圣诞节,已经成了欧美眼下最紧要的事,要尽快疏通物流,及时进口商品,保证过好今年的圣诞节,感恩节更要保障购物需求。 除了海运,美国没有别的物流通道,但是欧洲就不一样了,欧洲除了海运之外,现在有了中欧班列,可以从欧亚大陆直接接收中国的货物,相当一部分原来的海运货物现在走中欧班列,这样欧洲实际上开辟了中欧贸易新的物流大通道。 据中国发改委的消息,截止今年7月31日,中欧班列累计开行超过5.7万列,运送530万标准箱,这是什么概念呢?大致相当于海运的一半,也就是说,现在中欧贸易正在向陆地运输转型,海运价格飙升之际,正是中欧班列快速增长之时,这虽然不是说废除海运,但显然两条腿走路要比单纯的海运更好,增加了中欧班列这条陆地大通道,欧洲能够更多地接收中国货物。 短短几年的时间,中欧班列从开始到现在,已经成了重要的物流大通道,当年谁也不会想到,中欧班列会成为解决货物短缺的一条大动脉,当年很多人不看好中欧班列,认为这只不过是画蛇添足,有中欧海运通道,中欧班列最多不过是一个补充,但没想到现在来看,中欧班列成了大动脉,而且有望成为一条世界性的大动脉,塑造和改变世界贸易的版图,最重要的是能够及时解决货物短缺,保证欧洲获得及时供应。 纵观全球,也只有欧亚大陆有条件开通中欧班列这样一条大动脉,其他各大洲都没有这样的条件,中欧班列抓住了历史性机遇,获得了历史性成功,深刻地改变了世界贸易的版图,也带动了沿途各国经济发展,最终中欧班列会带动沿途经济活动,激活整个欧亚大陆的经济活力,成为世界贸易大动脉,被写进历史,这个前景现在来看是十分清晰的,这才几年的时间,中欧班列就如此重要,可见当年的决策是多么地有战略眼光。 未来中欧班列还会增加运输路线,一个是在沿途开辟新的路线,辐射带动沿途各国各地经济活动,再就是向中亚中东延伸,甚至经过中东直抵非洲,这些前景都是十分清晰的,最关键的是中欧班列的活力,激发了欧亚大陆经济活动,推动了世界贸易蓬勃发展,延伸至非洲的话,就会激发欧亚非大陆的活力,世界经济贸易的版图就会发生深刻变革,传统的欧美主导的世界贸易格局就会被改写。 中欧班列无疑是人类文明史上的一次伟大创新,足以改变人类文明的发展结构,从当下来看,就是能够有效地促进中欧贸易发展,改变全球运输结构,弥补海运的不足和紧张,并且能够越来越深入地激发沿途各国各地的经济活力,推动世界经济持续稳健发展,这既是中国对世界经济做出的巨大贡献,更是中国的伟大改革和创新。 \",\"title\":\"别不相信,中欧班列改变世界格局!\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/868df043e007d1ce7711ddb350047225/1661306566999.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15192702502_196130/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A00YX000\",\"selfData\":{\"newsFrom\":\"法治日报\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"党的十八大以来,改革不停顿,开放不止步。 中国的扩大开放进行得有条不紊、有声有色,形成全方位、多层次、宽领域的全面开放新格局。 这十年,负面清单越来越短,2021年版外资准入负面清单连续第五年缩减,全国和自贸试验区负面清单进一步缩减至31条、27条。更高水平的开放吸引了更多国际投资者“用脚投票”,2021年中国实际使用外资金额超过1.1万亿元,引资规模再创历史新高。 这十年,进口商品越来越多,进博会、服贸会、广交会、消博会等国际经贸盛会成为我国开放的最佳示范窗口,中国不仅是“世界工厂”,也是“世界市场”。 这十年,“朋友圈”越来越大,截至2022年7月底,中国已与149个国家、32个国际组织签署200多份共建“一带一路”合作文件。“中老铁路”建成通车,“雅万高铁”等一大批项目扎实推进。我国加入区域全面经济伙伴关系协定(RCEP),与26个国家和地区签署了19个自贸协定,自贸伙伴覆盖亚洲、大洋洲、拉丁美洲、欧洲和非洲。 这十年,贸易和投资自由化便利化程度不断提升,我国境外投资存量从不足6000亿美元增至超过2.6万亿美元,我国积极参与全球经济治理,为构建人类命运共同体贡献中国智慧和中国力量。 “一带一路”带来越来越庞大的“朋友圈” 共建“一带一路”已成为当今世界广受欢迎的国际公共产品和国际合作平台。7月29日商务部举行的“2022年上半年商务工作及运行情况”专题新闻发布会上,商务部相关负责人介绍,“一带一路”重大倡议提出9年来,中国与相关国家一起坚持共商共建共享原则,深化互利共赢合作,取得了实打实、沉甸甸的建设成就。 商务部相关负责人表示,中国持续巩固合作基本盘,深入挖掘与共建国家的贸易潜力,鼓励优质商品进口,加快发展跨境电商、海外仓等外贸新业态。同时优化对外投资合作,吸引共建国家来华投资。今年上半年,我国与“一带一路”沿线国家货物贸易额达6.3万亿元,同比增长17.8%,占比提高到31.9%。对沿线国家非金融类直接投资达650.3亿元,增长4.9%,占比提高到18.5%。同期,沿线国家对华实际投资达452.5亿元,增长10.6%。 同时,中国积极对接共建国家的发展需求,推动绿色、数字等领域合作,积极支持清洁能源、生态保护、信息通信、新型基础设施等领域项目合作。深入发展“丝路电商”,推动与更多国家建立电子商务合作机制,帮助共建国家拓展贸易新渠道。 2013年9月和10月中国向世界分别提出建设“新丝绸之路经济带”和“21世纪海上丝绸之路”的合作倡议,由此拉开“一带一路”序幕。依靠中国与有关国家既有的双多边机制,借助既有的、行之有效的区域合作平台,“一带一路”借用古代丝绸之路的历史符号,高举和平发展的旗帜,积极发展与沿线国家的经济合作伙伴关系,共同打造政治互信、经济融合、文化包容的利益共同体、命运共同体和责任共同体。 2015年3月28日,国家发展改革委、外交部、商务部联合发布了《推动共建丝绸之路经济带和21世纪海上丝绸之路的愿景与行动》,进一步落实和细化了“一带一路”倡议的共建原则、框架思路、合作重点、合作机制等内容。 据商务部披露的数据显示,2015年中国企业共对“一带一路”相关的49个国家进行了直接投资,投资额同比增长18.2%。2015年中国承接“一带一路”相关国家服务外包合同金额178.3亿美元,执行金额121.5亿美元,同比分别增长42.6%和23.45%。2016年6月底,中欧班列累计开行1881列,其中回程502列,实现进出口贸易总额170亿美元。截至今年7月底,中国已与149个国家、32个国际组织签署200多份共建“一带一路”合作文件。 27项措施提升跨境贸易便利化 世界银行发布的2020年全球营商环境报告指出,中国的营商环境大幅提升优化,全球排名从2013年的第96位跃升至最新的第31位。这样的成就离不开我国近年来坚持推行的跨境贸易便利化改革的各项措施。 这其中首推国际贸易“单一窗口”建设带来的作用。作为国家为广大进出口企业搭建的公共信息平台,国际贸易“单一窗口”自2016年建设以来,已对接了口岸和外贸领域25个部委系统,提供739项对外贸易服务,累计注册用户已经达443万余家,日申报业务量达1200万票。它的主要功能是“三大”,即大通关、大物流、大外贸;它的主要特点是“三跨”,即跨地区、跨行业、跨部门。企业足不出户,就可向海关、外汇、税务等部门一次性提交相关申请资料,“一窗通办”相关部门业务。这实现了口岸各部门间的信息共享和业务协同,进出口环节38种监管证件全部通过“单一窗口”实现联网核查、无纸通关。 上述一系列“硬招实招”的出台,让我国口岸营商环境持续优化,跨境贸易便利化水平逐年提升,在世界银行跨境贸易指标全球排名从2017年的第97位,提高到了2019年的第56位。 中国的进步不止于此。今年7月29日,国新办举行国务院政策例行吹风会,海关总署党委委员、国家口岸管理办公室主任黄冠胜表示,海关总署会同发改委、财政部、交通运输部、商务部、卫健委、人民银行等相关部门,通过深入研究和措施细化,推出5个方面27项具体内容,进一步优化通关全链条全流程,打造更加科学高效的外贸货物通关模式。具体内容包括:支持海外仓建设,完善跨境电商出口退货政策;进一步降低进出口环节费用,巩固清理规范口岸收费成果,不断提高口岸收费的规范化、透明化水平,修订《港口收费计费办法》,加大督查检查力度,依法依规查处口岸经营活动中的涉嫌垄断行为。优化完善“经过认证的经营者”(AEO)制度,为认证企业提供更多便利化措施和渠道。 黄冠胜介绍,接下来我国还要推进口岸建设智慧转型,推动集装箱设备交接单、装箱单、提货单等口岸物流单证无纸化建设,加强自动化码头建设,推广智能卡口、无人集卡等新技术,扩大智能审图应用,提升口岸基础设施和监管智能化水平。 外商投资准入负面清单由93项降至31项 党的十八大以来,我国积极推动对外开放,积极推动制度性开放体系建设。 2013年9月29日,“中国(上海)自由贸易试验区”在上海浦东外高桥挂牌成立。与此相伴随的是,中国第一份外商投资负面清单落地,全面深化改革的“种子”在国家试验田的沃土中生根发芽茁壮成长。经过7次压减,清单条目由最初的190项减少到2021年的27项,压缩比例超过85%,开放领域涉及第一、二、三等各个产业,制造业条目清零,服务业持续扩大开放,市场准入全面放宽,带动全国对外开放度不断提高。 一张不断缩短的清单,见证的是中国越开越大的开放之门。 2016年,自贸试验区负面清单制度推广到全国,在全国实现外商投资准入负面清单管理模式,限制措施也由最初的93项锐减到现在的31项。2020年,我国实施新的外商投资法,开启了一个新的外商投资管理体制。2021年,我国在海南推出了第一张跨境服务贸易负面清单。 21个自贸试验区占全国国土面积不到千分之四,但是其贡献的进出口额却占到全国的17.3%,吸收外资占到全国的18.5%。2018年,海南自由贸易港建设启动,迄今已经推出了120多项制度创新成果。 而自由贸易区提升战略也实现了新的突破。我国对外签署的自贸协定数在过去十年由10个增长到19个,增长了近1倍。同时,我国和自贸伙伴的贸易额占全国全部贸易额的比重由17%增长到2021年的35%。 此外,我国对外开放的广度和深度亦得到全面拓展。根据商务部对外披露数据显示,我国商品出口占国际市场份额由11%上升到15%,货物贸易第一大国的地位得到了进一步增强。2012年,我国货物+服务贸易总额达4.4万亿美元,在全球位居第二位。到2021年,我国货物+服务贸易总额增长到6.9万亿美元,连续两年全球第一。另外,我国双向投资也稳居世界前列,2021年我国吸引外资达到1.15万亿元,比2012年增长62.9%。从2017年以来,中国吸引外资连续四年位居世界第二,对外投资流量稳居全球前三位。 法律制度建设体现高水平对外开放时代特征 中央财经大学法学院教授高秦伟分析指出,自贸区的实践证明,破除体制机制的障碍,有利于促进特色优势产业的发展和相关市场主体的集聚,提升产业链供应链国际化水平,牢牢把握高质量发展的内涵和要求,破除阻碍国内国际各类创新资源和关键要素聚集的体制机制障碍,优势产业集群不断培育壮大,带动产业集群发展。 记者了解到,自贸区持续不断扩大开放和制度创新,也进一步激发了市场活力,增强了高质量发展动能。金融开放创新有效服务实体经济,向全国推广了外商投资企业外汇资本金意愿结汇、跨境双向人民币资金池业务等举措,推动企业融资更加便利、渠道更宽、成本更低,有力支持实体经济发展。深入推进政府职能转变,各省区市累计向自贸试验区下放5000多项省级管理权限,推进“多证合一”等商事制度改革试点,减少审批事项,大幅降低企业生产经营成本。 此外,我国外商投资法律体系也进一步完善。外商投资法正式实施,以对外开放为主基调,确定了外商投资促进、保护、管理的基本制度,为外商投资权益提供了更全面、更有力的法治保障,体现了高水平对外开放的时代特征。发改委连续3年清理与外商投资法不符的法规、规章和规范性文件,累计推动500多份文件“立改废”,充分保障了外资企业公平竞争待遇。 同时我国参与全球经济治理也作出了新的贡献。2014年,我国推动了21个成员达成《亚太经合组织推动实现亚太自贸区北京路线图》,为亚太地区建设高水平自贸区描绘了蓝图。 高秦伟认为,上述种种措施制度的实施使得我国外商投资环境明显改善。作为全球最大、增长最快的市场之一,我国拥有完善的产业配套体系、丰富的人力资源、良好的创新环境和无可比拟的内需潜力,全球外资企业始终看好中国经济发展前景,愿意扎根深耕中国市场、与中国经济共成长。 作者|法治日报全媒体记者?万静 来源|法治日报 编辑|宋胜男?刘丹 丁兆汝 \",\"title\":\"奋进新征程 建功新时代·非凡十年|在全面开放中实现经济社会高质量发展——“十年答卷”系列专题报道之四\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/c6219bc6726ed2554d16ca938d95a74c/1661306648161.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15192682994_196130/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A00WGG00\",\"selfData\":{\"newsFrom\":\"大河财立方\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"河南日报记者 刘勰 河南日报社全媒体记者 崔文 8月23日,记者从省委巡视办了解到,十一届省委第二轮巡视13个巡视组完成对部分省辖市及所辖县(市、区)、相关省直单位的巡视进驻。 据悉,本轮巡视时间两个月左右,巡视期间设置专门值班电话和专用邮政信箱等,主要受理反映被巡视党组织领导班子及其成员、下一级党组织领导班子主要负责人和重要岗位领导干部问题的来信来电来访。巡视期间,省委巡视组将严格落实中央八项规定及其实施细则精神和省委相关规定,主动接受被巡视对象和社会各界的监督,省纪委监委监督举报电话12388,省委组织部监督举报电话12380。 附十一届省委第二轮巡视进驻一览表 责编:陶纪燕 | 审核:李震 | 总监:万军伟 (来源:河南日报) \",\"title\":\"十一届省委第二轮巡视完成进驻\"}],\"templateInfo\":{\"base_type\":\"audio\"}}},\"response_text\":\"以下是最新的热点新闻,内容来自腾讯新闻音频产品:海豚智音。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661321615127300_qP9P8BX9Dvvvm"}} +{"level":"debug","time":"2022-08-24 14:13:35","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"news\",\"intent\":\"search\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835378435002368\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"false\",\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\",\"version\":\"\"},\"globalInfo\":{\"backgroundAudio\":{\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"listUpdateType\":\"COVER\",\"seeMore\":\"\"},\"innerInfo\":{\"defaultPlayAction\":true,\"subType\":\"\"},\"listItems\":[{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/309fc3cd0255969a44c524fdd1dfc4e2/1661320903175.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15193266192_150120/0,http://inews.gtimg.com/newsapp_ls/0/15193266205_150120/0,http://inews.gtimg.com/newsapp_ls/0/15193266199_150120/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A03JS800\",\"selfData\":{\"newsFrom\":\"豫商览天下\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"当今世界,很多国家惧怕中国的飞速发展从而反华来压制中国的发展,为首的便是美国,日本,英国这几个国家,但是从去年的时候开始,立陶宛这个本来与中国没有什么仇的国家莫名其妙的在国际上所表现出的反华情绪十分高涨,在国际上更是多次挑衅我国。 而这个国家最近更在这个台海问题严重的时刻,公然挑拨中国台湾和中国大陆的关系,试图破坏两岸坚持的一个中国的原则。 立陶宛为何如此敌视中国 很显然,立陶宛对中国的敌视,并不是因为中国在国际上的影响或是形象不好所以主动仇视中国的,而是因为美国对待中国的态度是仇视的,所以他们对中国的态度才是仇视的。替美国办事帮美国说话的原因就是因为美国长期以来的都是通过所谓的民主基金等渠道,对一些国家“合法”地进行“赞助”和“资助”,用这个方法来控制住那些被资助的和赞助的国家。而被美国以这种方式资助过的国家,很少有能从中脱离出来的,否则它们将要面对美国对他们在各种国际行为上的职责和生事。尤其是那些自身国力大大不如美国的国家,美国基本都是通过“赞助”“资助”等等“公关”方法,将这些小的国家变成没有想法只听美国话的木偶。因为这些国家政要最容易被接触到,最容易开展“公关”,他们的决策程序简单快捷,见效最快。 立陶宛挑衅中国,中国霸气反击 早在很久之前,立陶宛就曾无视中方严正抗议和反复交涉,允许台湾当局单独设立设立“驻立陶宛台湾代表处”。此举公然在国际上挑拨中国与台湾的关系,严重的损害到了我国在国际上的形象,侵害了我国的利益,强行干预我国的内政。中国对立陶宛的行为十分不满并对损害我国统一的行为表示严重抗议,针对此事,中方将两国的外交关系下降为代办级。 而之前的教训,并没有让立陶宛长记性。前不久,美国国会议长佩洛西窜访台湾之后,相关人等蠢蠢欲动。美国众议院议长佩洛西一意孤行地窜访台湾地区,此举动已经让中美双方关系僵硬,中国也对美国所做的行为做出了回应,并对美国进行了不同方面的制裁,但是瓦伊丘凯维丘特却并不将此事放在心上,反而率团公然窜访台湾地区,践踏一个中国原则,损害中国的主权。 这无疑是对中方公然的挑衅,对于这种行为,中方也在第一时间就对立陶宛予以制裁。而对于瓦伊丘凯维丘特明知故犯地挑衅行为,中方也坚决回击。中国外交部对此事也作出回应称:中方日前决定制裁瓦伊丘凯维丘特,并对立陶宛采取了两项措施第一个是暂停和立陶宛交通与通讯部所有形式的来往,第二个是暂停与立陶宛的道路运输领域交流合作。 立陶宛颠倒黑白抹黑中方形象 然而,针对中方合理合法的反制措施,立陶宛政府却颠倒黑白地抨击、抹黑中方,向中方提出所谓的正式抗议并要求中方撤销相关决定。立陶宛外交部口口声声说,无论是制裁瓦伊丘凯维丘特,还是暂停中立双边交通运输领域的相关合作,中方的决定都是片面的、缺乏正当性的,这不仅违反国际法,还侵犯了立陶宛的主权。 而对于自己反复挑衅中国底线,在国际制造矛盾与冲突,破坏一个中国的的原则,面对中国的反复警告依旧我行我素这些行为却是只字未提,中国对立陶宛实施的制裁,既是对立陶宛对此此事的影响作出的回应,也是向立陶宛表明中华人民共和国的尊严不可挑衅。 中方实施反击合情合理 事实上,中国的这种举措,也是十分正常的。首先,一个中国的原则是我们所一直坚持的原则,不管是中国台湾还是中国大陆,都是中华人民共和国,认同这一基本原则,是中国同立陶宛发展双边关系的政治基础。当初两国建交的时候,白纸黑字都写的很清楚,立陶宛是拿着国家信用来背书的。立陶宛政府曾承诺过,立陶宛不会和台湾地区建立官方关系,基于立陶宛对中方的承诺,中国和立陶宛才进行的建交,那这个承诺必然也是中国和立陶宛建交的基础,立陶宛的行为多次视此承诺于无物,那中国取消与立陶宛的经济文化交流也是理所应当的. 其次,中国和立陶宛之间,往日无怨近日无仇,他们会站在中国的对立面,疯狂攻击中国,是可忍孰不可忍?立陶宛以牺牲中国主权的方式来满足自己的私利,这种行为不管是对任何国家来说都是对其尊严的挑衅绝对不会被允许的行为。 第三,我们之前已经有过明确警告。在去年的时候立陶宛对中国尊严的挑衅行为,中国已经撤出了在立陶宛驻地的大使,并且遣返了立陶宛在中国驻地的大使,在将中立两国外交关系降为代办级的同时,也明确强调过,“立陶宛政府必须承担由此产生的一切后果。对于我国的利益和我国的领土完整性我国在对待此类问题上一定是寸步不让的。立陶宛所作的这些行为,中国已经是事前警告过了,“勿谓言之不预”。 立陶宛要求中方取消制裁 面对中国对立陶宛实施的制裁,立陶宛当局表示,中国不可以停止与立陶宛的经济贸易往来,不可以对立陶宛实施制裁。立陶宛当局还称:“中国的单方面决定是毫无道理的,它违背了立陶宛的主权和国际法。” 就在立陶宛要求中方取消制裁、并对中方进行无端指责的同一天,立陶宛总理英格丽达还正式将自己的顾问保利乌斯任命为所谓的“立陶宛首位驻台湾地区代表”,并宣布他将于下个月抵达台北并开设正式的外交办事处。 很难想象,立陶宛是怎么敢在这种情况下要求中方取消制裁的——与台湾地区建立所谓的“外交关系”,这是严重侵犯我国的主权和领土完整的行为,这是我方已多次在国际上强调、并得到大多数国家同意的主张。 立陶宛的行为到底为何 立陶宛的这一系列不知为何的举措其实是陷入了政治上的“两极陷阱”中。立陶宛自成立以来,就一直信奉所谓的“去东方化”,长期以来想方设法往欧美靠近,并坚决与中俄划清界限。而美国单方面夸大的所谓的“中俄威胁”,更加剧了立陶宛的“反东方情绪”。 在美国不断试图靠台海局势搞“以台制华”的把戏时,立陶宛作为一个典型的亲美反华国家,必然想要借此机会给美国“献殷勤”,并以此为由向美国请求更多的经济或军事援助。而事实上,立陶宛的把戏也确实奏效了:美国同意与立陶宛签署协议,向立陶宛提供6亿美元的国际信贷支持。 有学者已经明确指出,立陶宛的战略,就是一边凭借地理位置的优越性,使得它笃定地相信中方不会对其采取军事报复,一边想方设法找中国的麻烦,逼迫中国对立陶宛进行报复,然后再跑到欧美国家面前“卖惨”,借此换取政治和经济上的利益。而就目前欧盟方面的表态来看,欧美国家显然也挺乐意吃它这一套。 但值得注意的是,立陶宛现在国内也是一团糟,大量立陶宛民众对政府一厢情愿的反华政策十分反感,认为这只会“引火烧身”、“玩火自焚”。历史已经无数次地证明,任何甘当美国“政治棋子”的国家,最后都不会有什么好下场。 总而言之,瓦伊丘凯维丘特窜访台湾地区,公然侵犯中国主权,中国对其的制裁也是合理合法的,造成这样的局面,也是她明知故犯的结果,咎由自取、责无可逃。作为国际社会的一员,立陶宛政府该做的是承认自己的错误,承担相应的后果,清理自己的门户,守护好自身的国家信用,而不是拿各种借口粉饰自己官员的行为,在错误的道路上一去不回,最终搬起石头砸自己的脚,沦为国际笑柄。 \",\"title\":\"知道怕了?中方反制奏效,立陶宛急了:要求取消制裁恢复合作\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/2aff7e209fdd2c68e537f4e811c70ace/1661317930639.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://soft.imtt.qq.com/browser/smart_service/fm/news_background/news_bg.jpg\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A02XB300\",\"selfData\":{\"newsFrom\":\"界面新闻\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"据中国常驻联合国代表使团网站,8月23日,中国常驻联合国代表团发表声明,对伯利兹等国常驻联合国代表当日就台海局势发表所谓“联合声明”散布错误言论予以严正驳斥。 中国常驻联合国代表团声明指出,伯利兹、斯威士兰、危地马拉、圣文森特和格林纳丁斯等极少数国家的常驻联合国代表于8月23日就台湾问题和当前台海局势发表联合声明,不辨是非、无端指责中国维护国家主权和领土完整的正当举措,严重干涉中国内政。中方对此表示坚决反对和强烈谴责。 声明强调,世界上只有一个中国,台湾是中国领土不可分割的一部分,中华人民共和国政府是代表全中国的唯一合法政府。1971年联大第2758号决议对此予以明确确认。坚持一个中国原则是国际社会的普遍共识,也是遵守国际关系基本准则的应有之义。发表联合声明的这些国家同台湾保持所谓“外交关系”,严重侵犯中国主权和领土完整,干涉了中国的内政,错误地站在世界上绝大多数国家的对立面,现在又发表歪曲事实、颠倒黑白的错误言论,无疑是错上加错。 声明指出,这些国家发表的联合声明称“中国目前在台湾周边区域开展的军事演训对地区和平构成威胁”。中国采取的措施,包括在中国台湾岛周边海空域进行正常军事演训行动,是针对美国国会众议院议长佩洛西窜访中国台湾地区、外部势力蓄意挑衅采取的必要回应,是正当、必要、适度的,符合国内法、国际法和国际惯例。近期台海紧张局势的来龙去脉一清二楚,是非曲直一目了然。挑起事端的不是中国,制造危机的不是中国。这些国家对近期外部势力破坏中国主权和领土完整的事实视而不见,反而无理指责中方的正当举措,丧失了最起码的是非观、公正性和独立性。 声明指出,这些国家发表的联合声明声称“希望维持现状”,台湾问题的现状是什么?台湾从来不是一个国家,中国只有一个,两岸同属于一国,这就是台湾问题从古至今的现状。需要指出的是,恰恰是美国等一些外部势力支持怂恿“台独”势力加紧进行分裂活动,不断破坏台海现状。这是导致台海局势出现紧张和严峻挑战的根本原因。这些国家还提到所谓“海峡中线”,要知道台湾是中国领土的一部分,在台湾海峡根本不存在什么“中线”。 声明强调,这些国家声称要维护“以规则为基础的国际秩序”,他们应该知道,世界只有一套规则,就是以联合国宪章宗旨和原则为基础的国际关系基本准则。联合国宪章规定了尊重国家主权和领土完整、不干涉内政等重要原则。中方采取必要行动维护国家主权和领土完整,是在行使国际法所赋予的神圣权利,也是在捍卫国际关系的基本准则。如果任由主权平等、不干涉内政这样的重要原则被抛弃,世界将重回丛林法则,超级大国将更加肆无忌惮地霸凌其他国家,这样受害最深的肯定是广大发展中国家和中小国家。伯利兹等国家历史上长期遭受殖民主义和外来干涉之害,理应对维护联合国宪章宗旨和原则,尊重主权和领土完整的重要性有深刻认识,现在却不辨是非、颠倒黑白,显然是站在错误一边,站在公平正义的对立面。 声明表示,己所不欲,勿施于人。中国外交历来坚持主权平等和相互尊重。我们致力于同所有热爱和平、主持公道的国家一道,共同捍卫联合国宪章的宗旨和原则,共同维护地区稳定与世界和平。我们敦促发表联合声明的这些国家切实遵守一个中国原则和联大第2758号决议规定,以实际行动维护联合国宪章的权威性,不要在错误道路上越走越远。 声明强调,中国政府和中国人民在台湾问题上的立场一以贯之。坚决维护国家主权和领土完整是14亿多中国人民的坚定意志,实现祖国完全统一是全体中华儿女的共同心愿和神圣职责。任何国家、任何势力、任何人都不要错估中国政府和人民捍卫国家主权和领土完整的坚强决心、坚定意志、强大能力。我们有信心、有决心最终实现国家完全统一和中华民族伟大复兴。 \",\"title\":\"中国常驻联合国代表团发表声明强烈谴责个别国家在台湾问题上干涉中国内政\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/ff510cf01a913300fba29b1313369331/1661316152684.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://soft.imtt.qq.com/browser/smart_service/fm/news_background/news_bg.jpg\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A022SL00\",\"selfData\":{\"newsFrom\":\"极目新闻\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"只有高效做好统筹疫情防控和经济社会发展工作,坚持两手都要抓、都要硬,才能最大限度减少疫情对经济社会发展的影响,推动经济平稳健康发展。 只有疫情被有效控制住,经济发展和正常生活才能具备有利条件;疫情越早得到控制,经济发展受到的影响就越小。 货物进出口总额同比增长16.6%,比上月加快2.3个百分点;全国城镇调查失业率为5.4%,比上月下降0.1个百分点;规模以上工业增加值、服务业生产指数、进出口、社会消费品零售总额、固定资产投资同比均保持增长……国家统计局前不久公布的7月经济数据显示,随着高效统筹疫情防控和经济社会发展各项政策持续显效,国民经济延续恢复态势。这彰显了中国经济的韧性和活力,有力印证了我国疫情防控政策的科学性、有效性。 疫情防控是“国之大者”,经济建设是中心任务。习近平总书记强调:“全面落实疫情要防住、经济要稳住、发展要安全的要求是一个整体,要一体认识、一体落实、一体评估,巩固经济回升向好趋势,力争实现最好结果。”疫情防控和正常生产生活、经济社会发展不是非此即彼的“单选题”,而是相辅相成、辩证统一的关系。只有高效做好统筹疫情防控和经济社会发展工作,坚持两手都要抓、都要硬,才能最大限度减少疫情对经济社会发展的影响,推动经济平稳健康发展。 面对百年不遇的新冠肺炎疫情,有效的疫情防控是经济社会发展的基础。只有疫情被有效控制住,经济发展和正常生活才能具备有利条件;疫情越早得到控制,经济发展受到的影响就越小。今年以来,面对复杂严峻的国际环境和艰巨繁重的国内改革发展稳定任务,在以习近平同志为核心的党中央坚强领导下,我们高效做好统筹疫情防控和经济社会发展工作,疫情防控取得积极成效,经济社会发展取得新成绩。两年多的疫情防控实践充分证明,我国疫情防控效果是好的、效率是高的,有良好的成本效益比。如果搞“集体免疫”“躺平”之类的防控政策,疫情势必会对经济社会发展产生严重冲击,势必会造成更大的损失。 抗击疫情是个系统工程,需要同时考虑三个方面:一是控制疫情,二是保障老百姓正常生活,三是确保经济社会必要运行。可以说,坚持动态清零从来就不意味着放弃经济发展,恰恰相反,是要为经济发展创造良好条件。应该看到,7月份经济虽然延续恢复发展态势,但受多重因素影响,仍有小幅波动。推动经济持续恢复,保持经济运行在合理区间,仍然面临着不少风险和挑战。从国际看,全球疫情蔓延,产业链供应链不畅,地缘政治冲突外溢影响持续,世界经济下行风险加大;从国内看,经济目前处在恢复进程中,经济回升的基础还有待巩固。势要起而不可落。当前正处于经济回稳最吃劲的节点,我们必须以时不我待的紧迫感,高效统筹疫情防控和经济社会发展,巩固经济恢复发展基础。 统筹好疫情防控和经济社会发展,“精准”是道必答题。基于疫情防控形势变化、病毒变异特点以及疫情防控实战的经验总结,动态调整优化防控措施,提高疫情防控的科学性、精准性,是“最大限度减少疫情对经济社会发展的影响”的必然要求。《新型冠状病毒肺炎防控方案(第九版)》对入境人员、密切接触者以及中高风险区的管控周期进行了优化,正是坚持科学精准、动态清零的具体体现。但应看到,优化防控措施绝不是放松防控,决不能松懈厌战。近期,周边国家疫情快速反弹,我国外防输入压力持续增大,同时,奥密克戎BA.5亚分支已经成为全球主要流行株,与以往的变异株相比传播力明显增强。在这样的背景下,我们必须慎终如始,保持战略定力,抓实抓细疫情防控各项工作,坚决巩固来之不易的防控成果。 疫情尚未远去,大考仍在继续,发展不能停步。深刻认识抗疫斗争的复杂性和艰巨性,坚持人民至上、生命至上,坚持外防输入、内防反弹,坚持动态清零,该管的坚决管住,该保的坚决保住,一手抓战“疫”,一手抓发展,我们就一定能打赢疫情防控这场大仗硬仗,实现疫情防控和经济社会发展双胜利。 (来源:人民日报) \",\"title\":\"经济发展和疫情防控两手都要抓、都要硬\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/914ba7136c02f12896e6a4a95c179f5d/1661314275947.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://soft.imtt.qq.com/browser/smart_service/fm/news_background/news_bg.jpg\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A01LJX00\",\"selfData\":{\"newsFrom\":\"台海网\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"[新闻页-台海网] 中新社北京8月23日电? ? 欧洲议会7月将核能、天然气列为“永续分类标准”(即绿能清单),原主张“弃核”的德国今冬势必以核电填补能源缺口。上述发展让以欧洲尤其以德为师的民进党当局,近来在能源问题上陷入无法自圆其说的窘境。 效法西方“进步价值”的“非核”主张,是民进党在“台独”之外的另一张“神主牌”,历次选举中借其站上道德高地、击打竞争对手。不巧,面对今年底胶着的“九合一”选举之际,德、法、日、韩相继政策急转弯,或停止淘汰核能电厂,或重启闲置核反应炉乃至于新建核电厂,让“非核”主张反倒成为政治负资产。 这一背景下,民进党当局8月10日依然通过环评,让台湾电力公司核电二厂正式进入淘汰产能的“除役执行阶段”。当前台湾四座核电厂之中,核电一厂已启动除役,四厂则封存并将燃料棒运往美国,有关二厂的新举措无疑是朝向“非核”再迈一大步。 只是,台湾能源已暴露出大问题。今年3月3日全台大停电及此后不时出现的局部停电,冲击着民众生活、企业生产。制造业代表性团体台湾工业总会哀告,产业界亟需保持供电稳定性,盼当局不排除任何选项。另一重要财经团体“三三会”负责人林伯丰甚至建议,台湾应考虑使用新一代安全核电技术,提高核能发电至30%。台湾美国商会6月份发出年度白皮书,也强调越来越担心台湾的稳定供电问题。 能源问题已常态化、长期化,民进党当局终于决定7月1日起电价上调8.4%,以高压、超高压为主的产业用电大户调涨15%,理由是国际燃料价格上涨。但岛内专家陈立诚认为,症结点在于,台湾正以昂贵能源取代便宜能源。过去,台电六部核电机组正常运转,每年发电400亿度,每度电成本仅1元(新台币,下同);而今用以取代核电的风电、太阳能发电,平均成本是5元。 民进党当局舍得将“十年不涨电价”的选举支票一笔勾销,原因在于长年压低能源价格带来的高额债务。民意代表高金素梅引用今年初台“立法院”预算中心报告,累加台电2020年底负债总额(1.8万亿元)及此后两年负债增速,推估该公司负债或已跨过2.5万亿元。让岛内工商业焦虑的是,第二次、第三次涨价恐为期不远,生产成本将继续攀升。 能源危机就是产业危机。作为支撑当前台湾GDP增长的支柱,以半导体为代表的电子产业无疑是高耗能产业,低电价是其参与市场竞争的重要优势之一。民进党当局将电价上涨压力转移到这些用电大户身上,又无法解决尖峰时刻供电不稳问题,别说进一步扩大投资,未来如何留住相关产业链都要打个问号。 涨价、让市场发挥调节功能,不足以应对当前能源供应问题。此起彼伏的停电事故,暴露出台湾供电备载容量不足、各电厂产能濒于极限,一个小小错误都可能造成全面性问题。在可预见的将来,只能以火力发电填补绿电发展迟缓带来的空缺,而急剧恶化的空污问题及高碳排压力将酿成更多民怨及制造业出口面临课征重税的风险。 欧洲及日、韩核电政策转弯,给了民进党政客丢掉“非核”政策的机会之窗。但面对岛内舆论建言,当局经济事务主管部门下辖能源局回应称“供应无虞”。显然,问题进一步恶化之前,对于只问选举的民进党来说,“神主牌”不能丢。 讳疾忌医,小病也会酿成大灾。就算此刻民进党当局政策急转弯,据台清华大学工程与系统科学系特聘教授李敏评估,要让尚在运转的核电机组延后“除役”都需要一年半时间。被民进党“非核”意识形态套牢,在民生、经济被卷进更黑暗时刻之前,台湾的能源问题仍然无解。(来源:中新网 记者 刘舒凌) \",\"title\":\"欧洲转核能为绿能 民进党照旧抱紧“非核”意识形态?\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/8618821276b08ec4c5d4e0e05d480a33/1661315600368.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15192595587_150120/0,http://inews.gtimg.com/newsapp_ls/0/15192595581_150120/0,http://inews.gtimg.com/newsapp_ls/0/15192595588_150120/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A00JC800\",\"selfData\":{\"newsFrom\":\"秦安战略\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"【编者按】本文为作者本人授权,在秦安战略独家原创刊发,转载自公众号“或渊视点”,有很多精彩内容,欢迎大家关注。 乌克兰疯了!在刚袭击了克里米亚的俄罗斯空军基地,并且给俄军造成了相当的损失后,竟然把目光盯向了俄罗斯国内。 当地时间8月21日凌晨,俄罗斯莫斯科州发生了一起汽车爆炸事件。俄罗斯知名地缘政治家杜金的女儿杜金娜在爆炸中身亡。 俄罗斯联邦侦查委员会当日披露了案件细节,称杜金娜案是不明人士幕后策划的一种刺杀。初步调查显示有大约400克威力巨大的TNT炸药被事先安放在汽车内,随后通过遥控引爆。 爆炸发生后,汽车继续向前行驶,撞上了一栋大楼,杜金娜飞出车外,当场死亡。 在事情发生后第一时间,乌克兰总统办公室主任顾问波多利亚克表示,乌克兰与发生在俄罗斯莫斯科的汽车爆炸事件没有关系。 然而,当地时间22日,塔斯社援引俄罗斯联邦安全局消息,杜金娜案已破。 俄罗斯安全局指出,杀害杜金娜的犯罪行为是由乌克兰特勤部门策划和实施的。具体的执行者是一位43岁名叫娜塔莉亚.帕夫洛夫娜.沃夫克的乌克兰公民。 她于7月23日携带自己12岁的女儿从爱沙尼亚入境俄罗斯。在暗杀前为了收集有关杜金娜的生活规律信息,特别在杜金娜居住的大楼里租住了一套公寓。 然后用一辆宝马MINI Cooper对其进行跟踪。 21日她在用手机引爆了事先装置在杜金娜汽车上的炸弹后,开车经普斯科夫放州逃往爱沙尼亚,最后回到乌克兰。 那么,此次事件是否为乌克兰所为?而乌克兰又为何要制造这场明显可能彻底激怒俄罗斯的暗杀事件? 我们的观点是,该事件是乌克兰亲美分子与美国势力一起导演的一个旨在加剧俄乌矛盾及冲突烈度的一个精心策划的行动。 该事件与不久前乌克兰攻击克里米亚俄罗斯空军基地的目的一样,都是为了升级战争所进行的挑拨。 从美国的利益看,俄乌冲突持续的时间越长越好,冲突的强度越大越好。 而从近期俄乌冲突走势看,由于欧洲各国普遍受通胀影响,经济普遍下滑,使得以欧洲为主的西方主要国家对乌援助有减缓的趋势。这是不利于乌克兰继续坚持对抗俄罗斯的。 所以,需要一种额外的加码的刺激,以便让乌克兰继续成为世界的热点,热度持续维持。 完全不用怀疑,接下来俄罗斯方面一定会祭出强烈的报复措施!而需要思考的是普京会采取什么样的报复措施,以及这个报复会对俄乌战场会产生什么样的新局面? 也许有一种观点会认为,如果此事真的为美国操纵乌克兰极端势力所为,那么普京的报复不是正好落入美国升级俄乌战争的圈套了吗? 好像是,但事实又不是。 即使这是美国的所谓“圈套”那么俄罗斯也必然要做出强烈的报复! 就像当年美国明知日本炸了珍珠港是为了引美国进入二战乱局时也要对日宣战的道理是一样的。 乌克兰,不管是哪种势力对俄罗斯首都莫斯科发动的袭击事件都是非常具有象征意义的严重事件。 它表明乌克兰竟然可以打击俄罗斯的政治中心!而较乌克兰袭击克里米亚不同,俄罗斯是无论如何也不能容忍自己的首都都成为一个不安全的地方。 所以,我们的观点是俄罗斯的报复目标极可能会直接指向乌克兰首都基辅!大家可以观察。 而更可怕的是,在俄罗斯安全局的案情调查出炉后,普京却依然沉默! 但普京一定会出手的! 虽然,普京在当地时间21日宣布承认乌东地区的“顿涅茨克人民共和国“和”卢甘斯克人民共和国“为独立国家,并且签署了俄罗斯与两国的友好合作互助条约,但这并不会是此事件的终结。 最新消息是来自中国外交部及中国驻乌使馆的消息,要求近期中国公民不要赴往乌克兰。 这是一个非常清晰的信号,也意味着乌克兰近期将面临极大的风险。 从2月24日俄罗斯在乌克兰发动“特别军事行动”开始已经半年了,但这场局部战争在美国的强烈推动及欧洲各国如同芬兰总理如同热舞一样游乐心态的力挺下,不但没有结束的迹象,反而不断升级。 历史重演的概率是很大的,参考前两次世界大战的氛围看,这是一个很危险的信号! \",\"title\":\"国师之女惨遭暗杀,俄报复或直接打击基辅!中国公民勿前往乌克兰\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/a1db432d3738ea0c59cac92293569c0c/1661310086641.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://soft.imtt.qq.com/browser/smart_service/fm/news_background/news_bg.jpg\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A01FCN00\",\"selfData\":{\"newsFrom\":\"金台资讯\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"本报上海8月23日电 (记者刘士安、巨云鹏)8月中旬,2022年度长三角G60科创走廊科技成果拍卖会现场成交3.27亿元,新一轮科技成果累计成交额超过50亿元,远高于上一年度的10.23亿元。科创要素的加速集聚,折射出长三角一体化高质量发展的坚实步伐。 2020年8月,习近平总书记在扎实推进长三角一体化发展座谈会上强调,要深刻认识长三角区域在国家经济社会发展中的地位和作用,结合长三角一体化发展面临的新形势新要求,坚持目标导向、问题导向相统一,紧扣一体化和高质量两个关键词抓好重点工作,真抓实干、埋头苦干,推动长三角一体化发展不断取得成效。 从138个政务服务事项在长三角地区41座城市跨省市通办,到合作共建长三角国家技术创新中心,再到长三角生态绿色一体化发展示范区38项制度创新成果向长三角和全国其他有条件的重点地区复制推广……沪苏浙皖三省一市深入贯彻落实习近平总书记重要讲话精神,紧扣一体化和高质量两个关键词,紧密携手、各展所长、协同发力,发展动能更加强劲,进展成效更加凸显。 推进科技高水平自立自强。三省一市深入实施创新驱动发展战略,共同强化战略科技力量,优化重大科技基础设施布局,搭建科技创新合作平台,加快科技资源开放共享。位于上海张江高科技园区的长三角国家技术创新中心,由沪苏浙皖合作共建,旨在打造长三角“产学研用”深度融合创新枢纽和国家技术创新体系战略节点,以高水平的技术供给支撑区域高质量发展。2021年,长三角地区获评国家科学技术奖137项,在全国占比超过50%;获得发明专利18.2万件,在全国占比约26%;国家重点实验室数量达104家,在全国占比约20%。“长三角地区以一体化的思路和举措,有力推动了创新要素在更大范围畅通流动。”长三角国家技术创新中心主任刘庆说。 打造世界级产业集群。围绕集成电路、生物医药、人工智能等战略性新兴产业和先进制造业,长三角地区着力打造优势产业集群,不断提升在全球价值链中的地位。目前,长三角地区集成电路产业规模占全国58.3%,生物医药和人工智能产业规模均占全国约1/3。去年,长三角地区集成电路、生物医药、新能源汽车、人工智能四大产业链联盟揭牌。沪苏浙皖完善产业链供应链跨区域协调机制,加快推进产业链补链固链强链行动,联合开展机器人、新型电力装备、节能与新能源汽车等产业链研究。 构筑改革开放新高地。长三角地区持续深化开放合作,优化区域营商环境,不断增强国际竞争合作新优势。去年5月,长三角自由贸易试验区联盟成立,积极推动三省一市自由贸易试验区深度合作。2021年,沪苏浙皖自由贸易试验区货物进出口总额达3.1万亿元,占全国自由贸易试验区的46.2%;实际使用外资共计1042.6亿元,占全国自由贸易试验区的48.9%。虹桥国际开放枢纽促进长三角深化改革、协同开放,以占长三角不到2%的区域面积,贡献了近10%的经济总量。 着力高效统筹疫情防控和经济社会发展,长三角三省一市为稳定全国经济大盘作出积极贡献。统计数据显示,2021年,长三角地区生产总值占全国比重达24.1%,研发经费投入占比29.8%,进出口总额占比36.1%,固定资产投资同比增速高于全国平均增速3.2个百分点。 “以更高质量的一体化助力现代化建设的新实践,以一体化发展的确定性应对外部环境的不确定性,奋力谱写长三角一体化发展新篇章”,日前在上海举行的2022年度长三角地区主要领导座谈会指出,要拿出更加有力的措施,展开更加务实的行动,坚定不移将长三角一体化发展引向深入。 《 人民日报 》( 2022年08月24日 01 版) \",\"title\":\"长三角扎实推进一体化高质量发展\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/5cba312900646da48db42c253e4dc3ad/1661310157065.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"https://inews.gtimg.com/newsapp_ls/0/15192771103_196130/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A019LL00\",\"selfData\":{\"newsFrom\":\"海峡导报社\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"民进党当局检廉单位在今年1月13日大动作搜索宜兰县长官邸等处所后,历经7个多月,宜兰地检署昨(23)日侦结起诉县长林姿妙等15人。检方声称林姿妙所涉犯4案,其中2案是违反“贪污治罪条例”,要法院将林姿妙母女从重量刑。林姿妙23日也正面回击,强调对方掌握选举节奏,赶在选举登记前起诉她,很明显是政治追杀。她一生清清白白,没有做对不起县民的事情,选民会用选票还她公道。国民党县议员也抨击,蔡英文才来宜兰下达“军令”要在年底拿回宜兰,检廉单位就有动作,时间点太巧合。 台当局选务机构将在下周一(8月29日)至下周五(9月2日),受理县市长候选人登记。林姿妙已获国民党提名参选宜兰县长、争取连任,她说,预计在9月1日上午9时登记参选县长,为公平正义、为宜兰而战。 而民进党当局检廉单位拟声称,林姿妙所犯有伪造文书、洗钱,及“贪污治罪条例”的违背职务行为收取不正利益罪、财产来源不明等罪嫌,是遭起诉的15人中,所犯最多者。此次15位被告中,有10位是公务员,当中康立和、卢天龙、黄志良、吴朝琴四人为宜兰县政府局处长。另有5名非公务员,包括林姿妙的女儿林羿伶。 林姿妙表示,很早就断定,对手一定会用起诉作手段影响选举,目的非常明显就是政治追杀。两天前看到民调显示自己赢对手,她心里也很清楚,很快就要被起诉了。这完全说明,对手用行政机器打击,完全没有公平正义。 她说,自己在登记前被起诉,一点不感到意外,只是很心痛很委屈,对手用肮脏污蔑手段,无所不用其极达到胜选目的,这不是“民主社会”该发生事情。她也很遗憾地检署再也不是公正客观的机构,已沦为政治打手,即便未来证明是清白的,选举已结束,迟来的正义有用吗? 国民党县议员黄琤婷说,蔡英文上周来宜兰,检廉单位随即就有动作,相信这一切都看在民众眼里。县议员林岳贤与庄淑如也指出,县民不是傻子,愈是抨击、县长会愈坚强,相信选民的眼睛是雪亮,会用选票力挺县长。 国民党声明表示,林姿妙长期深耕宜兰,政绩卓着,为县民称许,司法绝不能有颜色,更不能成为政治的打手。国民党尊重司法程序,但也吁司法勿成民进党的选举工具,盼检调机关与法院务必秉公执法,给林姿妙及县政府团队公平、公正机会证明清白。 国民党也质疑,此案首波侦查开始已有特定媒体指导办案方向,更有特定人取得比当事人更完整重点口供与资料,让特定媒体捕风捉影,甚至在官邸遭搜索时还有特定媒体记者到现场录影拍照,都让人质疑有“政治追杀”企图。昔日大动作搜索与马拉松式约谈,更有违“比例原则”和“法治原则”。 台湾“中时新闻网”报道,国民党宜兰县长林姿妙在选举登记领表前夕被检方起诉,由于林姿妙亲和力佳,在基层中颇具声望,目前仍领先对手民进党参选人江聪渊。但随着起诉的冲击发酵,势必拉近林、江二人差距,中间选民的动向,将是左右年底选战的关键。 据报道,今年1月检廉搜索林姿妙等官员之前,林姿妙与江聪渊民调支持度差距相当大,绿营当时士气低迷,党内人士坦言“很难选”。但林姿妙接连两次遭到搜索、四次应讯,二人差距不断拉近,也让江聪渊阵营看到翻转的契机。 林姿妙在获得交保后,依旧勤于经营基层,加上国民党宜兰县议会党团猛打江聪渊“盗采砂石案”助攻,蓝军选情渐渐回稳。江聪渊一直难以拉近与林姿妙的民调差距,对民进党而言,宜兰县依旧是“艰困选区”。 检方在年底选前侦结,原本就在蓝绿预料之内,但起诉书中重批林姿妙母女“紊乱县府行政体制”、“操弄县府官员于股掌之间”及请求“从重量刑”,句句无一不是绿营制作文宣的绝佳材料。 外界认为,检方的起诉虽可能伤及林姿妙的选情,但因距投票日还有3个月时间,目前仍难断定对选情影响范围有多大。此外,“司法不公”、“选择性办案”也可能凝聚蓝军的向心力。更何况,当初迫于侦查不公开而无法对外说明的林姿妙,在遭起诉后是否会破釜沉舟提出证据释疑,也成为另个变数。 台媒认为,绿营穷尽洪荒之力,盼借由此案出现关键的破口,以收复党内视之为“民主圣地”的宜兰县。但对宜兰县民来说,未来县政的规划与方向,毋宁较蓝绿互揭疮疤来得更为重要,起诉是否成为震撼弹仍有待观察。(林静娴/编辑) \",\"title\":\"宜兰县长林姿妙控遭政治追杀,台媒:中间选民动向成年底选战关键\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/2cfa65a64e9063a7213618dfba0abe38/1661308343591.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15190763285_240180/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220823A044QP00\",\"selfData\":{\"newsFrom\":\"泛史寘\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"最近欧洲天然气价格创出历史新高,其实,不仅仅是能源紧张,欧美圣诞节都有点悬了,如何过好今年的圣诞节,已经成了欧美眼下最紧要的事,要尽快疏通物流,及时进口商品,保证过好今年的圣诞节,感恩节更要保障购物需求。 除了海运,美国没有别的物流通道,但是欧洲就不一样了,欧洲除了海运之外,现在有了中欧班列,可以从欧亚大陆直接接收中国的货物,相当一部分原来的海运货物现在走中欧班列,这样欧洲实际上开辟了中欧贸易新的物流大通道。 据中国发改委的消息,截止今年7月31日,中欧班列累计开行超过5.7万列,运送530万标准箱,这是什么概念呢?大致相当于海运的一半,也就是说,现在中欧贸易正在向陆地运输转型,海运价格飙升之际,正是中欧班列快速增长之时,这虽然不是说废除海运,但显然两条腿走路要比单纯的海运更好,增加了中欧班列这条陆地大通道,欧洲能够更多地接收中国货物。 短短几年的时间,中欧班列从开始到现在,已经成了重要的物流大通道,当年谁也不会想到,中欧班列会成为解决货物短缺的一条大动脉,当年很多人不看好中欧班列,认为这只不过是画蛇添足,有中欧海运通道,中欧班列最多不过是一个补充,但没想到现在来看,中欧班列成了大动脉,而且有望成为一条世界性的大动脉,塑造和改变世界贸易的版图,最重要的是能够及时解决货物短缺,保证欧洲获得及时供应。 纵观全球,也只有欧亚大陆有条件开通中欧班列这样一条大动脉,其他各大洲都没有这样的条件,中欧班列抓住了历史性机遇,获得了历史性成功,深刻地改变了世界贸易的版图,也带动了沿途各国经济发展,最终中欧班列会带动沿途经济活动,激活整个欧亚大陆的经济活力,成为世界贸易大动脉,被写进历史,这个前景现在来看是十分清晰的,这才几年的时间,中欧班列就如此重要,可见当年的决策是多么地有战略眼光。 未来中欧班列还会增加运输路线,一个是在沿途开辟新的路线,辐射带动沿途各国各地经济活动,再就是向中亚中东延伸,甚至经过中东直抵非洲,这些前景都是十分清晰的,最关键的是中欧班列的活力,激发了欧亚大陆经济活动,推动了世界贸易蓬勃发展,延伸至非洲的话,就会激发欧亚非大陆的活力,世界经济贸易的版图就会发生深刻变革,传统的欧美主导的世界贸易格局就会被改写。 中欧班列无疑是人类文明史上的一次伟大创新,足以改变人类文明的发展结构,从当下来看,就是能够有效地促进中欧贸易发展,改变全球运输结构,弥补海运的不足和紧张,并且能够越来越深入地激发沿途各国各地的经济活力,推动世界经济持续稳健发展,这既是中国对世界经济做出的巨大贡献,更是中国的伟大改革和创新。 \",\"title\":\"别不相信,中欧班列改变世界格局!\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/868df043e007d1ce7711ddb350047225/1661306566999.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15192702502_196130/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A00YX000\",\"selfData\":{\"newsFrom\":\"法治日报\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"党的十八大以来,改革不停顿,开放不止步。 中国的扩大开放进行得有条不紊、有声有色,形成全方位、多层次、宽领域的全面开放新格局。 这十年,负面清单越来越短,2021年版外资准入负面清单连续第五年缩减,全国和自贸试验区负面清单进一步缩减至31条、27条。更高水平的开放吸引了更多国际投资者“用脚投票”,2021年中国实际使用外资金额超过1.1万亿元,引资规模再创历史新高。 这十年,进口商品越来越多,进博会、服贸会、广交会、消博会等国际经贸盛会成为我国开放的最佳示范窗口,中国不仅是“世界工厂”,也是“世界市场”。 这十年,“朋友圈”越来越大,截至2022年7月底,中国已与149个国家、32个国际组织签署200多份共建“一带一路”合作文件。“中老铁路”建成通车,“雅万高铁”等一大批项目扎实推进。我国加入区域全面经济伙伴关系协定(RCEP),与26个国家和地区签署了19个自贸协定,自贸伙伴覆盖亚洲、大洋洲、拉丁美洲、欧洲和非洲。 这十年,贸易和投资自由化便利化程度不断提升,我国境外投资存量从不足6000亿美元增至超过2.6万亿美元,我国积极参与全球经济治理,为构建人类命运共同体贡献中国智慧和中国力量。 “一带一路”带来越来越庞大的“朋友圈” 共建“一带一路”已成为当今世界广受欢迎的国际公共产品和国际合作平台。7月29日商务部举行的“2022年上半年商务工作及运行情况”专题新闻发布会上,商务部相关负责人介绍,“一带一路”重大倡议提出9年来,中国与相关国家一起坚持共商共建共享原则,深化互利共赢合作,取得了实打实、沉甸甸的建设成就。 商务部相关负责人表示,中国持续巩固合作基本盘,深入挖掘与共建国家的贸易潜力,鼓励优质商品进口,加快发展跨境电商、海外仓等外贸新业态。同时优化对外投资合作,吸引共建国家来华投资。今年上半年,我国与“一带一路”沿线国家货物贸易额达6.3万亿元,同比增长17.8%,占比提高到31.9%。对沿线国家非金融类直接投资达650.3亿元,增长4.9%,占比提高到18.5%。同期,沿线国家对华实际投资达452.5亿元,增长10.6%。 同时,中国积极对接共建国家的发展需求,推动绿色、数字等领域合作,积极支持清洁能源、生态保护、信息通信、新型基础设施等领域项目合作。深入发展“丝路电商”,推动与更多国家建立电子商务合作机制,帮助共建国家拓展贸易新渠道。 2013年9月和10月中国向世界分别提出建设“新丝绸之路经济带”和“21世纪海上丝绸之路”的合作倡议,由此拉开“一带一路”序幕。依靠中国与有关国家既有的双多边机制,借助既有的、行之有效的区域合作平台,“一带一路”借用古代丝绸之路的历史符号,高举和平发展的旗帜,积极发展与沿线国家的经济合作伙伴关系,共同打造政治互信、经济融合、文化包容的利益共同体、命运共同体和责任共同体。 2015年3月28日,国家发展改革委、外交部、商务部联合发布了《推动共建丝绸之路经济带和21世纪海上丝绸之路的愿景与行动》,进一步落实和细化了“一带一路”倡议的共建原则、框架思路、合作重点、合作机制等内容。 据商务部披露的数据显示,2015年中国企业共对“一带一路”相关的49个国家进行了直接投资,投资额同比增长18.2%。2015年中国承接“一带一路”相关国家服务外包合同金额178.3亿美元,执行金额121.5亿美元,同比分别增长42.6%和23.45%。2016年6月底,中欧班列累计开行1881列,其中回程502列,实现进出口贸易总额170亿美元。截至今年7月底,中国已与149个国家、32个国际组织签署200多份共建“一带一路”合作文件。 27项措施提升跨境贸易便利化 世界银行发布的2020年全球营商环境报告指出,中国的营商环境大幅提升优化,全球排名从2013年的第96位跃升至最新的第31位。这样的成就离不开我国近年来坚持推行的跨境贸易便利化改革的各项措施。 这其中首推国际贸易“单一窗口”建设带来的作用。作为国家为广大进出口企业搭建的公共信息平台,国际贸易“单一窗口”自2016年建设以来,已对接了口岸和外贸领域25个部委系统,提供739项对外贸易服务,累计注册用户已经达443万余家,日申报业务量达1200万票。它的主要功能是“三大”,即大通关、大物流、大外贸;它的主要特点是“三跨”,即跨地区、跨行业、跨部门。企业足不出户,就可向海关、外汇、税务等部门一次性提交相关申请资料,“一窗通办”相关部门业务。这实现了口岸各部门间的信息共享和业务协同,进出口环节38种监管证件全部通过“单一窗口”实现联网核查、无纸通关。 上述一系列“硬招实招”的出台,让我国口岸营商环境持续优化,跨境贸易便利化水平逐年提升,在世界银行跨境贸易指标全球排名从2017年的第97位,提高到了2019年的第56位。 中国的进步不止于此。今年7月29日,国新办举行国务院政策例行吹风会,海关总署党委委员、国家口岸管理办公室主任黄冠胜表示,海关总署会同发改委、财政部、交通运输部、商务部、卫健委、人民银行等相关部门,通过深入研究和措施细化,推出5个方面27项具体内容,进一步优化通关全链条全流程,打造更加科学高效的外贸货物通关模式。具体内容包括:支持海外仓建设,完善跨境电商出口退货政策;进一步降低进出口环节费用,巩固清理规范口岸收费成果,不断提高口岸收费的规范化、透明化水平,修订《港口收费计费办法》,加大督查检查力度,依法依规查处口岸经营活动中的涉嫌垄断行为。优化完善“经过认证的经营者”(AEO)制度,为认证企业提供更多便利化措施和渠道。 黄冠胜介绍,接下来我国还要推进口岸建设智慧转型,推动集装箱设备交接单、装箱单、提货单等口岸物流单证无纸化建设,加强自动化码头建设,推广智能卡口、无人集卡等新技术,扩大智能审图应用,提升口岸基础设施和监管智能化水平。 外商投资准入负面清单由93项降至31项 党的十八大以来,我国积极推动对外开放,积极推动制度性开放体系建设。 2013年9月29日,“中国(上海)自由贸易试验区”在上海浦东外高桥挂牌成立。与此相伴随的是,中国第一份外商投资负面清单落地,全面深化改革的“种子”在国家试验田的沃土中生根发芽茁壮成长。经过7次压减,清单条目由最初的190项减少到2021年的27项,压缩比例超过85%,开放领域涉及第一、二、三等各个产业,制造业条目清零,服务业持续扩大开放,市场准入全面放宽,带动全国对外开放度不断提高。 一张不断缩短的清单,见证的是中国越开越大的开放之门。 2016年,自贸试验区负面清单制度推广到全国,在全国实现外商投资准入负面清单管理模式,限制措施也由最初的93项锐减到现在的31项。2020年,我国实施新的外商投资法,开启了一个新的外商投资管理体制。2021年,我国在海南推出了第一张跨境服务贸易负面清单。 21个自贸试验区占全国国土面积不到千分之四,但是其贡献的进出口额却占到全国的17.3%,吸收外资占到全国的18.5%。2018年,海南自由贸易港建设启动,迄今已经推出了120多项制度创新成果。 而自由贸易区提升战略也实现了新的突破。我国对外签署的自贸协定数在过去十年由10个增长到19个,增长了近1倍。同时,我国和自贸伙伴的贸易额占全国全部贸易额的比重由17%增长到2021年的35%。 此外,我国对外开放的广度和深度亦得到全面拓展。根据商务部对外披露数据显示,我国商品出口占国际市场份额由11%上升到15%,货物贸易第一大国的地位得到了进一步增强。2012年,我国货物+服务贸易总额达4.4万亿美元,在全球位居第二位。到2021年,我国货物+服务贸易总额增长到6.9万亿美元,连续两年全球第一。另外,我国双向投资也稳居世界前列,2021年我国吸引外资达到1.15万亿元,比2012年增长62.9%。从2017年以来,中国吸引外资连续四年位居世界第二,对外投资流量稳居全球前三位。 法律制度建设体现高水平对外开放时代特征 中央财经大学法学院教授高秦伟分析指出,自贸区的实践证明,破除体制机制的障碍,有利于促进特色优势产业的发展和相关市场主体的集聚,提升产业链供应链国际化水平,牢牢把握高质量发展的内涵和要求,破除阻碍国内国际各类创新资源和关键要素聚集的体制机制障碍,优势产业集群不断培育壮大,带动产业集群发展。 记者了解到,自贸区持续不断扩大开放和制度创新,也进一步激发了市场活力,增强了高质量发展动能。金融开放创新有效服务实体经济,向全国推广了外商投资企业外汇资本金意愿结汇、跨境双向人民币资金池业务等举措,推动企业融资更加便利、渠道更宽、成本更低,有力支持实体经济发展。深入推进政府职能转变,各省区市累计向自贸试验区下放5000多项省级管理权限,推进“多证合一”等商事制度改革试点,减少审批事项,大幅降低企业生产经营成本。 此外,我国外商投资法律体系也进一步完善。外商投资法正式实施,以对外开放为主基调,确定了外商投资促进、保护、管理的基本制度,为外商投资权益提供了更全面、更有力的法治保障,体现了高水平对外开放的时代特征。发改委连续3年清理与外商投资法不符的法规、规章和规范性文件,累计推动500多份文件“立改废”,充分保障了外资企业公平竞争待遇。 同时我国参与全球经济治理也作出了新的贡献。2014年,我国推动了21个成员达成《亚太经合组织推动实现亚太自贸区北京路线图》,为亚太地区建设高水平自贸区描绘了蓝图。 高秦伟认为,上述种种措施制度的实施使得我国外商投资环境明显改善。作为全球最大、增长最快的市场之一,我国拥有完善的产业配套体系、丰富的人力资源、良好的创新环境和无可比拟的内需潜力,全球外资企业始终看好中国经济发展前景,愿意扎根深耕中国市场、与中国经济共成长。 作者|法治日报全媒体记者?万静 来源|法治日报 编辑|宋胜男?刘丹 丁兆汝 \",\"title\":\"奋进新征程 建功新时代·非凡十年|在全面开放中实现经济社会高质量发展——“十年答卷”系列专题报道之四\"},{\"audio\":{\"stream\":{\"url\":\"https://dingdangcdn.qq.com/20220824/c6219bc6726ed2554d16ca938d95a74c/1661306648161.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://inews.gtimg.com/newsapp_ls/0/15192682994_196130/0\",\"widthPixels\":0}]},\"mediaId\":\"4_20220824A00WGG00\",\"selfData\":{\"newsFrom\":\"大河财立方\",\"type\":\"时政 热门\"},\"subTitle\":\"\",\"textContent\":\"河南日报记者 刘勰 河南日报社全媒体记者 崔文 8月23日,记者从省委巡视办了解到,十一届省委第二轮巡视13个巡视组完成对部分省辖市及所辖县(市、区)、相关省直单位的巡视进驻。 据悉,本轮巡视时间两个月左右,巡视期间设置专门值班电话和专用邮政信箱等,主要受理反映被巡视党组织领导班子及其成员、下一级党组织领导班子主要负责人和重要岗位领导干部问题的来信来电来访。巡视期间,省委巡视组将严格落实中央八项规定及其实施细则精神和省委相关规定,主动接受被巡视对象和社会各界的监督,省纪委监委监督举报电话12388,省委组织部监督举报电话12380。 附十一届省委第二轮巡视进驻一览表 责编:陶纪燕 | 审核:李震 | 总监:万军伟 (来源:河南日报) \",\"title\":\"十一届省委第二轮巡视完成进驻\"}],\"templateInfo\":{\"base_type\":\"audio\"}}},\"response_text\":\"以下是最新的热点新闻,内容来自腾讯新闻音频产品:海豚智音。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:13:35","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"news\",\"intent\":\"search\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835378435002368\"}},\"response_text\":\"以下是最新的热点新闻,内容来自腾讯新闻音频产品:海豚智音。\",\"listItems\":[{\"url\":\"https://dingdangcdn.qq.com/20220824/309fc3cd0255969a44c524fdd1dfc4e2/1661320903175.mp3\",\"newsFrom\":\"豫商览天下\",\"type\":\"时政 热门\",\"resultTitle\":\"知道怕了?中方反制奏效,立陶宛急了:要求取消制裁恢复合作\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/2aff7e209fdd2c68e537f4e811c70ace/1661317930639.mp3\",\"newsFrom\":\"界面新闻\",\"type\":\"时政 热门\",\"resultTitle\":\"中国常驻联合国代表团发表声明强烈谴责个别国家在台湾问题上干涉中国内政\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/ff510cf01a913300fba29b1313369331/1661316152684.mp3\",\"newsFrom\":\"极目新闻\",\"type\":\"时政 热门\",\"resultTitle\":\"经济发展和疫情防控两手都要抓、都要硬\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/914ba7136c02f12896e6a4a95c179f5d/1661314275947.mp3\",\"newsFrom\":\"台海网\",\"type\":\"时政 热门\",\"resultTitle\":\"欧洲转核能为绿能 民进党照旧抱紧“非核”意识形态?\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/8618821276b08ec4c5d4e0e05d480a33/1661315600368.mp3\",\"newsFrom\":\"秦安战略\",\"type\":\"时政 热门\",\"resultTitle\":\"国师之女惨遭暗杀,俄报复或直接打击基辅!中国公民勿前往乌克兰\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/a1db432d3738ea0c59cac92293569c0c/1661310086641.mp3\",\"newsFrom\":\"金台资讯\",\"type\":\"时政 热门\",\"resultTitle\":\"长三角扎实推进一体化高质量发展\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/5cba312900646da48db42c253e4dc3ad/1661310157065.mp3\",\"newsFrom\":\"海峡导报社\",\"type\":\"时政 热门\",\"resultTitle\":\"宜兰县长林姿妙控遭政治追杀,台媒:中间选民动向成年底选战关键\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/2cfa65a64e9063a7213618dfba0abe38/1661308343591.mp3\",\"newsFrom\":\"泛史寘\",\"type\":\"时政 热门\",\"resultTitle\":\"别不相信,中欧班列改变世界格局!\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/868df043e007d1ce7711ddb350047225/1661306566999.mp3\",\"newsFrom\":\"法治日报\",\"type\":\"时政 热门\",\"resultTitle\":\"奋进新征程 建功新时代·非凡十年|在全面开放中实现经济社会高质量发展——“十年答卷”系列专题报道之四\"},{\"url\":\"https://dingdangcdn.qq.com/20220824/c6219bc6726ed2554d16ca938d95a74c/1661306648161.mp3\",\"newsFrom\":\"大河财立方\",\"type\":\"时政 热门\",\"resultTitle\":\"十一届省委第二轮巡视完成进驻\"}]}"}}} +{"level":"info","time":"2022-08-24 14:13:35","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"news\\\",\\\"intent\\\":\\\"search\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835378435002368\\\"}},\\\"response_text\\\":\\\"以下是最新的热点新闻,内容来自腾讯新闻音频产品:海豚智音。\\\",\\\"asr_recongize\\\":\\\"来点新闻\\\",\\\"listItems\\\":[{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/309fc3cd0255969a44c524fdd1dfc4e2/1661320903175.mp3\\\",\\\"newsFrom\\\":\\\"豫商览天下\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"知道怕了?中方反制奏效,立陶宛急了:要求取消制裁恢复合作\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/2aff7e209fdd2c68e537f4e811c70ace/1661317930639.mp3\\\",\\\"newsFrom\\\":\\\"界面新闻\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"中国常驻联合国代表团发表声明强烈谴责个别国家在台湾问题上干涉中国内政\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/ff510cf01a913300fba29b1313369331/1661316152684.mp3\\\",\\\"newsFrom\\\":\\\"极目新闻\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"经济发展和疫情防控两手都要抓、都要硬\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/914ba7136c02f12896e6a4a95c179f5d/1661314275947.mp3\\\",\\\"newsFrom\\\":\\\"台海网\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"欧洲转核能为绿能 民进党照旧抱紧“非核”意识形态?\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/8618821276b08ec4c5d4e0e05d480a33/1661315600368.mp3\\\",\\\"newsFrom\\\":\\\"秦安战略\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"国师之女惨遭暗杀,俄报复或直接打击基辅!中国公民勿前往乌克兰\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/a1db432d3738ea0c59cac92293569c0c/1661310086641.mp3\\\",\\\"newsFrom\\\":\\\"金台资讯\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"长三角扎实推进一体化高质量发展\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/5cba312900646da48db42c253e4dc3ad/1661310157065.mp3\\\",\\\"newsFrom\\\":\\\"海峡导报社\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"宜兰县长林姿妙控遭政治追杀,台媒:中间选民动向成年底选战关键\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/2cfa65a64e9063a7213618dfba0abe38/1661308343591.mp3\\\",\\\"newsFrom\\\":\\\"泛史寘\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"别不相信,中欧班列改变世界格局!\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/868df043e007d1ce7711ddb350047225/1661306566999.mp3\\\",\\\"newsFrom\\\":\\\"法治日报\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"奋进新征程 建功新时代·非凡十年|在全面开放中实现经济社会高质量发展——“十年答卷”系列专题报道之四\\\"},{\\\"url\\\":\\\"https://dingdangcdn.qq.com/20220824/c6219bc6726ed2554d16ca938d95a74c/1661306648161.mp3\\\",\\\"newsFrom\\\":\\\"大河财立方\\\",\\\"type\\\":\\\"时政 热门\\\",\\\"resultTitle\\\":\\\"十一届省委第二轮巡视完成进驻\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:18:20","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"设置一个二十点的闹钟\",\"ip\":\"121.35.103.189\",\"originQuery\":\"设置一个二十点的闹钟\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:18:20","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:18:20","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:18:20","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"设置一个二十点的闹钟\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:18:20","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"new\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"time\",\"value\":\" 20:00:00\"}]}},\"payload\":{\"data\":{\"json\":{\"stCalendarData\":{\"mVecAlarm\":[{\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sName\":\"乐器伴奏(默认)\",\"sUrlId\":\"resource.search$10011\"}],\"sSpeakTips\":\"已经为你设置了今天晚上8点整的闹钟。\",\"stBroadData\":{\"mBroadData\":{\"1661342400\":\"time##的闹钟时间到了\",\"1661385600\":\"time##的闹钟时间到了\"},\"mGatherBroadData\":{\"1661342400\":{\"eAISpeechType\":0,\"eAIVoiceTTSEngineType\":6,\"iCount\":0,\"sBroadInfo\":\"time##的闹钟时间到了\",\"sBroadNote\":\"\",\"sCustomBroadData\":\"\",\"vNote\":[],\"vSoundRing\":[]},\"1661385600\":{\"eAISpeechType\":0,\"eAIVoiceTTSEngineType\":6,\"iCount\":0,\"sBroadInfo\":\"time##的闹钟时间到了\",\"sBroadNote\":\"\",\"sCustomBroadData\":\"\",\"vNote\":[],\"vSoundRing\":[]}}},\"stMoreInfo\":{\"mRingType\":{\"1660204541725\":\"global_ring\",\"1661321900677\":\"global_ring\"}},\"stSemanticSlotPara\":{\"sRingContent\":\"\",\"sRingType\":\"\",\"stAlarmCell\":{\"eRepeatType\":0,\"lId\":0,\"lStart\":0,\"lUpdate\":0,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[]},\"stSelfRingCell\":{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"\",\"sBackgroundImageUrl\":\"\",\"sId\":\"\",\"sName\":\"\",\"sType\":\"\"}},\"vAffectAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vSelfRingCell\":[{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sId\":\"resource.search$10011\",\"sName\":\"乐器伴奏(默认)\",\"sType\":\"白噪音\"}],\"vStrUrlId\":[\"resource.search$10011\"]}],\"vAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]},{\"eRepeatType\":5,\"lId\":1660204541725,\"lStart\":1661385600,\"lUpdate\":1660207713111,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]}],\"vUIAlarmCell\":[]},\"stGetAllSelfRing\":{\"vSelfRingCell\":{}}}},\"response_text\":\"已经为你设置了今天晚上8点整的闹钟。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661321900498746_lzQiUXNA9GeX9"}} +{"level":"debug","time":"2022-08-24 14:18:20","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"new\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"time\",\"value\":\" 20:00:00\"}]}},\"payload\":{\"data\":{\"json\":{\"stCalendarData\":{\"mVecAlarm\":[{\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sName\":\"乐器伴奏(默认)\",\"sUrlId\":\"resource.search$10011\"}],\"sSpeakTips\":\"已经为你设置了今天晚上8点整的闹钟。\",\"stBroadData\":{\"mBroadData\":{\"1661342400\":\"time##的闹钟时间到了\",\"1661385600\":\"time##的闹钟时间到了\"},\"mGatherBroadData\":{\"1661342400\":{\"eAISpeechType\":0,\"eAIVoiceTTSEngineType\":6,\"iCount\":0,\"sBroadInfo\":\"time##的闹钟时间到了\",\"sBroadNote\":\"\",\"sCustomBroadData\":\"\",\"vNote\":[],\"vSoundRing\":[]},\"1661385600\":{\"eAISpeechType\":0,\"eAIVoiceTTSEngineType\":6,\"iCount\":0,\"sBroadInfo\":\"time##的闹钟时间到了\",\"sBroadNote\":\"\",\"sCustomBroadData\":\"\",\"vNote\":[],\"vSoundRing\":[]}}},\"stMoreInfo\":{\"mRingType\":{\"1660204541725\":\"global_ring\",\"1661321900677\":\"global_ring\"}},\"stSemanticSlotPara\":{\"sRingContent\":\"\",\"sRingType\":\"\",\"stAlarmCell\":{\"eRepeatType\":0,\"lId\":0,\"lStart\":0,\"lUpdate\":0,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[]},\"stSelfRingCell\":{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"\",\"sBackgroundImageUrl\":\"\",\"sId\":\"\",\"sName\":\"\",\"sType\":\"\"}},\"vAffectAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vSelfRingCell\":[{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sId\":\"resource.search$10011\",\"sName\":\"乐器伴奏(默认)\",\"sType\":\"白噪音\"}],\"vStrUrlId\":[\"resource.search$10011\"]}],\"vAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]},{\"eRepeatType\":5,\"lId\":1660204541725,\"lStart\":1661385600,\"lUpdate\":1660207713111,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]}],\"vUIAlarmCell\":[]},\"stGetAllSelfRing\":{\"vSelfRingCell\":{}}}},\"response_text\":\"已经为你设置了今天晚上8点整的闹钟。\",\"ret\":0}}\n"}}} +[debug] formatTime Location: Local +[debug] formatTime: 2022-08-24 20:00:00 +0800 CST +[debug] alarmDBData.E_time: 20:00:00 +{"level":"debug","time":"2022-08-24 14:18:20","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"new\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"time\",\"value\":\" 20:00:00\"}]}}, \"response_text\":\"已经为你设置了今天晚上8点整的闹钟。\", \"listItems\":[{\"id\":\"1661321900677\",\"speechType\":0,\"type\":0,\"url\":\"\",\"note\":\"\", \"repeatType\":1, \"start\":1661342400, \"content\":\"\"},{\"id\":\"1660204541725\",\"speechType\":0,\"type\":0,\"url\":\"\", \"note\":\"\", \"repeatType\":5, \"start\":1661385600, \"content\":\"\"}]}"}}} +{"level":"info","time":"2022-08-24 14:18:20","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"alarm\\\",\\\"intent\\\":\\\"new\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"1011220547834613760\\\",\\\"slots\\\":[{\\\"name\\\":\\\"time\\\",\\\"value\\\":\\\" 20:00:00\\\"}]}},\\\"response_text\\\":\\\"已经为你设置了今天晚上8点整的闹钟。\\\",\\\"asr_recongize\\\":\\\"设置一个二十点的闹钟\\\",\\\"listItems\\\":[{\\\"id\\\":\\\"1661321900677\\\",\\\"speechType\\\":0,\\\"type\\\":0,\\\"url\\\":\\\"\\\",\\\"note\\\":\\\"\\\", \\\"repeatType\\\":1, \\\"start\\\":1661342400, \\\"content\\\":\\\"\\\"},{\\\"id\\\":\\\"1660204541725\\\",\\\"speechType\\\":0,\\\"type\\\":0,\\\"url\\\":\\\"\\\", \\\"note\\\":\\\"\\\", \\\"repeatType\\\":5, \\\"start\\\":1661385600, \\\"content\\\":\\\"\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:08","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"删除所有闹钟\",\"ip\":\"121.35.103.189\",\"originQuery\":\"删除所有闹钟\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"删除所有闹钟\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:09","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"delete\",\"msg\":\"\",\"session_complete\":false,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"ordinal\",\"value\":\"[]\"}]}},\"payload\":{\"data\":{\"json\":{\"stCalendarData\":{\"mVecAlarm\":[{\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sName\":\"乐器伴奏(默认)\",\"sUrlId\":\"resource.search$10011\"}],\"sSpeakTips\":\"你一共有2个闹钟,确定要全部取消吗?\",\"stBroadData\":{\"mBroadData\":{\"1661342400\":\"time##的闹钟时间到了\",\"1661385600\":\"time##的闹钟时间到了\"},\"mGatherBroadData\":{\"1661342400\":{\"eAISpeechType\":0,\"eAIVoiceTTSEngineType\":6,\"iCount\":0,\"sBroadInfo\":\"time##的闹钟时间到了\",\"sBroadNote\":\"\",\"sCustomBroadData\":\"\",\"vNote\":[],\"vSoundRing\":[]},\"1661385600\":{\"eAISpeechType\":0,\"eAIVoiceTTSEngineType\":6,\"iCount\":0,\"sBroadInfo\":\"time##的闹钟时间到了\",\"sBroadNote\":\"\",\"sCustomBroadData\":\"\",\"vNote\":[],\"vSoundRing\":[]}}},\"stMoreInfo\":{\"mRingType\":{\"1660204541725\":\"global_ring\",\"1661321900677\":\"global_ring\"}},\"stSemanticSlotPara\":{\"sRingContent\":\"\",\"sRingType\":\"\",\"stAlarmCell\":{\"eRepeatType\":0,\"lId\":0,\"lStart\":0,\"lUpdate\":0,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[]},\"stSelfRingCell\":{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"\",\"sBackgroundImageUrl\":\"\",\"sId\":\"\",\"sName\":\"\",\"sType\":\"\"}},\"vAffectAlarmCell\":[],\"vAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]},{\"eRepeatType\":5,\"lId\":1660204541725,\"lStart\":1661385600,\"lUpdate\":1660207713111,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]}],\"vUIAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]},{\"eRepeatType\":5,\"lId\":1660204541725,\"lStart\":1661385600,\"lUpdate\":1660207713111,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]}]},\"stGetAllSelfRing\":{\"vSelfRingCell\":{}}}},\"response_text\":\"你一共有2个闹钟,确定要全部取消吗?\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322069010491_1kwYxtWc7Hr5J"}} +{"level":"debug","time":"2022-08-24 14:21:09","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"delete\",\"msg\":\"\",\"session_complete\":false,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"ordinal\",\"value\":\"[]\"}]}},\"payload\":{\"data\":{\"json\":{\"stCalendarData\":{\"mVecAlarm\":[{\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sName\":\"乐器伴奏(默认)\",\"sUrlId\":\"resource.search$10011\"}],\"sSpeakTips\":\"你一共有2个闹钟,确定要全部取消吗?\",\"stBroadData\":{\"mBroadData\":{\"1661342400\":\"time##的闹钟时间到了\",\"1661385600\":\"time##的闹钟时间到了\"},\"mGatherBroadData\":{\"1661342400\":{\"eAISpeechType\":0,\"eAIVoiceTTSEngineType\":6,\"iCount\":0,\"sBroadInfo\":\"time##的闹钟时间到了\",\"sBroadNote\":\"\",\"sCustomBroadData\":\"\",\"vNote\":[],\"vSoundRing\":[]},\"1661385600\":{\"eAISpeechType\":0,\"eAIVoiceTTSEngineType\":6,\"iCount\":0,\"sBroadInfo\":\"time##的闹钟时间到了\",\"sBroadNote\":\"\",\"sCustomBroadData\":\"\",\"vNote\":[],\"vSoundRing\":[]}}},\"stMoreInfo\":{\"mRingType\":{\"1660204541725\":\"global_ring\",\"1661321900677\":\"global_ring\"}},\"stSemanticSlotPara\":{\"sRingContent\":\"\",\"sRingType\":\"\",\"stAlarmCell\":{\"eRepeatType\":0,\"lId\":0,\"lStart\":0,\"lUpdate\":0,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[]},\"stSelfRingCell\":{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"\",\"sBackgroundImageUrl\":\"\",\"sId\":\"\",\"sName\":\"\",\"sType\":\"\"}},\"vAffectAlarmCell\":[],\"vAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]},{\"eRepeatType\":5,\"lId\":1660204541725,\"lStart\":1661385600,\"lUpdate\":1660207713111,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]}],\"vUIAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]},{\"eRepeatType\":5,\"lId\":1660204541725,\"lStart\":1661385600,\"lUpdate\":1660207713111,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[\"resource.search$10011\"]}]},\"stGetAllSelfRing\":{\"vSelfRingCell\":{}}}},\"response_text\":\"你一共有2个闹钟,确定要全部取消吗?\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:21:09","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"delete\",\"msg\":\"\",\"session_complete\":false,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"ordinal\",\"value\":\"[]\"}]}}, \"response_text\":\"你一共有2个闹钟,确定要全部取消吗?\", \"listItems\":[{\"id\":\"1661321900677\",\"speechType\":0,\"type\":0,\"url\":\"\",\"note\":\"\", \"repeatType\":1, \"start\":1661342400, \"content\":\"\"},{\"id\":\"1660204541725\",\"speechType\":0,\"type\":0,\"url\":\"\", \"note\":\"\", \"repeatType\":5, \"start\":1661385600, \"content\":\"\"}]}"}}} +{"level":"info","time":"2022-08-24 14:21:09","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"alarm\\\",\\\"intent\\\":\\\"delete\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":false,\\\"skill_id\\\":\\\"1011220547834613760\\\",\\\"slots\\\":[{\\\"name\\\":\\\"ordinal\\\",\\\"value\\\":\\\"[]\\\"}]}},\\\"response_text\\\":\\\"你一共有2个闹钟,确定要全部取消吗?\\\",\\\"asr_recongize\\\":\\\"删除所有闹钟\\\",\\\"listItems\\\":[{\\\"id\\\":\\\"1661321900677\\\",\\\"speechType\\\":0,\\\"type\\\":0,\\\"url\\\":\\\"\\\",\\\"note\\\":\\\"\\\", \\\"repeatType\\\":1, \\\"start\\\":1661342400, \\\"content\\\":\\\"\\\"},{\\\"id\\\":\\\"1660204541725\\\",\\\"speechType\\\":0,\\\"type\\\":0,\\\"url\\\":\\\"\\\", \\\"note\\\":\\\"\\\", \\\"repeatType\\\":5, \\\"start\\\":1661385600, \\\"content\\\":\\\"\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:13","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"确定\",\"ip\":\"121.35.103.189\",\"originQuery\":\"确定\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:13","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:13","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:13","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"确定\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:13","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"delete\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"ordinal\",\"value\":\"[]\"}]}},\"payload\":{\"data\":{\"json\":{\"stCalendarData\":{\"mVecAlarm\":[{\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sName\":\"乐器伴奏(默认)\",\"sUrlId\":\"resource.search$10011\"}],\"sSpeakTips\":\"已帮你取消2个闹钟。\",\"stBroadData\":{\"mBroadData\":{},\"mGatherBroadData\":{}},\"stMoreInfo\":{\"mRingType\":{}},\"stSemanticSlotPara\":{\"sRingContent\":\"\",\"sRingType\":\"\",\"stAlarmCell\":{\"eRepeatType\":0,\"lId\":0,\"lStart\":0,\"lUpdate\":0,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[]},\"stSelfRingCell\":{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"\",\"sBackgroundImageUrl\":\"\",\"sId\":\"\",\"sName\":\"\",\"sType\":\"\"}},\"vAffectAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vSelfRingCell\":[{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sId\":\"resource.search$10011\",\"sName\":\"乐器伴奏(默认)\",\"sType\":\"白噪音\"}],\"vStrUrlId\":[\"resource.search$10011\"]},{\"eRepeatType\":5,\"lId\":1660204541725,\"lStart\":1661385600,\"lUpdate\":1660207713111,\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vSelfRingCell\":[{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sId\":\"resource.search$10011\",\"sName\":\"乐器伴奏(默认)\",\"sType\":\"白噪音\"}],\"vStrUrlId\":[\"resource.search$10011\"]}],\"vAlarmCell\":[],\"vUIAlarmCell\":[]},\"stGetAllSelfRing\":{\"vSelfRingCell\":{}}}},\"response_text\":\"已帮你取消2个闹钟。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322073809859_try3oe6Xe3As3"}} +{"level":"debug","time":"2022-08-24 14:21:13","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"delete\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"ordinal\",\"value\":\"[]\"}]}},\"payload\":{\"data\":{\"json\":{\"stCalendarData\":{\"mVecAlarm\":[{\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sName\":\"乐器伴奏(默认)\",\"sUrlId\":\"resource.search$10011\"}],\"sSpeakTips\":\"已帮你取消2个闹钟。\",\"stBroadData\":{\"mBroadData\":{},\"mGatherBroadData\":{}},\"stMoreInfo\":{\"mRingType\":{}},\"stSemanticSlotPara\":{\"sRingContent\":\"\",\"sRingType\":\"\",\"stAlarmCell\":{\"eRepeatType\":0,\"lId\":0,\"lStart\":0,\"lUpdate\":0,\"sCustomBroadData\":\"\",\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vStrUrlId\":[]},\"stSelfRingCell\":{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"\",\"sBackgroundImageUrl\":\"\",\"sId\":\"\",\"sName\":\"\",\"sType\":\"\"}},\"vAffectAlarmCell\":[{\"eRepeatType\":1,\"lId\":1661321900677,\"lStart\":1661342400,\"lUpdate\":1661321900678,\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vSelfRingCell\":[{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sId\":\"resource.search$10011\",\"sName\":\"乐器伴奏(默认)\",\"sType\":\"白噪音\"}],\"vStrUrlId\":[\"resource.search$10011\"]},{\"eRepeatType\":5,\"lId\":1660204541725,\"lStart\":1661385600,\"lUpdate\":1660207713111,\"sExtraInfo\":\"\",\"sNote\":\"\",\"vSelfData\":[],\"vSelfRingCell\":[{\"sAuditionUrl\":\"\",\"sBackgroundBigImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/bg_img/alarm_moren.jpg\",\"sBackgroundImageUrl\":\"http://soft.imtt.qq.com/browser/TBS/dingdang/resource_manager/cover/moren.jpg\",\"sId\":\"resource.search$10011\",\"sName\":\"乐器伴奏(默认)\",\"sType\":\"白噪音\"}],\"vStrUrlId\":[\"resource.search$10011\"]}],\"vAlarmCell\":[],\"vUIAlarmCell\":[]},\"stGetAllSelfRing\":{\"vSelfRingCell\":{}}}},\"response_text\":\"已帮你取消2个闹钟。\",\"ret\":0}}\n"}}} +affected rows:1affected rows:1{"level":"debug","time":"2022-08-24 14:21:14","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"alarm\",\"intent\":\"delete\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011220547834613760\",\"slots\":[{\"name\":\"ordinal\",\"value\":\"[]\"}]}}, \"response_text\":\"已帮你取消2个闹钟。\", \"listItems\":[]}"}}} +{"level":"info","time":"2022-08-24 14:21:14","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"alarm\\\",\\\"intent\\\":\\\"delete\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"1011220547834613760\\\",\\\"slots\\\":[{\\\"name\\\":\\\"ordinal\\\",\\\"value\\\":\\\"[]\\\"}]}},\\\"response_text\\\":\\\"已帮你取消2个闹钟。\\\",\\\"asr_recongize\\\":\\\"确定\\\",\\\"listItems\\\":[]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:22","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"一加一等于几\",\"ip\":\"121.35.103.189\",\"originQuery\":\"一加一等于几\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:22","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:22","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:22","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"一加一等于几\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:21:22","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"science\",\"intent\":\"calculator\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835481048649728\",\"slots\":[{\"name\":\"expression\",\"value\":\"1+1\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"science\"},\"controlInfo\":{\"audioConsole\":\"false\",\"backgroundImageValid\":\"true\",\"orientation\":\"portrait\",\"subTitleSpeak\":\"true\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"listItems\":[{\"selfData\":{\"iRet\":0,\"sFormula\":\"1+1\",\"sResult\":\"2\"},\"textContent\":\"一加一等于2\",\"title\":\"1+1=2\"}]}},\"response_text\":\"一加一等于2\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322082407541_OlIry1CaWzQtK"}} +{"level":"debug","time":"2022-08-24 14:21:22","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"science\",\"intent\":\"calculator\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835481048649728\",\"slots\":[{\"name\":\"expression\",\"value\":\"1+1\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"science\"},\"controlInfo\":{\"audioConsole\":\"false\",\"backgroundImageValid\":\"true\",\"orientation\":\"portrait\",\"subTitleSpeak\":\"true\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"listItems\":[{\"selfData\":{\"iRet\":0,\"sFormula\":\"1+1\",\"sResult\":\"2\"},\"textContent\":\"一加一等于2\",\"title\":\"1+1=2\"}]}},\"response_text\":\"一加一等于2\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:21:22","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"science\",\"intent\":\"calculator\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835481048649728\",\"slots\":[{\"name\":\"expression\",\"value\":\"1+1\"}]}},\"response_text\":\"等于2\"}"}}} +{"level":"info","time":"2022-08-24 14:21:22","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"science\\\",\\\"intent\\\":\\\"calculator\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835481048649728\\\",\\\"slots\\\":[{\\\"name\\\":\\\"expression\\\",\\\"value\\\":\\\"1+1\\\"}]}},\\\"response_text\\\":\\\"等于2\\\",\\\"asr_recongize\\\":\\\"一加一等于几\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:24:36","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"我要听海的声音\",\"ip\":\"121.35.103.189\",\"originQuery\":\"我要听海的声音\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:24:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:24:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:24:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"我要听海的声音\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:24:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"sound\",\"intent\":\"search_sound\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011906538148859904\",\"slots\":[{\"name\":\"soundsource\",\"value\":\"轻柔的海浪\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\",\"version\":\"1.0.0\"},\"globalInfo\":{\"selfData\":{\"eType\":0,\"sDurationTime\":\"\",\"sResText\":\"注意听,轻柔的海浪的声音是这样的。\"}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://softfile.3g.qq.com/myapp/soft_imtt/smartChildVoice/Nature/Waves.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://softfile.3g.qq.com/myapp/trom_l/textbookcover/xiaoshuimian_cover1/888.jpg\",\"widthPixels\":0}]},\"mediaId\":\"813\",\"textContent\":\"\",\"title\":\"声音名:轻柔的海浪\"}]}},\"response_text\":\"注意听,轻柔的海浪的声音是这样的。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322276938889_zNBeJk4X5uHZp"}} +{"level":"debug","time":"2022-08-24 14:24:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"sound\",\"intent\":\"search_sound\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011906538148859904\",\"slots\":[{\"name\":\"soundsource\",\"value\":\"轻柔的海浪\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\",\"version\":\"1.0.0\"},\"globalInfo\":{\"selfData\":{\"eType\":0,\"sDurationTime\":\"\",\"sResText\":\"注意听,轻柔的海浪的声音是这样的。\"}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://softfile.3g.qq.com/myapp/soft_imtt/smartChildVoice/Nature/Waves.mp3\"}},\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://softfile.3g.qq.com/myapp/trom_l/textbookcover/xiaoshuimian_cover1/888.jpg\",\"widthPixels\":0}]},\"mediaId\":\"813\",\"textContent\":\"\",\"title\":\"声音名:轻柔的海浪\"}]}},\"response_text\":\"注意听,轻柔的海浪的声音是这样的。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:24:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"sound\",\"intent\":\"search_sound\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"1011906538148859904\",\"slots\":[{\"name\":\"soundsource\",\"value\":\"轻柔的海浪\"}]}},\"response_text\":\"注意听,轻柔的海浪的声音是这样的。\",\"listItems\":[{\"type\":\"AUDIO\",\"url\":\"http://softfile.3g.qq.com/myapp/soft_imtt/smartChildVoice/Nature/Waves.mp3\",\"title\":\"声音名:轻柔的海浪\"}]"}}} +{"level":"info","time":"2022-08-24 14:24:36","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"sound\\\",\\\"intent\\\":\\\"search_sound\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"1011906538148859904\\\",\\\"slots\\\":[{\\\"name\\\":\\\"soundsource\\\",\\\"value\\\":\\\"轻柔的海浪\\\"}]}},\\\"response_text\\\":\\\"注意听,轻柔的海浪的声音是这样的。\\\",\\\"asr_recongize\\\":\\\"我要听海的声音\\\",\\\"listItems\\\":[{\\\"type\\\":\\\"AUDIO\\\",\\\"url\\\":\\\"http://softfile.3g.qq.com/myapp/soft_imtt/smartChildVoice/Nature/Waves.mp3\\\",\\\"title\\\":\\\"声音名:轻柔的海浪\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:26:53","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"NBA的排名\",\"ip\":\"121.35.103.189\",\"originQuery\":\"NBA的排名\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:26:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:26:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:26:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"NBA的排名\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:26:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"sports\",\"intent\":\"search_record\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990844323732000768\",\"slots\":[{\"name\":\"competition\",\"value\":\"NBA\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"seeMore\":\"https://aiwx.html5.qq.com/sports/rank?param=D0fduEabSh32gixc37RggR1MhLwHFwUv8yvxdh8q%2BFBg1vC52i%2Frhw%3D%3D\"},\"listItems\":[{\"selfData\":{\"detailLink\":{\"href\":\"https://aiwx.html5.qq.com/sports/rank?param=D0fduEabSh32gixc37RggR1MhLwHFwUv8yvxdh8q%2BFBg1vC52i%2Frhw%3D%3D\",\"name\":\"查看全部排名\"},\"iGroupIndex\":0,\"iIndex\":-1,\"noSupport\":\"\",\"rankdata\":{\"competitionName\":\"\",\"rankdataObjs\":[],\"requestField\":\"\",\"subject\":\"\"},\"replyWords\":\"为你找到了NBA的排名\",\"sBackground\":\"https://softimtt.myapp.com/browser/smart_service/sports/imgs/bg/basket_bg.jpg\",\"sGuid\":\"0e92608902a2c95e283d88adec41b80f\",\"speakerReplyWords\":\"2021赛季NBA东部前8依次是热火第1、凯尔特人第2、雄鹿第3、76人第4、猛龙第5、公牛第6、篮网第7、老鹰第8;西部依次是太阳第1、灰熊第2、勇士第3、独行侠第4、爵士第5、掘金第6、森林狼第7、鹈鹕第8。\",\"sportsRecords\":[{\"competition\":\"NBA\",\"group\":\"东部\",\"season\":\"2021\",\"sportsType\":1,\"teamStatVec\":[{\"competition\":\"东部\",\"gamesBack\":0,\"lostMatchCount\":29,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"1\",\"score\":\"65%\",\"teamId\":\"14\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/14.png\",\"teamName\":\"热火\",\"winMatchCount\":53},{\"competition\":\"东部\",\"gamesBack\":2,\"lostMatchCount\":31,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"2\",\"score\":\"62%\",\"teamId\":\"2\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/2.png\",\"teamName\":\"凯尔特人\",\"winMatchCount\":51},{\"competition\":\"东部\",\"gamesBack\":2,\"lostMatchCount\":31,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"3\",\"score\":\"62%\",\"teamId\":\"15\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/15.png\",\"teamName\":\"雄鹿\",\"winMatchCount\":51},{\"competition\":\"东部\",\"gamesBack\":2,\"lostMatchCount\":31,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"4\",\"score\":\"62%\",\"teamId\":\"20\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/20.png\",\"teamName\":\"76人\",\"winMatchCount\":51},{\"competition\":\"东部\",\"gamesBack\":5,\"lostMatchCount\":34,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"5\",\"score\":\"59%\",\"teamId\":\"28\",\"teamLogo\":\"http://img1.gtimg.com/sports/pics/hv1/133/21/2268/147482188.png\",\"teamName\":\"猛龙\",\"winMatchCount\":48},{\"competition\":\"东部\",\"gamesBack\":7,\"lostMatchCount\":36,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"6\",\"score\":\"56%\",\"teamId\":\"4\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/4.png\",\"teamName\":\"公牛\",\"winMatchCount\":46},{\"competition\":\"东部\",\"gamesBack\":9,\"lostMatchCount\":38,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"7\",\"score\":\"54%\",\"teamId\":\"17\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/17.png\",\"teamName\":\"篮网\",\"winMatchCount\":44},{\"competition\":\"东部\",\"gamesBack\":10,\"lostMatchCount\":39,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"8\",\"score\":\"52%\",\"teamId\":\"1\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/1.png\",\"teamName\":\"老鹰\",\"winMatchCount\":43},{\"competition\":\"东部\",\"gamesBack\":9,\"lostMatchCount\":38,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"9\",\"score\":\"54%\",\"teamId\":\"5\",\"teamLogo\":\"http://img1.gtimg.com/sports/pics/hv1/131/116/2220/144385211.png\",\"teamName\":\"骑士\",\"winMatchCount\":44},{\"competition\":\"东部\",\"gamesBack\":10,\"lostMatchCount\":39,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"10\",\"score\":\"52%\",\"teamId\":\"30\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/30.png\",\"teamName\":\"黄蜂\",\"winMatchCount\":43},{\"competition\":\"东部\",\"gamesBack\":16,\"lostMatchCount\":45,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"11\",\"score\":\"45%\",\"teamId\":\"18\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/18.png\",\"teamName\":\"尼克斯\",\"winMatchCount\":37},{\"competition\":\"东部\",\"gamesBack\":18,\"lostMatchCount\":47,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"12\",\"score\":\"43%\",\"teamId\":\"27\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/27.png\",\"teamName\":\"奇才\",\"winMatchCount\":35},{\"competition\":\"东部\",\"gamesBack\":28,\"lostMatchCount\":57,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"13\",\"score\":\"30%\",\"teamId\":\"11\",\"teamLogo\":\"http://img1.gtimg.com/sports/pics/hv1/43/116/2220/144385123.png\",\"teamName\":\"步行者\",\"winMatchCount\":25},{\"competition\":\"东部\",\"gamesBack\":30,\"lostMatchCount\":59,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"14\",\"score\":\"28%\",\"teamId\":\"8\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/new/8.png\",\"teamName\":\"活塞\",\"winMatchCount\":23},{\"competition\":\"东部\",\"gamesBack\":31,\"lostMatchCount\":60,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"15\",\"score\":\"27%\",\"teamId\":\"19\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/19.png\",\"teamName\":\"魔术\",\"winMatchCount\":22}]},{\"competition\":\"NBA\",\"group\":\"西部\",\"season\":\"2021\",\"sportsType\":1,\"teamStatVec\":[{\"competition\":\"西部\",\"gamesBack\":0,\"lostMatchCount\":18,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"1\",\"score\":\"78%\",\"teamId\":\"21\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/21.png\",\"teamName\":\"太阳\",\"winMatchCount\":64},{\"competition\":\"西部\",\"gamesBack\":8,\"lostMatchCount\":26,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"2\",\"score\":\"68%\",\"teamId\":\"29\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/29.png\",\"teamName\":\"灰熊\",\"winMatchCount\":56},{\"competition\":\"西部\",\"gamesBack\":11,\"lostMatchCount\":29,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"3\",\"score\":\"65%\",\"teamId\":\"9\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/black/9.png\",\"teamName\":\"勇士\",\"winMatchCount\":53},{\"competition\":\"西部\",\"gamesBack\":12,\"lostMatchCount\":30,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"4\",\"score\":\"63%\",\"teamId\":\"6\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/6.png\",\"teamName\":\"独行侠\",\"winMatchCount\":52},{\"competition\":\"西部\",\"gamesBack\":15,\"lostMatchCount\":33,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"5\",\"score\":\"60%\",\"teamId\":\"26\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/26.png\",\"teamName\":\"爵士\",\"winMatchCount\":49},{\"competition\":\"西部\",\"gamesBack\":16,\"lostMatchCount\":34,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"6\",\"score\":\"59%\",\"teamId\":\"7\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/20187.png\",\"teamName\":\"掘金\",\"winMatchCount\":48},{\"competition\":\"西部\",\"gamesBack\":18,\"lostMatchCount\":36,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"7\",\"score\":\"56%\",\"teamId\":\"16\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/new/16.png\",\"teamName\":\"森林狼\",\"winMatchCount\":46},{\"competition\":\"西部\",\"gamesBack\":28,\"lostMatchCount\":46,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"8\",\"score\":\"44%\",\"teamId\":\"3\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/3.png\",\"teamName\":\"鹈鹕\",\"winMatchCount\":36},{\"competition\":\"西部\",\"gamesBack\":22,\"lostMatchCount\":40,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"9\",\"score\":\"51%\",\"teamId\":\"12\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/1201.png\",\"teamName\":\"快船\",\"winMatchCount\":42},{\"competition\":\"西部\",\"gamesBack\":30,\"lostMatchCount\":48,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"10\",\"score\":\"41%\",\"teamId\":\"24\",\"teamLogo\":\"http://img1.gtimg.com/sports/pics/hv1/231/116/2220/144385311.png\",\"teamName\":\"马刺\",\"winMatchCount\":34},{\"competition\":\"西部\",\"gamesBack\":31,\"lostMatchCount\":49,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"11\",\"score\":\"40%\",\"teamId\":\"13\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/13.png\",\"teamName\":\"湖人\",\"winMatchCount\":33},{\"competition\":\"西部\",\"gamesBack\":34,\"lostMatchCount\":52,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"12\",\"score\":\"37%\",\"teamId\":\"23\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/23.png\",\"teamName\":\"国王\",\"winMatchCount\":30},{\"competition\":\"西部\",\"gamesBack\":37,\"lostMatchCount\":55,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"13\",\"score\":\"33%\",\"teamId\":\"22\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/new/22.png\",\"teamName\":\"开拓者\",\"winMatchCount\":27},{\"competition\":\"西部\",\"gamesBack\":40,\"lostMatchCount\":58,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"14\",\"score\":\"29%\",\"teamId\":\"25\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/25.png\",\"teamName\":\"雷霆\",\"winMatchCount\":24},{\"competition\":\"西部\",\"gamesBack\":44,\"lostMatchCount\":62,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"15\",\"score\":\"24%\",\"teamId\":\"10\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/10.png\",\"teamName\":\"火箭\",\"winMatchCount\":20}]}],\"strJsonToSemantic\":\"\"},\"textContent\":\"2021赛季NBA东部前8依次是热火第1、凯尔特人第2、雄鹿第3、76人第4、猛龙第5、公牛第6、篮网第7、老鹰第8;西部依次是太阳第1、灰熊第2、勇士第3、独行侠第4、爵士第5、掘金第6、森林狼第7、鹈鹕第8。\"}]},\"json_template\":[{\"eDataType\":1,\"strContentData\":\"\",\"strContentID\":\"\",\"strContentURL\":\"\",\"strData\":\"\",\"strDescription\":\"\",\"strDestURL\":\"\",\"strDownloadURL\":\"\",\"strShareURL\":\"\",\"strTitle\":\"为你找到了NBA的排名\\n\\nNBA东部\\t球队\\t胜率\\n1\\t\\t热火\\t65%\\n2\\t\\t凯尔特人\\t62%\\n3\\t\\t雄鹿\\t62%\\n4\\t\\t76人\\t62%\\n5\\t\\t猛龙\\t59%\\n\\n查看全部排名\"}]},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322413260658_9FS3Q2pWKEfgh"}} +{"level":"debug","time":"2022-08-24 14:26:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"sports\",\"intent\":\"search_record\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990844323732000768\",\"slots\":[{\"name\":\"competition\",\"value\":\"NBA\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"seeMore\":\"https://aiwx.html5.qq.com/sports/rank?param=D0fduEabSh32gixc37RggR1MhLwHFwUv8yvxdh8q%2BFBg1vC52i%2Frhw%3D%3D\"},\"listItems\":[{\"selfData\":{\"detailLink\":{\"href\":\"https://aiwx.html5.qq.com/sports/rank?param=D0fduEabSh32gixc37RggR1MhLwHFwUv8yvxdh8q%2BFBg1vC52i%2Frhw%3D%3D\",\"name\":\"查看全部排名\"},\"iGroupIndex\":0,\"iIndex\":-1,\"noSupport\":\"\",\"rankdata\":{\"competitionName\":\"\",\"rankdataObjs\":[],\"requestField\":\"\",\"subject\":\"\"},\"replyWords\":\"为你找到了NBA的排名\",\"sBackground\":\"https://softimtt.myapp.com/browser/smart_service/sports/imgs/bg/basket_bg.jpg\",\"sGuid\":\"0e92608902a2c95e283d88adec41b80f\",\"speakerReplyWords\":\"2021赛季NBA东部前8依次是热火第1、凯尔特人第2、雄鹿第3、76人第4、猛龙第5、公牛第6、篮网第7、老鹰第8;西部依次是太阳第1、灰熊第2、勇士第3、独行侠第4、爵士第5、掘金第6、森林狼第7、鹈鹕第8。\",\"sportsRecords\":[{\"competition\":\"NBA\",\"group\":\"东部\",\"season\":\"2021\",\"sportsType\":1,\"teamStatVec\":[{\"competition\":\"东部\",\"gamesBack\":0,\"lostMatchCount\":29,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"1\",\"score\":\"65%\",\"teamId\":\"14\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/14.png\",\"teamName\":\"热火\",\"winMatchCount\":53},{\"competition\":\"东部\",\"gamesBack\":2,\"lostMatchCount\":31,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"2\",\"score\":\"62%\",\"teamId\":\"2\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/2.png\",\"teamName\":\"凯尔特人\",\"winMatchCount\":51},{\"competition\":\"东部\",\"gamesBack\":2,\"lostMatchCount\":31,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"3\",\"score\":\"62%\",\"teamId\":\"15\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/15.png\",\"teamName\":\"雄鹿\",\"winMatchCount\":51},{\"competition\":\"东部\",\"gamesBack\":2,\"lostMatchCount\":31,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"4\",\"score\":\"62%\",\"teamId\":\"20\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/20.png\",\"teamName\":\"76人\",\"winMatchCount\":51},{\"competition\":\"东部\",\"gamesBack\":5,\"lostMatchCount\":34,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"5\",\"score\":\"59%\",\"teamId\":\"28\",\"teamLogo\":\"http://img1.gtimg.com/sports/pics/hv1/133/21/2268/147482188.png\",\"teamName\":\"猛龙\",\"winMatchCount\":48},{\"competition\":\"东部\",\"gamesBack\":7,\"lostMatchCount\":36,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"6\",\"score\":\"56%\",\"teamId\":\"4\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/4.png\",\"teamName\":\"公牛\",\"winMatchCount\":46},{\"competition\":\"东部\",\"gamesBack\":9,\"lostMatchCount\":38,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"7\",\"score\":\"54%\",\"teamId\":\"17\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/17.png\",\"teamName\":\"篮网\",\"winMatchCount\":44},{\"competition\":\"东部\",\"gamesBack\":10,\"lostMatchCount\":39,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"8\",\"score\":\"52%\",\"teamId\":\"1\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/1.png\",\"teamName\":\"老鹰\",\"winMatchCount\":43},{\"competition\":\"东部\",\"gamesBack\":9,\"lostMatchCount\":38,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"9\",\"score\":\"54%\",\"teamId\":\"5\",\"teamLogo\":\"http://img1.gtimg.com/sports/pics/hv1/131/116/2220/144385211.png\",\"teamName\":\"骑士\",\"winMatchCount\":44},{\"competition\":\"东部\",\"gamesBack\":10,\"lostMatchCount\":39,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"10\",\"score\":\"52%\",\"teamId\":\"30\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/30.png\",\"teamName\":\"黄蜂\",\"winMatchCount\":43},{\"competition\":\"东部\",\"gamesBack\":16,\"lostMatchCount\":45,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"11\",\"score\":\"45%\",\"teamId\":\"18\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/18.png\",\"teamName\":\"尼克斯\",\"winMatchCount\":37},{\"competition\":\"东部\",\"gamesBack\":18,\"lostMatchCount\":47,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"12\",\"score\":\"43%\",\"teamId\":\"27\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/27.png\",\"teamName\":\"奇才\",\"winMatchCount\":35},{\"competition\":\"东部\",\"gamesBack\":28,\"lostMatchCount\":57,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"13\",\"score\":\"30%\",\"teamId\":\"11\",\"teamLogo\":\"http://img1.gtimg.com/sports/pics/hv1/43/116/2220/144385123.png\",\"teamName\":\"步行者\",\"winMatchCount\":25},{\"competition\":\"东部\",\"gamesBack\":30,\"lostMatchCount\":59,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"14\",\"score\":\"28%\",\"teamId\":\"8\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/new/8.png\",\"teamName\":\"活塞\",\"winMatchCount\":23},{\"competition\":\"东部\",\"gamesBack\":31,\"lostMatchCount\":60,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"15\",\"score\":\"27%\",\"teamId\":\"19\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/19.png\",\"teamName\":\"魔术\",\"winMatchCount\":22}]},{\"competition\":\"NBA\",\"group\":\"西部\",\"season\":\"2021\",\"sportsType\":1,\"teamStatVec\":[{\"competition\":\"西部\",\"gamesBack\":0,\"lostMatchCount\":18,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"1\",\"score\":\"78%\",\"teamId\":\"21\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/21.png\",\"teamName\":\"太阳\",\"winMatchCount\":64},{\"competition\":\"西部\",\"gamesBack\":8,\"lostMatchCount\":26,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"2\",\"score\":\"68%\",\"teamId\":\"29\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/29.png\",\"teamName\":\"灰熊\",\"winMatchCount\":56},{\"competition\":\"西部\",\"gamesBack\":11,\"lostMatchCount\":29,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"3\",\"score\":\"65%\",\"teamId\":\"9\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/black/9.png\",\"teamName\":\"勇士\",\"winMatchCount\":53},{\"competition\":\"西部\",\"gamesBack\":12,\"lostMatchCount\":30,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"4\",\"score\":\"63%\",\"teamId\":\"6\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/6.png\",\"teamName\":\"独行侠\",\"winMatchCount\":52},{\"competition\":\"西部\",\"gamesBack\":15,\"lostMatchCount\":33,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"5\",\"score\":\"60%\",\"teamId\":\"26\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/26.png\",\"teamName\":\"爵士\",\"winMatchCount\":49},{\"competition\":\"西部\",\"gamesBack\":16,\"lostMatchCount\":34,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"6\",\"score\":\"59%\",\"teamId\":\"7\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/20187.png\",\"teamName\":\"掘金\",\"winMatchCount\":48},{\"competition\":\"西部\",\"gamesBack\":18,\"lostMatchCount\":36,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"7\",\"score\":\"56%\",\"teamId\":\"16\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/new/16.png\",\"teamName\":\"森林狼\",\"winMatchCount\":46},{\"competition\":\"西部\",\"gamesBack\":28,\"lostMatchCount\":46,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"8\",\"score\":\"44%\",\"teamId\":\"3\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/3.png\",\"teamName\":\"鹈鹕\",\"winMatchCount\":36},{\"competition\":\"西部\",\"gamesBack\":22,\"lostMatchCount\":40,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"9\",\"score\":\"51%\",\"teamId\":\"12\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/1201.png\",\"teamName\":\"快船\",\"winMatchCount\":42},{\"competition\":\"西部\",\"gamesBack\":30,\"lostMatchCount\":48,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"10\",\"score\":\"41%\",\"teamId\":\"24\",\"teamLogo\":\"http://img1.gtimg.com/sports/pics/hv1/231/116/2220/144385311.png\",\"teamName\":\"马刺\",\"winMatchCount\":34},{\"competition\":\"西部\",\"gamesBack\":31,\"lostMatchCount\":49,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"11\",\"score\":\"40%\",\"teamId\":\"13\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/13.png\",\"teamName\":\"湖人\",\"winMatchCount\":33},{\"competition\":\"西部\",\"gamesBack\":34,\"lostMatchCount\":52,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"12\",\"score\":\"37%\",\"teamId\":\"23\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/23.png\",\"teamName\":\"国王\",\"winMatchCount\":30},{\"competition\":\"西部\",\"gamesBack\":37,\"lostMatchCount\":55,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"13\",\"score\":\"33%\",\"teamId\":\"22\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/new/22.png\",\"teamName\":\"开拓者\",\"winMatchCount\":27},{\"competition\":\"西部\",\"gamesBack\":40,\"lostMatchCount\":58,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"14\",\"score\":\"29%\",\"teamId\":\"25\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/25.png\",\"teamName\":\"雷霆\",\"winMatchCount\":24},{\"competition\":\"西部\",\"gamesBack\":44,\"lostMatchCount\":62,\"matchCount\":82,\"planishMatchCount\":0,\"rank\":\"15\",\"score\":\"24%\",\"teamId\":\"10\",\"teamLogo\":\"http://mat1.gtimg.com/sports/nba/logo/1602/10.png\",\"teamName\":\"火箭\",\"winMatchCount\":20}]}],\"strJsonToSemantic\":\"\"},\"textContent\":\"2021赛季NBA东部前8依次是热火第1、凯尔特人第2、雄鹿第3、76人第4、猛龙第5、公牛第6、篮网第7、老鹰第8;西部依次是太阳第1、灰熊第2、勇士第3、独行侠第4、爵士第5、掘金第6、森林狼第7、鹈鹕第8。\"}]},\"json_template\":[{\"eDataType\":1,\"strContentData\":\"\",\"strContentID\":\"\",\"strContentURL\":\"\",\"strData\":\"\",\"strDescription\":\"\",\"strDestURL\":\"\",\"strDownloadURL\":\"\",\"strShareURL\":\"\",\"strTitle\":\"为你找到了NBA的排名\\n\\nNBA东部\\t球队\\t胜率\\n1\\t\\t热火\\t65%\\n2\\t\\t凯尔特人\\t62%\\n3\\t\\t雄鹿\\t62%\\n4\\t\\t76人\\t62%\\n5\\t\\t猛龙\\t59%\\n\\n查看全部排名\"}]},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:26:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"sports\",\"intent\":\"search_record\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990844323732000768\",\"slots\":[{\"name\":\"competition\",\"value\":\"NBA\"}]}},\"response_text\":\"2021赛季NBA东部前8依次是热火第1、凯尔特人第2、雄鹿第3、76人第4、猛龙第5、公牛第6、篮网第7、老鹰第8;西部依次是太阳第1、灰熊第2、勇士第3、独行侠第4、爵士第5、掘金第6、森林狼第7、鹈鹕第8。\"}"}}} +{"level":"info","time":"2022-08-24 14:26:53","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"sports\\\",\\\"intent\\\":\\\"search_record\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990844323732000768\\\",\\\"slots\\\":[{\\\"name\\\":\\\"competition\\\",\\\"value\\\":\\\"NBA\\\"}]}},\\\"response_text\\\":\\\"2021赛季NBA东部前8依次是热火第1、凯尔特人第2、雄鹿第3、76人第4、猛龙第5、公牛第6、篮网第7、老鹰第8;西部依次是太阳第1、灰熊第2、勇士第3、独行侠第4、爵士第5、掘金第6、森林狼第7、鹈鹕第8。\\\",\\\"asr_recongize\\\":\\\"NBA的排名\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:29:26","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"腾讯今天的开盘价是多少\",\"ip\":\"121.35.103.189\",\"originQuery\":\"腾讯今天的开盘价是多少\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:29:26","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:29:26","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:29:26","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"腾讯今天的开盘价是多少\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:29:26","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"stock\",\"intent\":\"price\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990847313138290688\",\"slots\":[{\"name\":\"date\",\"value\":\"2022-08-24\"},{\"name\":\"price_openclose\",\"value\":\"开盘价\"},{\"name\":\"stockname\",\"value\":\"腾讯控股\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"backgroundImageValid\":\"true\",\"orientation\":\"portrait\",\"subTitleSpeak\":\"true\",\"textSpeak\":\"true\",\"titleSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"\",\"widthPixels\":0}]}},\"listItems\":[{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"selfData\":{\"stockdataObj\":{\"adrRatio\":\"\",\"dividendYield\":\"0.52\",\"dstUrl\":\"http://finance.qq.com/wxzixuangu/index.htm#/stock/hk00700\",\"eps\":\"\",\"genTime\":\"2022/08/24 14:28:59\",\"highestPrice\":\"315.40\",\"lowestPrice\":\"307.40\",\"market\":\"港股\",\"marketStat\":\"交易中\",\"marketValue\":\"2.97万亿\",\"peRatio\":\"30.18\",\"priceChange\":\"-4.40\",\"priceChangeRatio\":\"-1.41%\",\"quantiryRatio\":\"\",\"recentPrice\":\"308.40\",\"status\":\"\",\"stockCode\":\"00700\",\"stockName\":\"腾讯控股\",\"tOpenPrice\":\"313.80\",\"tradeVol\":\"884.99万股\",\"turnOver\":\"27.52亿\",\"turnRatio\":\"\",\"unit\":\"港元\",\"yClosePrice\":\"312.80\"}},\"subTitle\":\"\",\"textContent\":\"腾讯控股今天的开盘价是313.80港元。\",\"title\":\"\"}]},\"json_template\":[{\"eDataType\":10,\"strContentData\":\"\",\"strContentID\":\"\",\"strContentURL\":\"\",\"strData\":\"[{\\\"imageinfo\\\":{\\\"bCorner\\\":true,\\\"nHight\\\":0,\\\"nRadius\\\":0,\\\"nWidth\\\":0,\\\"strImageUrl\\\":\\\"\\\"},\\\"strDestURL\\\":\\\"\\\",\\\"vecContentItems\\\":[{\\\"100\\\":\\\"港股\\\"},{\\\"100\\\":\\\"腾讯控股\\\",\\\"101\\\":\\\"(00700)\\\"},{\\\"100\\\":\\\"308.40\\\",\\\"101\\\":\\\"-4.40\\\",\\\"102\\\":\\\"-1.41%\\\",\\\"4\\\":\\\"-1\\\"},{\\\"100\\\":\\\"最高\\\",\\\"101\\\":\\\"315.40\\\",\\\"102\\\":\\\"最低\\\",\\\"103\\\":\\\"307.40\\\"},{\\\"100\\\":\\\"市盈率\\\",\\\"101\\\":\\\"30.18\\\",\\\"102\\\":\\\"成交量\\\",\\\"103\\\":\\\"884.99万股\\\"},{\\\"100\\\":\\\"周息率\\\",\\\"101\\\":\\\"0.52\\\",\\\"102\\\":\\\"总市值\\\",\\\"103\\\":\\\"2.97万亿港元\\\"},{\\\"100\\\":\\\"今开\\\",\\\"101\\\":\\\"313.80港元\\\",\\\"102\\\":\\\"昨收\\\",\\\"103\\\":\\\"312.80港元\\\"},{\\\"100\\\":\\\"交易中\\\",\\\"101\\\":\\\"2022/08/24 14:28:59\\\"}]}]\\n\",\"strDescription\":\"\",\"strDestURL\":\"\",\"strDownloadURL\":\"\",\"strShareURL\":\"\",\"strTitle\":\"\"}]},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322566383581_cW8XLoJQJpZFR"}} +{"level":"debug","time":"2022-08-24 14:29:26","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"stock\",\"intent\":\"price\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990847313138290688\",\"slots\":[{\"name\":\"date\",\"value\":\"2022-08-24\"},{\"name\":\"price_openclose\",\"value\":\"开盘价\"},{\"name\":\"stockname\",\"value\":\"腾讯控股\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"backgroundImageValid\":\"true\",\"orientation\":\"portrait\",\"subTitleSpeak\":\"true\",\"textSpeak\":\"true\",\"titleSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"\",\"widthPixels\":0}]}},\"listItems\":[{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"selfData\":{\"stockdataObj\":{\"adrRatio\":\"\",\"dividendYield\":\"0.52\",\"dstUrl\":\"http://finance.qq.com/wxzixuangu/index.htm#/stock/hk00700\",\"eps\":\"\",\"genTime\":\"2022/08/24 14:28:59\",\"highestPrice\":\"315.40\",\"lowestPrice\":\"307.40\",\"market\":\"港股\",\"marketStat\":\"交易中\",\"marketValue\":\"2.97万亿\",\"peRatio\":\"30.18\",\"priceChange\":\"-4.40\",\"priceChangeRatio\":\"-1.41%\",\"quantiryRatio\":\"\",\"recentPrice\":\"308.40\",\"status\":\"\",\"stockCode\":\"00700\",\"stockName\":\"腾讯控股\",\"tOpenPrice\":\"313.80\",\"tradeVol\":\"884.99万股\",\"turnOver\":\"27.52亿\",\"turnRatio\":\"\",\"unit\":\"港元\",\"yClosePrice\":\"312.80\"}},\"subTitle\":\"\",\"textContent\":\"腾讯控股今天的开盘价是313.80港元。\",\"title\":\"\"}]},\"json_template\":[{\"eDataType\":10,\"strContentData\":\"\",\"strContentID\":\"\",\"strContentURL\":\"\",\"strData\":\"[{\\\"imageinfo\\\":{\\\"bCorner\\\":true,\\\"nHight\\\":0,\\\"nRadius\\\":0,\\\"nWidth\\\":0,\\\"strImageUrl\\\":\\\"\\\"},\\\"strDestURL\\\":\\\"\\\",\\\"vecContentItems\\\":[{\\\"100\\\":\\\"港股\\\"},{\\\"100\\\":\\\"腾讯控股\\\",\\\"101\\\":\\\"(00700)\\\"},{\\\"100\\\":\\\"308.40\\\",\\\"101\\\":\\\"-4.40\\\",\\\"102\\\":\\\"-1.41%\\\",\\\"4\\\":\\\"-1\\\"},{\\\"100\\\":\\\"最高\\\",\\\"101\\\":\\\"315.40\\\",\\\"102\\\":\\\"最低\\\",\\\"103\\\":\\\"307.40\\\"},{\\\"100\\\":\\\"市盈率\\\",\\\"101\\\":\\\"30.18\\\",\\\"102\\\":\\\"成交量\\\",\\\"103\\\":\\\"884.99万股\\\"},{\\\"100\\\":\\\"周息率\\\",\\\"101\\\":\\\"0.52\\\",\\\"102\\\":\\\"总市值\\\",\\\"103\\\":\\\"2.97万亿港元\\\"},{\\\"100\\\":\\\"今开\\\",\\\"101\\\":\\\"313.80港元\\\",\\\"102\\\":\\\"昨收\\\",\\\"103\\\":\\\"312.80港元\\\"},{\\\"100\\\":\\\"交易中\\\",\\\"101\\\":\\\"2022/08/24 14:28:59\\\"}]}]\\n\",\"strDescription\":\"\",\"strDestURL\":\"\",\"strDownloadURL\":\"\",\"strShareURL\":\"\",\"strTitle\":\"\"}]},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:29:26","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"stock\",\"intent\":\"price\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990847313138290688\",\"slots\":[{\"name\":\"date\",\"value\":\"2022-08-24\"},{\"name\":\"price_openclose\",\"value\":\"开盘价\"},{\"name\":\"stockname\",\"value\":\"腾讯控股\"}]}},\"response_text\":\"腾讯控股今天的开盘价是313.80港元。\"}"}}} +{"level":"info","time":"2022-08-24 14:29:26","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"stock\\\",\\\"intent\\\":\\\"price\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990847313138290688\\\",\\\"slots\\\":[{\\\"name\\\":\\\"date\\\",\\\"value\\\":\\\"2022-08-24\\\"},{\\\"name\\\":\\\"price_openclose\\\",\\\"value\\\":\\\"开盘价\\\"},{\\\"name\\\":\\\"stockname\\\",\\\"value\\\":\\\"腾讯控股\\\"}]}},\\\"response_text\\\":\\\"腾讯控股今天的开盘价是313.80港元。\\\",\\\"asr_recongize\\\":\\\"腾讯今天的开盘价是多少\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:31:43","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"帮我查下明天北京到深圳的火车票\",\"ip\":\"121.35.103.189\",\"originQuery\":\"帮我查下明天北京到深圳的火车票\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:31:43","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:31:43","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:31:43","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"帮我查下明天北京到深圳的火车票\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:31:43","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"其实我没有听懂,可以请你换个说法吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"其实我没有听懂,可以请你换个说法吗?\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322703447349_wj54uPiWTUGwD"}} +{"level":"debug","time":"2022-08-24 14:31:43","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"其实我没有听懂,可以请你换个说法吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"其实我没有听懂,可以请你换个说法吗?\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:31:43","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"其实我没有听懂,可以请你换个说法吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"其实我没有听懂,可以请你换个说法吗?\"}"}}} +{"level":"info","time":"2022-08-24 14:31:43","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"其实我没有听懂,可以请你换个说法吗?\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"其实我没有听懂,可以请你换个说法吗?\\\",\\\"asr_recongize\\\":\\\"帮我查下明天北京到深圳的火车票\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:32:05","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"翻译苹果\",\"ip\":\"121.35.103.189\",\"originQuery\":\"翻译苹果\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:32:05","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:32:05","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:32:05","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"翻译苹果\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:32:05","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"translate\",\"intent\":\"translate\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835451432669184\",\"slots\":[{\"name\":\"translate\",\"value\":\"苹果\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"titleSpeak\":\"false\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":1200,\"size\":\"SMALL\",\"url\":\"http://softfile.3g.qq.com/myapp/soft_imtt/dingdang/translate/translate_bg.jpg\",\"widthPixels\":1920}]},\"seeMore\":\"\"},\"listItems\":[{\"selfData\":{\"source\":\"中文\",\"sourceText\":\"苹果\",\"target\":\"英语\",\"targetText\":\"Apple\"},\"speakContent\":\"它的英语是:。\",\"textContent\":\"它的英语是:Apple。\",\"title\":\"\"}]}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322725502535_sFlLAViTXz3IB"}} +{"level":"debug","time":"2022-08-24 14:32:05","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"translate\",\"intent\":\"translate\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835451432669184\",\"slots\":[{\"name\":\"translate\",\"value\":\"苹果\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"titleSpeak\":\"false\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":1200,\"size\":\"SMALL\",\"url\":\"http://softfile.3g.qq.com/myapp/soft_imtt/dingdang/translate/translate_bg.jpg\",\"widthPixels\":1920}]},\"seeMore\":\"\"},\"listItems\":[{\"selfData\":{\"source\":\"中文\",\"sourceText\":\"苹果\",\"target\":\"英语\",\"targetText\":\"Apple\"},\"speakContent\":\"它的英语是:。\",\"textContent\":\"它的英语是:Apple。\",\"title\":\"\"}]}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:32:05","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"translate\",\"intent\":\"translate\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835451432669184\",\"slots\":[{\"name\":\"translate\",\"value\":\"苹果\"}]}},\"response_text\":\"它的英语是:Apple。\"}"}}} +{"level":"info","time":"2022-08-24 14:32:05","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"translate\\\",\\\"intent\\\":\\\"translate\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835451432669184\\\",\\\"slots\\\":[{\\\"name\\\":\\\"translate\\\",\\\"value\\\":\\\"苹果\\\"}]}},\\\"response_text\\\":\\\"它的英语是:Apple。\\\",\\\"asr_recongize\\\":\\\"翻译苹果\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:38","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"有什么电视剧\",\"ip\":\"121.35.103.189\",\"originQuery\":\"有什么电视剧\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:38","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:38","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:38","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"有什么电视剧\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:38","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没有理解到你的意思,可以换个方式问我吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我没有理解到你的意思,可以换个方式问我吗?\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322878870577_XKtV2wgrZq7BB"}} +{"level":"debug","time":"2022-08-24 14:34:38","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没有理解到你的意思,可以换个方式问我吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我没有理解到你的意思,可以换个方式问我吗?\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:34:38","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没有理解到你的意思,可以换个方式问我吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"我没有理解到你的意思,可以换个方式问我吗?\"}"}}} +{"level":"info","time":"2022-08-24 14:34:38","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"我没有理解到你的意思,可以换个方式问我吗?\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"我没有理解到你的意思,可以换个方式问我吗?\\\",\\\"asr_recongize\\\":\\\"有什么电视剧\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:53","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"深圳今天天气怎样\",\"ip\":\"121.35.103.189\",\"originQuery\":\"深圳今天天气怎样\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"深圳今天天气怎样\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 14:34:54","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"weather\",\"intent\":\"general_search\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835344003960832\",\"slots\":[{\"name\":\"datetime\",\"value\":\"2022-08-24\"},{\"city\":\"深圳\",\"name\":\"location\",\"province\":\"\",\"residual\":\"\",\"value\":\"深圳\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"https://ddsdk.html5.qq.com/dingdang/weather.html?gps=113.930412292,22.533319473\"},\"listItems\":[{\"selfData\":{\"eAction\":3,\"iRet\":0,\"sError\":\"\",\"sPlace\":\"\",\"vecCityWeatherInfo\":[{\"iDayIndex\":0,\"sCityID\":\"\",\"sCounty\":\"深圳\",\"sDisplayTips\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\",\"sDistrict\":\"\",\"sMoreUrl\":\"https://ddsdk.html5.qq.com/dingdang/weather.html?gps=113.930412292,22.533319473\",\"sProvince\":\"\",\"sWeatherTips\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\",\"stDobbyCurrentWeather\":{\"sAQI\":\"52\",\"sAQIDes\":\"空气良\",\"sAQILevel\":\"2\",\"sCloudrate\":\"0\",\"sDWeaIndex\":\"1\",\"sDescription\":\"阴,今天晚间22点钟后转小雨\",\"sDirection\":\"东风\",\"sDweather\":\"多云\",\"sHumidity\":\"0.52\",\"sPm25\":\"17\",\"sSpeed\":\"2级\",\"sTemperature\":\"33\",\"stDetailAddr\":{\"sAddress\":\"深圳市\",\"sCity\":\"深圳市\",\"sDistict\":\"\",\"sNation\":\"中国\",\"sProvince\":\"广东省\",\"sStreet\":\"\"}},\"stLiveIndex\":{\"iFromChannel\":1,\"vLiveIndex\":[{\"iCode\":0,\"sDay\":\"2022-08-24\",\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\",\"sStatus\":\"较不适宜\",\"sUrl\":\"\"},{\"iCode\":1,\"sDay\":\"2022-08-24\",\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\",\"sStatus\":\"很热\",\"sUrl\":\"\"},{\"iCode\":2,\"sDay\":\"2022-08-24\",\"sDesc\":\"强\",\"sLevel\":\"4\",\"sName\":\"紫外线\",\"sStatus\":\"强\",\"sUrl\":\"\"},{\"iCode\":3,\"sDay\":\"2022-08-24\",\"sDesc\":\"极易发\",\"sLevel\":\"4\",\"sName\":\"感冒\",\"sStatus\":\"极易发\",\"sUrl\":\"\"}]},\"stWeatherActivity\":{\"iSuggestion\":0,\"sActivity\":\"\",\"sReason\":\"\"},\"stWeatherSuggestion\":{\"sSuggestion\":\"\",\"sWeatherBaseInfo\":\"\"},\"stYWeatherInfo\":{\"sAQI\":\"60\",\"sAQIDes\":\"空气良\",\"sAQILevel\":\"2\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"1\",\"sDressingIndex\":\"\",\"sDweather\":\"多云\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"34\",\"sMinT\":\"28\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"24\",\"sTim\":\"2022-08-23\",\"sWeek\":\"周二\",\"sWind\":\"西南风\",\"sWindPower\":\"2级\",\"stHumidity\":{\"fAvg\":0.69999998807907104,\"fCurrent\":0.51999998092651367,\"fMax\":0.81999999284744263,\"fMin\":0.54000002145767212},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"强\",\"sLevel\":\"4\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},\"vBgImg\":[{\"eAstroType\":0,\"sImg\":\"http://softfile.3g.qq.com/myapp/soft_imtt/dingdangweather/bg/rain_0.png\",\"sMusic\":\"https://softimtt.myapp.com/browser/smart_service/weather/audio/rain.mp3\"}],\"vFutureIndex\":[],\"vWeatherWarning\":[{\"sAlarmLeveNum\":\"02\",\"sAlarmTypeNum\":\"01\",\"sAlertId\":\"44030041600000_20220824120300\",\"sCity\":\"广东省\",\"sCityId\":\"\",\"sContent\":\"【深圳市台风蓝色预警信号升级为黄色】深圳市气象台2022年08月24日12时将全市台风蓝色预警信号升级为黄色,预计受台风“马鞍”影响,24日夜间我市风雨加大,25日有暴雨局部大暴雨,最大阵风陆地9-10级、沿海10-11级、海区和高地12级,信号可能持续1天。全市进入台风防御状态。\",\"sIssueTime\":\"2022-08-24 12:01\",\"sLevel\":\"黄色\",\"sLinkSuffix\":\"\",\"sProvince\":\"广东省\",\"sStation\":\"广东省深圳市\",\"sTitle\":\"预警中\",\"sType\":\"台风\"}],\"vcHourlyWeatherInfo\":[{\"sAQI\":\"52\",\"sAQIDes\":\"空气良\",\"sAQILevel\":\"2\",\"sDWeaIndex\":\"1\",\"sDweather\":\"多云\",\"sHumidity\":\"0.52\",\"sName\":\"深圳\",\"sPm25\":\"17\",\"sPrecipitation\":\"0\",\"sTemperature\":\"33\",\"sTim\":\"2022-08-24 14:00\"},{\"sAQI\":\"24\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"1\",\"sDweather\":\"多云\",\"sHumidity\":\"0.67\",\"sName\":\"深圳\",\"sPm25\":\"17\",\"sPrecipitation\":\"0\",\"sTemperature\":\"32\",\"sTim\":\"2022-08-24 15:00\"},{\"sAQI\":\"23\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"2\",\"sDweather\":\"阴\",\"sHumidity\":\"0.69\",\"sName\":\"深圳\",\"sPm25\":\"16\",\"sPrecipitation\":\"0\",\"sTemperature\":\"31\",\"sTim\":\"2022-08-24 16:00\"},{\"sAQI\":\"21\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"2\",\"sDweather\":\"阴\",\"sHumidity\":\"0.64\",\"sName\":\"深圳\",\"sPm25\":\"15\",\"sPrecipitation\":\"0\",\"sTemperature\":\"29\",\"sTim\":\"2022-08-24 17:00\"},{\"sAQI\":\"19\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"2\",\"sDweather\":\"阴\",\"sHumidity\":\"0.65\",\"sName\":\"深圳\",\"sPm25\":\"13\",\"sPrecipitation\":\"0\",\"sTemperature\":\"29\",\"sTim\":\"2022-08-24 18:00\"},{\"sAQI\":\"16\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"1\",\"sDweather\":\"多云\",\"sHumidity\":\"0.68\",\"sName\":\"深圳\",\"sPm25\":\"11\",\"sPrecipitation\":\"0\",\"sTemperature\":\"28\",\"sTim\":\"2022-08-24 19:00\"},{\"sAQI\":\"14\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.70\",\"sName\":\"深圳\",\"sPm25\":\"10\",\"sPrecipitation\":\"0.217500001\",\"sTemperature\":\"28\",\"sTim\":\"2022-08-24 20:00\"},{\"sAQI\":\"14\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.73\",\"sName\":\"深圳\",\"sPm25\":\"10\",\"sPrecipitation\":\"0.492799997\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-24 21:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.74\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-24 22:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.74\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-24 23:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.77\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 00:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.81\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 01:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.82\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"1.309499979\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 02:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"5\",\"sDweather\":\"大雨\",\"sHumidity\":\"0.85\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"6.417200089\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 03:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.87\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"1.873700023\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 04:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.83\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"2.172499895\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 05:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.81\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"1.069300056\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 06:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.81\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-25 07:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.80\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"1.390200019\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-25 08:00\"},{\"sAQI\":\"14\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.79\",\"sName\":\"深圳\",\"sPm25\":\"10\",\"sPrecipitation\":\"0.092500001\",\"sTemperature\":\"28\",\"sTim\":\"2022-08-25 09:00\"},{\"sAQI\":\"14\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"5\",\"sDweather\":\"大雨\",\"sHumidity\":\"0.79\",\"sName\":\"深圳\",\"sPm25\":\"10\",\"sPrecipitation\":\"4.237800121\",\"sTemperature\":\"28\",\"sTim\":\"2022-08-25 10:00\"},{\"sAQI\":\"16\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"5\",\"sDweather\":\"大雨\",\"sHumidity\":\"0.76\",\"sName\":\"深圳\",\"sPm25\":\"11\",\"sPrecipitation\":\"3.531300068\",\"sTemperature\":\"29\",\"sTim\":\"2022-08-25 11:00\"},{\"sAQI\":\"16\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.74\",\"sName\":\"深圳\",\"sPm25\":\"11\",\"sPrecipitation\":\"0.183799997\",\"sTemperature\":\"29\",\"sTim\":\"2022-08-25 12:00\"},{\"sAQI\":\"17\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.79\",\"sName\":\"深圳\",\"sPm25\":\"12\",\"sPrecipitation\":\"0.612699986\",\"sTemperature\":\"30\",\"sTim\":\"2022-08-25 13:00\"}],\"vcWeatherInfo\":[{\"sAQI\":\"52\",\"sAQIDes\":\"空气良\",\"sAQILevel\":\"2\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"3\",\"sDressingIndex\":\"\",\"sDweather\":\"小雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"33\",\"sMinT\":\"25\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"17\",\"sTim\":\"2022-08-24\",\"sWeek\":\"周三\",\"sWind\":\"东北风\",\"sWindPower\":\"3级\",\"stHumidity\":{\"fAvg\":0.68000000715255737,\"fCurrent\":0.51999998092651367,\"fMax\":0.80000001192092896,\"fMin\":0.51999998092651367},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"强\",\"sLevel\":\"4\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"极易发\",\"sLevel\":\"4\",\"sName\":\"感冒\"}]},{\"sAQI\":\"18\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"4\",\"sDressingIndex\":\"\",\"sDweather\":\"中雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"30\",\"sMinT\":\"26\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"12\",\"sTim\":\"2022-08-25\",\"sWeek\":\"周四\",\"sWind\":\"东南风\",\"sWindPower\":\"5级\",\"stHumidity\":{\"fAvg\":0.79000002145767212,\"fCurrent\":0.51999998092651367,\"fMax\":0.87000000476837158,\"fMin\":0.67000001668930054},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"热\",\"sLevel\":\"3\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"最弱\",\"sLevel\":\"1\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"34\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"4\",\"sDressingIndex\":\"\",\"sDweather\":\"中雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"31\",\"sMinT\":\"27\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"23\",\"sTim\":\"2022-08-26\",\"sWeek\":\"周五\",\"sWind\":\"东南风\",\"sWindPower\":\"3级\",\"stHumidity\":{\"fAvg\":0.79000002145767212,\"fCurrent\":0.51999998092651367,\"fMax\":0.8399999737739563,\"fMin\":0.74000000953674316},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"热\",\"sLevel\":\"3\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"最弱\",\"sLevel\":\"1\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"19\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"3\",\"sDressingIndex\":\"\",\"sDweather\":\"小雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"32\",\"sMinT\":\"27\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"13\",\"sTim\":\"2022-08-27\",\"sWeek\":\"周六\",\"sWind\":\"西南风\",\"sWindPower\":\"3级\",\"stHumidity\":{\"fAvg\":0.75,\"fCurrent\":0.51999998092651367,\"fMax\":0.81999999284744263,\"fMin\":0.6600000262260437},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"弱\",\"sLevel\":\"2\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"20\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"1\",\"sDressingIndex\":\"\",\"sDweather\":\"多云\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"33\",\"sMinT\":\"27\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"13\",\"sTim\":\"2022-08-28\",\"sWeek\":\"周日\",\"sWind\":\"西南风\",\"sWindPower\":\"3级\",\"stHumidity\":{\"fAvg\":0.74000000953674316,\"fCurrent\":0.51999998092651367,\"fMax\":0.81999999284744263,\"fMin\":0.61000001430511475},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"强\",\"sLevel\":\"4\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"19\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"2\",\"sDressingIndex\":\"\",\"sDweather\":\"阴\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"32\",\"sMinT\":\"27\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"13\",\"sTim\":\"2022-08-29\",\"sWeek\":\"周一\",\"sWind\":\"西南风\",\"sWindPower\":\"2级\",\"stHumidity\":{\"fAvg\":0.72000002861022949,\"fCurrent\":0.51999998092651367,\"fMax\":0.79000002145767212,\"fMin\":0.63999998569488525},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"最弱\",\"sLevel\":\"1\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"17\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"3\",\"sDressingIndex\":\"\",\"sDweather\":\"小雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"34\",\"sMinT\":\"26\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"11\",\"sTim\":\"2022-08-30\",\"sWeek\":\"周二\",\"sWind\":\"西南风\",\"sWindPower\":\"2级\",\"stHumidity\":{\"fAvg\":0.69999998807907104,\"fCurrent\":0.51999998092651367,\"fMax\":0.75,\"fMin\":0.60000002384185791},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"弱\",\"sLevel\":\"2\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"极易发\",\"sLevel\":\"4\",\"sName\":\"感冒\"}]}]}]},\"textContent\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\"}]},\"json_template\":[{\"eDataType\":1,\"strContentData\":\"\",\"strContentID\":\"\",\"strContentURL\":\"\",\"strData\":\"\",\"strDescription\":\"\",\"strDestURL\":\"\",\"strDownloadURL\":\"\",\"strShareURL\":\"\",\"strTitle\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\"}]},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661322894089406_xo0TV5sd7bMRL"}} +{"level":"debug","time":"2022-08-24 14:34:54","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"weather\",\"intent\":\"general_search\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835344003960832\",\"slots\":[{\"name\":\"datetime\",\"value\":\"2022-08-24\"},{\"city\":\"深圳\",\"name\":\"location\",\"province\":\"\",\"residual\":\"\",\"value\":\"深圳\"}]}},\"payload\":{\"data\":{\"json\":{\"controlInfo\":{\"audioConsole\":\"\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"https://ddsdk.html5.qq.com/dingdang/weather.html?gps=113.930412292,22.533319473\"},\"listItems\":[{\"selfData\":{\"eAction\":3,\"iRet\":0,\"sError\":\"\",\"sPlace\":\"\",\"vecCityWeatherInfo\":[{\"iDayIndex\":0,\"sCityID\":\"\",\"sCounty\":\"深圳\",\"sDisplayTips\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\",\"sDistrict\":\"\",\"sMoreUrl\":\"https://ddsdk.html5.qq.com/dingdang/weather.html?gps=113.930412292,22.533319473\",\"sProvince\":\"\",\"sWeatherTips\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\",\"stDobbyCurrentWeather\":{\"sAQI\":\"52\",\"sAQIDes\":\"空气良\",\"sAQILevel\":\"2\",\"sCloudrate\":\"0\",\"sDWeaIndex\":\"1\",\"sDescription\":\"阴,今天晚间22点钟后转小雨\",\"sDirection\":\"东风\",\"sDweather\":\"多云\",\"sHumidity\":\"0.52\",\"sPm25\":\"17\",\"sSpeed\":\"2级\",\"sTemperature\":\"33\",\"stDetailAddr\":{\"sAddress\":\"深圳市\",\"sCity\":\"深圳市\",\"sDistict\":\"\",\"sNation\":\"中国\",\"sProvince\":\"广东省\",\"sStreet\":\"\"}},\"stLiveIndex\":{\"iFromChannel\":1,\"vLiveIndex\":[{\"iCode\":0,\"sDay\":\"2022-08-24\",\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\",\"sStatus\":\"较不适宜\",\"sUrl\":\"\"},{\"iCode\":1,\"sDay\":\"2022-08-24\",\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\",\"sStatus\":\"很热\",\"sUrl\":\"\"},{\"iCode\":2,\"sDay\":\"2022-08-24\",\"sDesc\":\"强\",\"sLevel\":\"4\",\"sName\":\"紫外线\",\"sStatus\":\"强\",\"sUrl\":\"\"},{\"iCode\":3,\"sDay\":\"2022-08-24\",\"sDesc\":\"极易发\",\"sLevel\":\"4\",\"sName\":\"感冒\",\"sStatus\":\"极易发\",\"sUrl\":\"\"}]},\"stWeatherActivity\":{\"iSuggestion\":0,\"sActivity\":\"\",\"sReason\":\"\"},\"stWeatherSuggestion\":{\"sSuggestion\":\"\",\"sWeatherBaseInfo\":\"\"},\"stYWeatherInfo\":{\"sAQI\":\"60\",\"sAQIDes\":\"空气良\",\"sAQILevel\":\"2\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"1\",\"sDressingIndex\":\"\",\"sDweather\":\"多云\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"34\",\"sMinT\":\"28\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"24\",\"sTim\":\"2022-08-23\",\"sWeek\":\"周二\",\"sWind\":\"西南风\",\"sWindPower\":\"2级\",\"stHumidity\":{\"fAvg\":0.69999998807907104,\"fCurrent\":0.51999998092651367,\"fMax\":0.81999999284744263,\"fMin\":0.54000002145767212},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"强\",\"sLevel\":\"4\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},\"vBgImg\":[{\"eAstroType\":0,\"sImg\":\"http://softfile.3g.qq.com/myapp/soft_imtt/dingdangweather/bg/rain_0.png\",\"sMusic\":\"https://softimtt.myapp.com/browser/smart_service/weather/audio/rain.mp3\"}],\"vFutureIndex\":[],\"vWeatherWarning\":[{\"sAlarmLeveNum\":\"02\",\"sAlarmTypeNum\":\"01\",\"sAlertId\":\"44030041600000_20220824120300\",\"sCity\":\"广东省\",\"sCityId\":\"\",\"sContent\":\"【深圳市台风蓝色预警信号升级为黄色】深圳市气象台2022年08月24日12时将全市台风蓝色预警信号升级为黄色,预计受台风“马鞍”影响,24日夜间我市风雨加大,25日有暴雨局部大暴雨,最大阵风陆地9-10级、沿海10-11级、海区和高地12级,信号可能持续1天。全市进入台风防御状态。\",\"sIssueTime\":\"2022-08-24 12:01\",\"sLevel\":\"黄色\",\"sLinkSuffix\":\"\",\"sProvince\":\"广东省\",\"sStation\":\"广东省深圳市\",\"sTitle\":\"预警中\",\"sType\":\"台风\"}],\"vcHourlyWeatherInfo\":[{\"sAQI\":\"52\",\"sAQIDes\":\"空气良\",\"sAQILevel\":\"2\",\"sDWeaIndex\":\"1\",\"sDweather\":\"多云\",\"sHumidity\":\"0.52\",\"sName\":\"深圳\",\"sPm25\":\"17\",\"sPrecipitation\":\"0\",\"sTemperature\":\"33\",\"sTim\":\"2022-08-24 14:00\"},{\"sAQI\":\"24\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"1\",\"sDweather\":\"多云\",\"sHumidity\":\"0.67\",\"sName\":\"深圳\",\"sPm25\":\"17\",\"sPrecipitation\":\"0\",\"sTemperature\":\"32\",\"sTim\":\"2022-08-24 15:00\"},{\"sAQI\":\"23\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"2\",\"sDweather\":\"阴\",\"sHumidity\":\"0.69\",\"sName\":\"深圳\",\"sPm25\":\"16\",\"sPrecipitation\":\"0\",\"sTemperature\":\"31\",\"sTim\":\"2022-08-24 16:00\"},{\"sAQI\":\"21\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"2\",\"sDweather\":\"阴\",\"sHumidity\":\"0.64\",\"sName\":\"深圳\",\"sPm25\":\"15\",\"sPrecipitation\":\"0\",\"sTemperature\":\"29\",\"sTim\":\"2022-08-24 17:00\"},{\"sAQI\":\"19\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"2\",\"sDweather\":\"阴\",\"sHumidity\":\"0.65\",\"sName\":\"深圳\",\"sPm25\":\"13\",\"sPrecipitation\":\"0\",\"sTemperature\":\"29\",\"sTim\":\"2022-08-24 18:00\"},{\"sAQI\":\"16\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"1\",\"sDweather\":\"多云\",\"sHumidity\":\"0.68\",\"sName\":\"深圳\",\"sPm25\":\"11\",\"sPrecipitation\":\"0\",\"sTemperature\":\"28\",\"sTim\":\"2022-08-24 19:00\"},{\"sAQI\":\"14\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.70\",\"sName\":\"深圳\",\"sPm25\":\"10\",\"sPrecipitation\":\"0.217500001\",\"sTemperature\":\"28\",\"sTim\":\"2022-08-24 20:00\"},{\"sAQI\":\"14\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.73\",\"sName\":\"深圳\",\"sPm25\":\"10\",\"sPrecipitation\":\"0.492799997\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-24 21:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.74\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-24 22:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.74\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-24 23:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.77\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 00:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.81\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 01:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.82\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"1.309499979\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 02:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"5\",\"sDweather\":\"大雨\",\"sHumidity\":\"0.85\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"6.417200089\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 03:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.87\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"1.873700023\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 04:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.83\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"2.172499895\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 05:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.81\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"1.069300056\",\"sTemperature\":\"26\",\"sTim\":\"2022-08-25 06:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"16\",\"sDweather\":\"风\",\"sHumidity\":\"0.81\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"0\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-25 07:00\"},{\"sAQI\":\"13\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"4\",\"sDweather\":\"中雨\",\"sHumidity\":\"0.80\",\"sName\":\"深圳\",\"sPm25\":\"9\",\"sPrecipitation\":\"1.390200019\",\"sTemperature\":\"27\",\"sTim\":\"2022-08-25 08:00\"},{\"sAQI\":\"14\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.79\",\"sName\":\"深圳\",\"sPm25\":\"10\",\"sPrecipitation\":\"0.092500001\",\"sTemperature\":\"28\",\"sTim\":\"2022-08-25 09:00\"},{\"sAQI\":\"14\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"5\",\"sDweather\":\"大雨\",\"sHumidity\":\"0.79\",\"sName\":\"深圳\",\"sPm25\":\"10\",\"sPrecipitation\":\"4.237800121\",\"sTemperature\":\"28\",\"sTim\":\"2022-08-25 10:00\"},{\"sAQI\":\"16\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"5\",\"sDweather\":\"大雨\",\"sHumidity\":\"0.76\",\"sName\":\"深圳\",\"sPm25\":\"11\",\"sPrecipitation\":\"3.531300068\",\"sTemperature\":\"29\",\"sTim\":\"2022-08-25 11:00\"},{\"sAQI\":\"16\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.74\",\"sName\":\"深圳\",\"sPm25\":\"11\",\"sPrecipitation\":\"0.183799997\",\"sTemperature\":\"29\",\"sTim\":\"2022-08-25 12:00\"},{\"sAQI\":\"17\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sDWeaIndex\":\"3\",\"sDweather\":\"小雨\",\"sHumidity\":\"0.79\",\"sName\":\"深圳\",\"sPm25\":\"12\",\"sPrecipitation\":\"0.612699986\",\"sTemperature\":\"30\",\"sTim\":\"2022-08-25 13:00\"}],\"vcWeatherInfo\":[{\"sAQI\":\"52\",\"sAQIDes\":\"空气良\",\"sAQILevel\":\"2\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"3\",\"sDressingIndex\":\"\",\"sDweather\":\"小雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"33\",\"sMinT\":\"25\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"17\",\"sTim\":\"2022-08-24\",\"sWeek\":\"周三\",\"sWind\":\"东北风\",\"sWindPower\":\"3级\",\"stHumidity\":{\"fAvg\":0.68000000715255737,\"fCurrent\":0.51999998092651367,\"fMax\":0.80000001192092896,\"fMin\":0.51999998092651367},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"强\",\"sLevel\":\"4\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"极易发\",\"sLevel\":\"4\",\"sName\":\"感冒\"}]},{\"sAQI\":\"18\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"4\",\"sDressingIndex\":\"\",\"sDweather\":\"中雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"30\",\"sMinT\":\"26\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"12\",\"sTim\":\"2022-08-25\",\"sWeek\":\"周四\",\"sWind\":\"东南风\",\"sWindPower\":\"5级\",\"stHumidity\":{\"fAvg\":0.79000002145767212,\"fCurrent\":0.51999998092651367,\"fMax\":0.87000000476837158,\"fMin\":0.67000001668930054},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"热\",\"sLevel\":\"3\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"最弱\",\"sLevel\":\"1\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"34\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"4\",\"sDressingIndex\":\"\",\"sDweather\":\"中雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"31\",\"sMinT\":\"27\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"23\",\"sTim\":\"2022-08-26\",\"sWeek\":\"周五\",\"sWind\":\"东南风\",\"sWindPower\":\"3级\",\"stHumidity\":{\"fAvg\":0.79000002145767212,\"fCurrent\":0.51999998092651367,\"fMax\":0.8399999737739563,\"fMin\":0.74000000953674316},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"热\",\"sLevel\":\"3\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"最弱\",\"sLevel\":\"1\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"19\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"3\",\"sDressingIndex\":\"\",\"sDweather\":\"小雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"32\",\"sMinT\":\"27\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"13\",\"sTim\":\"2022-08-27\",\"sWeek\":\"周六\",\"sWind\":\"西南风\",\"sWindPower\":\"3级\",\"stHumidity\":{\"fAvg\":0.75,\"fCurrent\":0.51999998092651367,\"fMax\":0.81999999284744263,\"fMin\":0.6600000262260437},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"弱\",\"sLevel\":\"2\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"20\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"1\",\"sDressingIndex\":\"\",\"sDweather\":\"多云\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"33\",\"sMinT\":\"27\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"13\",\"sTim\":\"2022-08-28\",\"sWeek\":\"周日\",\"sWind\":\"西南风\",\"sWindPower\":\"3级\",\"stHumidity\":{\"fAvg\":0.74000000953674316,\"fCurrent\":0.51999998092651367,\"fMax\":0.81999999284744263,\"fMin\":0.61000001430511475},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"强\",\"sLevel\":\"4\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"19\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"2\",\"sDressingIndex\":\"\",\"sDweather\":\"阴\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"32\",\"sMinT\":\"27\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"13\",\"sTim\":\"2022-08-29\",\"sWeek\":\"周一\",\"sWind\":\"西南风\",\"sWindPower\":\"2级\",\"stHumidity\":{\"fAvg\":0.72000002861022949,\"fCurrent\":0.51999998092651367,\"fMax\":0.79000002145767212,\"fMin\":0.63999998569488525},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"最弱\",\"sLevel\":\"1\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"易发\",\"sLevel\":\"3\",\"sName\":\"感冒\"}]},{\"sAQI\":\"17\",\"sAQIDes\":\"空气优\",\"sAQILevel\":\"1\",\"sCurrentT\":\"33\",\"sDWeaIndex\":\"3\",\"sDressingIndex\":\"\",\"sDweather\":\"小雨\",\"sHoliday\":\"\",\"sJumpUrl\":\"\",\"sLunarYear\":\"\",\"sMaxT\":\"34\",\"sMinT\":\"26\",\"sName\":\"深圳\",\"sNewCurT\":\"33\",\"sPm25\":\"11\",\"sTim\":\"2022-08-30\",\"sWeek\":\"周二\",\"sWind\":\"西南风\",\"sWindPower\":\"2级\",\"stHumidity\":{\"fAvg\":0.69999998807907104,\"fCurrent\":0.51999998092651367,\"fMax\":0.75,\"fMin\":0.60000002384185791},\"stWeatherDetail\":{\"nDayWeaIndex\":0,\"nNightWeaIndex\":0,\"sDayWeather\":\"\",\"sDayWind\":\"\",\"sDayWindPower\":\"\",\"sNightWeather\":\"\",\"sNightWind\":\"\",\"sNightWindPower\":\"\"},\"vDobbyLiveIndex\":[{\"iType\":0,\"sDesc\":\"较不适宜\",\"sLevel\":\"3\",\"sName\":\"洗车\"},{\"iType\":1,\"sDesc\":\"很热\",\"sLevel\":\"2\",\"sName\":\"穿衣\"},{\"iType\":2,\"sDesc\":\"弱\",\"sLevel\":\"2\",\"sName\":\"紫外线\"},{\"iType\":3,\"sDesc\":\"极易发\",\"sLevel\":\"4\",\"sName\":\"感冒\"}]}]}]},\"textContent\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\"}]},\"json_template\":[{\"eDataType\":1,\"strContentData\":\"\",\"strContentID\":\"\",\"strContentURL\":\"\",\"strData\":\"\",\"strDescription\":\"\",\"strDestURL\":\"\",\"strDownloadURL\":\"\",\"strShareURL\":\"\",\"strTitle\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\"}]},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 14:34:54","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"weather\",\"intent\":\"general_search\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835344003960832\",\"slots\":[{\"name\":\"datetime\",\"value\":\"2022-08-24\"},{\"city\":\"深圳\",\"name\":\"location\",\"province\":\"\",\"residual\":\"\",\"value\":\"深圳\"}]}},\"response_text\":\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\"}"}}} +{"level":"info","time":"2022-08-24 14:34:54","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"weather\\\",\\\"intent\\\":\\\"general_search\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835344003960832\\\",\\\"slots\\\":[{\\\"name\\\":\\\"datetime\\\",\\\"value\\\":\\\"2022-08-24\\\"},{\\\"city\\\":\\\"深圳\\\",\\\"name\\\":\\\"location\\\",\\\"province\\\":\\\"\\\",\\\"residual\\\":\\\"\\\",\\\"value\\\":\\\"深圳\\\"}]}},\\\"response_text\\\":\\\"深圳今天有台风预警,请注意防御。今日有小雨,气温25度到33度,空气质量良。\\\",\\\"asr_recongize\\\":\\\"深圳今天天气怎样\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:17:25","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"电台\",\"ip\":\"121.35.103.189\",\"originQuery\":\"电台\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:17:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:17:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:17:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"电台\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:17:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"fm\",\"intent\":\"play_radio\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835382587363328\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"false\",\"textSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"listUpdateType\":\"\",\"playMode\":\"\",\"seeMore\":\"\",\"selfData\":{\"displayFormat\":2,\"subService\":3},\"startIndex\":0},\"listItems\":[{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/276/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/sso/48/1641438475219_mv9SoJP78.jpeg\",\"widthPixels\":0}]},\"mediaId\":\"50_276\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_276\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"第一财经广播\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"第一财经广播\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/1163/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/2020/0405/20200405112241.jpeg\",\"widthPixels\":0}]},\"mediaId\":\"50_1163\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_1163\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"西湖之声\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"西湖之声\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/273/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/2014/0909/20140909125130474.jpg\",\"widthPixels\":0}]},\"mediaId\":\"50_273\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_273\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"上海流行音乐LoveRadio\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"上海流行音乐LoveRadio\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/4848/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/sso/198/1631608611268_yOwdpDG9p.jpeg\",\"widthPixels\":0}]},\"mediaId\":\"50_4848\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_4848\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"广州新闻资讯广播\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"广州新闻资讯广播\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/1219/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/2016/0911/20160911071925.jpeg\",\"widthPixels\":0}]},\"mediaId\":\"50_1219\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_1219\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"私家车999\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"私家车999\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/4928/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/2015/0202/20150202170905391.jpg\",\"widthPixels\":0}]},\"mediaId\":\"50_4928\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_4928\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"上海五星体育\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"上海五星体育\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}]}},\"response_text\":\"推荐你听听最近很火的第一财经广播。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661325445907454_77lhsmARM2uXF"}} +{"level":"debug","time":"2022-08-24 15:17:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"fm\",\"intent\":\"play_radio\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835382587363328\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"false\",\"textSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"listUpdateType\":\"\",\"playMode\":\"\",\"seeMore\":\"\",\"selfData\":{\"displayFormat\":2,\"subService\":3},\"startIndex\":0},\"listItems\":[{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/276/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/sso/48/1641438475219_mv9SoJP78.jpeg\",\"widthPixels\":0}]},\"mediaId\":\"50_276\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_276\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"第一财经广播\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"第一财经广播\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/1163/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/2020/0405/20200405112241.jpeg\",\"widthPixels\":0}]},\"mediaId\":\"50_1163\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_1163\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"西湖之声\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"西湖之声\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/273/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/2014/0909/20140909125130474.jpg\",\"widthPixels\":0}]},\"mediaId\":\"50_273\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_273\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"上海流行音乐LoveRadio\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"上海流行音乐LoveRadio\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/4848/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/sso/198/1631608611268_yOwdpDG9p.jpeg\",\"widthPixels\":0}]},\"mediaId\":\"50_4848\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_4848\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"广州新闻资讯广播\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"广州新闻资讯广播\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/1219/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/2016/0911/20160911071925.jpeg\",\"widthPixels\":0}]},\"mediaId\":\"50_1219\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_1219\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"私家车999\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"私家车999\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"true\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"http://lhttp.qingting.fm/live/4928/64k.mp3\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[{\"heightPixels\":0,\"size\":\"\",\"url\":\"http://pic.qtfm.cn/2015/0202/20150202170905391.jpg\",\"widthPixels\":0}]},\"mediaId\":\"50_4928\",\"selfData\":{\"iAccurateMatch\":0,\"iLine\":0,\"iOffSet\":0,\"iPlayCount\":0,\"iShowNum\":0,\"lUpdateTime\":0,\"sAlbum\":\"\",\"sAlbumId\":\"50_4928\",\"sAnchor\":\"\",\"sArea\":\"\",\"sShowName\":\"上海五星体育\",\"sSource\":\"\",\"vLive\":[]},\"textContent\":\"\",\"title\":\"上海五星体育\",\"video\":{\"metadata\":{\"childId\":\"\",\"expandAbility\":{\"isSupportPlayMode\":\"\"},\"groupId\":\"\",\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}]}},\"response_text\":\"推荐你听听最近很火的第一财经广播。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:17:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"fm\",\"intent\":\"play_radio\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835382587363328\"}},\"response_text\":\"推荐你听听最近很火的第一财经广播。\",\"listItems\":[{\"url\":\"http://lhttp.qingting.fm/live/276/64k.mp3\",\"title\":\"第一财经广播\",\"content\":\"\",\"mediaId\":\"50_276\"},{\"url\":\"http://lhttp.qingting.fm/live/1163/64k.mp3\",\"title\":\"西湖之声\",\"content\":\"\",\"mediaId\":\"50_1163\"},{\"url\":\"http://lhttp.qingting.fm/live/273/64k.mp3\",\"title\":\"上海流行音乐LoveRadio\",\"content\":\"\",\"mediaId\":\"50_273\"},{\"url\":\"http://lhttp.qingting.fm/live/4848/64k.mp3\",\"title\":\"广州新闻资讯广播\",\"content\":\"\",\"mediaId\":\"50_4848\"},{\"url\":\"http://lhttp.qingting.fm/live/1219/64k.mp3\",\"title\":\"私家车999\",\"content\":\"\",\"mediaId\":\"50_1219\"},{\"url\":\"http://lhttp.qingting.fm/live/4928/64k.mp3\",\"title\":\"上海五星体育\",\"content\":\"\",\"mediaId\":\"50_4928\"}]}"}}} +{"level":"info","time":"2022-08-24 15:17:25","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"fm\\\",\\\"intent\\\":\\\"play_radio\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835382587363328\\\"}},\\\"response_text\\\":\\\"推荐你听听最近很火的第一财经广播。\\\",\\\"asr_recongize\\\":\\\"电台\\\",\\\"listItems\\\":[{\\\"url\\\":\\\"http://lhttp.qingting.fm/live/276/64k.mp3\\\",\\\"title\\\":\\\"第一财经广播\\\",\\\"content\\\":\\\"\\\",\\\"mediaId\\\":\\\"50_276\\\"},{\\\"url\\\":\\\"http://lhttp.qingting.fm/live/1163/64k.mp3\\\",\\\"title\\\":\\\"西湖之声\\\",\\\"content\\\":\\\"\\\",\\\"mediaId\\\":\\\"50_1163\\\"},{\\\"url\\\":\\\"http://lhttp.qingting.fm/live/273/64k.mp3\\\",\\\"title\\\":\\\"上海流行音乐LoveRadio\\\",\\\"content\\\":\\\"\\\",\\\"mediaId\\\":\\\"50_273\\\"},{\\\"url\\\":\\\"http://lhttp.qingting.fm/live/4848/64k.mp3\\\",\\\"title\\\":\\\"广州新闻资讯广播\\\",\\\"content\\\":\\\"\\\",\\\"mediaId\\\":\\\"50_4848\\\"},{\\\"url\\\":\\\"http://lhttp.qingting.fm/live/1219/64k.mp3\\\",\\\"title\\\":\\\"私家车999\\\",\\\"content\\\":\\\"\\\",\\\"mediaId\\\":\\\"50_1219\\\"},{\\\"url\\\":\\\"http://lhttp.qingting.fm/live/4928/64k.mp3\\\",\\\"title\\\":\\\"上海五星体育\\\",\\\"content\\\":\\\"\\\",\\\"mediaId\\\":\\\"50_4928\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:49","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放阿尔法波音\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放阿尔法波音\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:49","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:49","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:49","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放阿尔法波音\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:49","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"singer\",\"value\":\"阿尔法波音\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"selfData\":{\"displayFormat\":1,\"playMode\":0}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":302000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000um8Lc0TMpp7.m4a?fromtag=30107&guid=2000000107&uin=0&vkey=511A15758BD53C25D9EBFB143F7FBBE9797DEBB61D254201C2928635828B2D93E73D35F4667E1337F52AFBE9EC71D3C8E07C6667B36EC206\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000um8Lc0TMpp7\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M00000142Uhb14ffUA_1.jpg\"}]},\"mediaId\":\"246008042\",\"selfData\":{\"album\":\"大脑开发音乐 - 阿尔法音乐为了开发大脑\",\"albumId\":\"9440782\",\"albumPubTime\":\"2019-12-03\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"阿尔法波音\",\"singerId\":\"4649039\",\"singerPics\":[],\"song\":\"小宝宝\",\"songId\":\"246008042\",\"songMid\":\"000um8Lc0TMpp7\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"阿尔法波音\",\"textContent\":\"大脑开发音乐 - 阿尔法音乐为了开发大脑\",\"title\":\"小宝宝\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"这就开始播放阿尔法波音的歌。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326369397737_teujyYrv0W7bP"}} +{"level":"debug","time":"2022-08-24 15:32:49","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"singer\",\"value\":\"阿尔法波音\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"selfData\":{\"displayFormat\":1,\"playMode\":0}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":302000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000um8Lc0TMpp7.m4a?fromtag=30107&guid=2000000107&uin=0&vkey=511A15758BD53C25D9EBFB143F7FBBE9797DEBB61D254201C2928635828B2D93E73D35F4667E1337F52AFBE9EC71D3C8E07C6667B36EC206\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000um8Lc0TMpp7\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M00000142Uhb14ffUA_1.jpg\"}]},\"mediaId\":\"246008042\",\"selfData\":{\"album\":\"大脑开发音乐 - 阿尔法音乐为了开发大脑\",\"albumId\":\"9440782\",\"albumPubTime\":\"2019-12-03\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"阿尔法波音\",\"singerId\":\"4649039\",\"singerPics\":[],\"song\":\"小宝宝\",\"songId\":\"246008042\",\"songMid\":\"000um8Lc0TMpp7\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"阿尔法波音\",\"textContent\":\"大脑开发音乐 - 阿尔法音乐为了开发大脑\",\"title\":\"小宝宝\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"这就开始播放阿尔法波音的歌。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:32:49","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"singer\",\"value\":\"阿尔法波音\"}]}},\"response_text\":\"您的设备尚未授权,请前往格力+手机应用绑定授权。\",\"listItems\":[{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000um8Lc0TMpp7.m4a?fromtag=30107&guid=2000000107&uin=0&vkey=511A15758BD53C25D9EBFB143F7FBBE9797DEBB61D254201C2928635828B2D93E73D35F4667E1337F52AFBE9EC71D3C8E07C6667B36EC206\",\"singer\":\"阿尔法波音\",\"song\":\"小宝宝\",\"mediaId\":\"246008042\",\"songId\":\"246008042\"}]}"}}} +{"level":"info","time":"2022-08-24 15:32:49","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"music\\\",\\\"intent\\\":\\\"play\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835315751129088\\\",\\\"slots\\\":[{\\\"name\\\":\\\"singer\\\",\\\"value\\\":\\\"阿尔法波音\\\"}]}},\\\"response_text\\\":\\\"您的设备尚未授权,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放阿尔法波音\\\",\\\"listItems\\\":[{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400000um8Lc0TMpp7.m4a?fromtag=30107\\u0026guid=2000000107\\u0026uin=0\\u0026vkey=511A15758BD53C25D9EBFB143F7FBBE9797DEBB61D254201C2928635828B2D93E73D35F4667E1337F52AFBE9EC71D3C8E07C6667B36EC206\\\",\\\"singer\\\":\\\"阿尔法波音\\\",\\\"song\\\":\\\"小宝宝\\\",\\\"mediaId\\\":\\\"246008042\\\",\\\"songId\\\":\\\"246008042\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:58","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放阿尔法波音引導式冥想\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放阿尔法波音引導式冥想\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:58","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:58","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:58","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放阿尔法波音引導式冥想\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:32:59","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我还需要更多的时间来弄懂你说的。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我还需要更多的时间来弄懂你说的。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326379223785_WXw0H7JKuBMeh"}} +{"level":"debug","time":"2022-08-24 15:32:59","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我还需要更多的时间来弄懂你说的。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我还需要更多的时间来弄懂你说的。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:32:59","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我还需要更多的时间来弄懂你说的。\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"我还需要更多的时间来弄懂你说的。\"}"}}} +{"level":"info","time":"2022-08-24 15:32:59","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"我还需要更多的时间来弄懂你说的。\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"我还需要更多的时间来弄懂你说的。\\\",\\\"asr_recongize\\\":\\\"播放阿尔法波音引導式冥想\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:07","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放阿尔法波音引导式冥想\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放阿尔法波音引导式冥想\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放阿尔法波音引导式冥想\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"悄悄告诉你,其实我没听懂你说了什么。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"悄悄告诉你,其实我没听懂你说了什么。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326388005438_02N7NaIhyPqEb"}} +{"level":"debug","time":"2022-08-24 15:33:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"悄悄告诉你,其实我没听懂你说了什么。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"悄悄告诉你,其实我没听懂你说了什么。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:33:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"悄悄告诉你,其实我没听懂你说了什么。\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"悄悄告诉你,其实我没听懂你说了什么。\"}"}}} +{"level":"info","time":"2022-08-24 15:33:07","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"悄悄告诉你,其实我没听懂你说了什么。\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"悄悄告诉你,其实我没听懂你说了什么。\\\",\\\"asr_recongize\\\":\\\"播放阿尔法波音引导式冥想\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:29","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放清理情绪垃圾\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放清理情绪垃圾\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:29","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:29","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:29","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放清理情绪垃圾\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:29","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我该好好学习了,居然没听懂你在说什么。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我该好好学习了,居然没听懂你在说什么。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326409520473_CZ5LW3ZlYZEai"}} +{"level":"debug","time":"2022-08-24 15:33:29","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我该好好学习了,居然没听懂你在说什么。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我该好好学习了,居然没听懂你在说什么。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:33:29","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我该好好学习了,居然没听懂你在说什么。\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"我该好好学习了,居然没听懂你在说什么。\"}"}}} +{"level":"info","time":"2022-08-24 15:33:29","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"我该好好学习了,居然没听懂你在说什么。\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"我该好好学习了,居然没听懂你在说什么。\\\",\\\"asr_recongize\\\":\\\"播放清理情绪垃圾\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:36","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放重返甜蜜梦乡\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放重返甜蜜梦乡\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放重返甜蜜梦乡\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:37","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我不知道该怎么回你诶,因为我没听明白。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我不知道该怎么回你诶,因为我没听明白。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326417182419_a0xMVFExNR94r"}} +{"level":"debug","time":"2022-08-24 15:33:37","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我不知道该怎么回你诶,因为我没听明白。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我不知道该怎么回你诶,因为我没听明白。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:33:37","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我不知道该怎么回你诶,因为我没听明白。\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"我不知道该怎么回你诶,因为我没听明白。\"}"}}} +{"level":"info","time":"2022-08-24 15:33:37","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"我不知道该怎么回你诶,因为我没听明白。\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"我不知道该怎么回你诶,因为我没听明白。\\\",\\\"asr_recongize\\\":\\\"播放重返甜蜜梦乡\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:47","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放秋日私语\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放秋日私语\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:47","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:47","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:47","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放秋日私语\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:33:47","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"秋日私语\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"selfData\":{\"displayFormat\":1,\"playMode\":2}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":202000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003Ddh2A2XULs4.m4a?fromtag=380&guid=12345673&uin=0&vkey=397A3733515828F5E5EF5C895EA450DF5AB8B38EA6DD0E77066309DA5C28A958E60BB85C27C62A2774DB334BECA5589515504665DF542806\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000Bxkyi2T1Aiq\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001k4Q4m2RYxCy_1.jpg\"}]},\"mediaId\":\"635322\",\"selfData\":{\"album\":\"理查德.克莱德曼钢琴曲精选\",\"albumId\":\"54035\",\"albumPubTime\":\"2000-02-17\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Richard Clayderman\",\"singerId\":\"550\",\"singerPics\":[],\"song\":\"秋日私语\",\"songId\":\"635322\",\"songMid\":\"000Bxkyi2T1Aiq\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Richard Clayderman\",\"textContent\":\"理查德.克莱德曼钢琴曲精选\",\"title\":\"秋日私语\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":474000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003Las7v2LicMV.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=A5F2F79F2AABA39223765AE0AE1A07831033233F065EA7C86B3CB80E956EA9CB39091068536CB8A3EFB24B5F6F5FA7C62C2E3E518F949C56\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=0029f0Ax2gB23k\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001VOBPK20l3tF_1.jpg\"}]},\"mediaId\":\"101601592\",\"selfData\":{\"album\":\"Elements Series: Water\",\"albumId\":\"906050\",\"albumPubTime\":\"2005-08-30\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Peter Kater\",\"singerId\":\"28313\",\"singerPics\":[],\"song\":\"Gently Dreaming\",\"songId\":\"101601592\",\"songMid\":\"0029f0Ax2gB23k\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Peter Kater\",\"textContent\":\"Elements Series: Water\",\"title\":\"Gently Dreaming\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":237000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003rYNqj0HzHXq.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=5F405D11E5A06CB07CB77DA50789CE4FC06FEE3A5758974D3802249DF5A50F7CBEB3C095AE1B9511F10C6E2C90717E1B30071174A05547B4\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003rYNqj0HzHXq\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001vdDyh3PUhb0_1.jpg\"}]},\"mediaId\":\"280555114\",\"selfData\":{\"album\":\"英雄赞歌\",\"albumId\":\"15088738\",\"albumPubTime\":\"2020-10-20\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"1662324\",\"similar\":0,\"singer\":\"谭维维/吕思清/陈萨\",\"singerId\":\"5979\",\"singerPics\":[],\"song\":\"英雄赞歌\",\"songId\":\"280555114\",\"songMid\":\"003rYNqj0HzHXq\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"谭维维/吕思清/陈萨\",\"textContent\":\"英雄赞歌\",\"title\":\"英雄赞歌\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":344000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000OH6Pd01IXZw.m4a?fromtag=35673&guid=12345673&uin=0&vkey=4389FB940A3F6ED1D06A2034DA2D56219EAD17A6154A3CA605C8D0F4A56CF9B2355487946377281AD049840BC0C8DBA12B7F49517D81200A\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002pcUeU0OLYN5\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001p7Pr32W8rPn_1.jpg\"}]},\"mediaId\":\"4705250\",\"selfData\":{\"album\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"albumId\":\"418181\",\"albumPubTime\":\"1997-04-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"吕思清\",\"singerId\":\"6727\",\"singerPics\":[],\"song\":\"柴可夫斯基:如歌的行板\",\"songId\":\"4705250\",\"songMid\":\"002pcUeU0OLYN5\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"吕思清\",\"textContent\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"title\":\"柴可夫斯基:如歌的行板\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":149000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400004IZL4j09NGeL.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=CBF5E46353F73C1F9FE320426AA4FAF5E4BE6B45E9C406AFDB18043A5CB24A4311F13E7BAFA6F7BDD7FA30A4B1FDE726D54AFE6A33A532A6\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000iUJDe1MH7Fs\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M0000003KxSV2b5Zja_2.jpg\"}]},\"mediaId\":\"1252082\",\"selfData\":{\"album\":\"A Change of Season\",\"albumId\":\"103959\",\"albumPubTime\":\"1998-01-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Brian Crain\",\"singerId\":\"25027\",\"singerPics\":[],\"song\":\"Broken Shadows\",\"songId\":\"1252082\",\"songMid\":\"000iUJDe1MH7Fs\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Brian Crain\",\"textContent\":\"A Change of Season\",\"title\":\"Broken Shadows\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":285000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003VkZpy1OtH7K.m4a?fromtag=35673&guid=12345673&uin=0&vkey=638DFD7C844441E68F994664904FF9825810879188D6447BE316847BB116725884ADF0E02E0B52978DE5A9E2E57DF4E84C03895832EC9028\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=001NVbPL3Vo09j\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001p7Pr32W8rPn_1.jpg\"}]},\"mediaId\":\"4705257\",\"selfData\":{\"album\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"albumId\":\"418181\",\"albumPubTime\":\"1997-04-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"吕思清\",\"singerId\":\"6727\",\"singerPics\":[],\"song\":\"蒙迪:查尔达斯\",\"songId\":\"4705257\",\"songMid\":\"001NVbPL3Vo09j\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"吕思清\",\"textContent\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"title\":\"蒙迪:查尔达斯\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":334000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003OR33j0cXkei.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=AD279233572AA9FB05886374508D39273181C71CCAC4BC3EEA4FBD37FB9E4AF1630ED531ABFB62971820AC2317A58976C73A529616CCFFA0\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=0039ZvoC48W1la\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002b9ZVS1X9gzy_2.jpg\"}]},\"mediaId\":\"4829444\",\"selfData\":{\"album\":\"Live\",\"albumId\":\"94529\",\"albumPubTime\":\"1991-06-17\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Kenny G\",\"singerId\":\"7166\",\"singerPics\":[],\"song\":\"Going Home\",\"songId\":\"4829444\",\"songMid\":\"0039ZvoC48W1la\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":132166,\"tryEnd\":192166,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Kenny G\",\"textContent\":\"Live\",\"title\":\"Going Home\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":166000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002MmNm507Uebb.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=DE96DB55D1E0025D8BF9E6A6EFBFDB00DAFF9CCEAA1A398E6DB57E334BE465091F314ACF532C4D2FF3801FA231568494D0826B1A07963B71\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=00431wyB2qXj3y\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002mllg02aWpIw_1.jpg\"}]},\"mediaId\":\"426802\",\"selfData\":{\"album\":\"In My Time\",\"albumId\":\"34709\",\"albumPubTime\":\"1993-04-12\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"561975\",\"similar\":0,\"singer\":\"Yanni\",\"singerId\":\"7591\",\"singerPics\":[],\"song\":\"One Man's Dream\",\"songId\":\"426802\",\"songMid\":\"00431wyB2qXj3y\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Yanni\",\"textContent\":\"In My Time\",\"title\":\"One Man's Dream\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":251000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000eoSaK1252bh.m4a?fromtag=30039&guid=2000000039&uin=0&vkey=ED15B254729A3B65E5E886B87C9366269307716D54C3D6EA93B5A1FFF739F9DC68B421C29E3E2A63C812BD3C633CCD4D461293E51678113F\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000NOod12xiuHj\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001ExeaG1J1EfG_1.jpg\"}]},\"mediaId\":\"102798907\",\"selfData\":{\"album\":\"夜色钢琴曲\",\"albumId\":\"1033177\",\"albumPubTime\":\"2013-06-06\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"赵海洋\",\"singerId\":\"161386\",\"singerPics\":[],\"song\":\"人生的旅途\",\"songId\":\"102798907\",\"songMid\":\"000NOod12xiuHj\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"赵海洋\",\"textContent\":\"夜色钢琴曲\",\"title\":\"人生的旅途\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":230000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002VH3gj4KlVDy.m4a?fromtag=35673&guid=12345673&uin=0&vkey=2AD71756AC64CAB94CF60A2D46DE5B77106C8A088E36A8592CA0D8AF0B598E94B4F651CEC1DB78C4A882317211BFFF83E1C57022BA236202\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002M9PkM0q9oBc\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002DOCBo3sFTDI_1.jpg\"}]},\"mediaId\":\"9478098\",\"selfData\":{\"album\":\"The Golden Piano\",\"albumId\":\"805283\",\"albumPubTime\":\"2013-01-11\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"K.Williams\",\"singerId\":\"365781\",\"singerPics\":[],\"song\":\"天空之城\",\"songId\":\"9478098\",\"songMid\":\"002M9PkM0q9oBc\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"K.Williams\",\"textContent\":\"The Golden Piano\",\"title\":\"天空之城\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":206000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000019ml2f0VXwx6.m4a?fromtag=35673&guid=12345673&uin=0&vkey=21977746295403A1DD54429B4756C0C693E3A0848192035B67C4470EA35F974965338BAD57749C9C481FE76732418AC9789BCA45E1700257\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003GpEGR35UakD\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001JQfpq06nggV_1.jpg\"}]},\"mediaId\":\"1663408\",\"selfData\":{\"album\":\"背景音乐之旅. (CD3)\",\"albumId\":\"132506\",\"albumPubTime\":\"2006-03-24\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Bandari\",\"singerId\":\"7065\",\"singerPics\":[],\"song\":\"Annie's W'onderland\",\"songId\":\"1663408\",\"songMid\":\"003GpEGR35UakD\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Bandari\",\"textContent\":\"背景音乐之旅. (CD3)\",\"title\":\"Annie's W'onderland\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":259000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002LqhBd39LZnW.m4a?fromtag=35673&guid=12345673&uin=0&vkey=6DBC72250393C877AD8B4640E41AE164EF796B2E956D4FC771C132F3B85D0997A09FFC411483048A52EAF595F7FD230926AB54C858CFA91E\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=0034OyOa0R6E6L\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001p7Pr32W8rPn_1.jpg\"}]},\"mediaId\":\"4705252\",\"selfData\":{\"album\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"albumId\":\"418181\",\"albumPubTime\":\"1997-04-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"吕思清\",\"singerId\":\"6727\",\"singerPics\":[],\"song\":\"舒伯特:小夜曲\",\"songId\":\"4705252\",\"songMid\":\"0034OyOa0R6E6L\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"吕思清\",\"textContent\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"title\":\"舒伯特:小夜曲\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":346000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002LAv7Q2JNkVT.m4a?fromtag=35673&guid=12345673&uin=0&vkey=65CE4865F1F583B4A9748A70E947AAB9701B819EB08918BEC9F60E7A5971CAE8E994EC2683D22F8A5E041B38A97AB6018DABC848E3B1B910\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002Witiz1yrLV1\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000000AXKYP229Cqu_1.jpg\"}]},\"mediaId\":\"1985172\",\"selfData\":{\"album\":\"Tribute (Live)\",\"albumId\":\"188094\",\"albumPubTime\":\"1997-11-04\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Yanni\",\"singerId\":\"7591\",\"singerPics\":[],\"song\":\"Nightingale\",\"songId\":\"1985172\",\"songMid\":\"002Witiz1yrLV1\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Yanni\",\"textContent\":\"Tribute (Live)\",\"title\":\"Nightingale\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":233000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000VIoM64c0EfO.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=8A6EDA1759B67E32D9C2C8EE799433ACCCDFAA8353B2E909465A59B019D1F10623759443E3F742FA16C14455D7028D40FB85CDC3AB0123BD\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004c8gSz1YZE01\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002wOJBR2EfGYk_2.jpg\"}]},\"mediaId\":\"2500205\",\"selfData\":{\"album\":\"Somewhere In Time (Songs Of Endless Love)\",\"albumId\":\"195361\",\"albumPubTime\":\"1997-01-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Wayne Gratz\",\"singerId\":\"43821\",\"singerPics\":[],\"song\":\"A Time For Us\",\"songId\":\"2500205\",\"songMid\":\"004c8gSz1YZE01\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Wayne Gratz\",\"textContent\":\"Somewhere In Time (Songs Of Endless Love)\",\"title\":\"A Time For Us\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":162000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000AQNVz26uG6D.m4a?fromtag=35673&guid=12345673&uin=0&vkey=F0EA2B71B7BD455C333E4978D4A1FC29914361A973D012F57D5AE203D419744BE3014BEA2D926A9510B2EC77B9D853263928242B0DDB7EC9\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003BiYM71E0j7X\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000003iw6EK2YWEju_2.jpg\"}]},\"mediaId\":\"777379\",\"selfData\":{\"album\":\"理查德·克莱德曼钢琴曲全集-水边的阿狄丽娜\",\"albumId\":\"65447\",\"albumPubTime\":\"2004-01-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Richard Clayderman\",\"singerId\":\"550\",\"singerPics\":[],\"song\":\"梦中的婚礼\",\"songId\":\"777379\",\"songMid\":\"003BiYM71E0j7X\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Richard Clayderman\",\"textContent\":\"理查德·克莱德曼钢琴曲全集-水边的阿狄丽娜\",\"title\":\"梦中的婚礼\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":328000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400001fkQ2O3KYz5N.m4a?fromtag=35673&guid=12345673&uin=0&vkey=10F2986C324C4A03746097365231FB505542C1DDDB601ED933B44187669CABCB6CC02687B5E8FB72DE99EFEBD46C67C5B4F11B82203D29AB\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004QPJvL46ZEZH\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000003fm54R22mykz_2.jpg\"}]},\"mediaId\":\"1845156\",\"selfData\":{\"album\":\"Wedding in Heaven\",\"albumId\":\"144268\",\"albumPubTime\":\"1999-01-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Tom Barabas\",\"singerId\":\"21281\",\"singerPics\":[],\"song\":\"Moon dust\",\"songId\":\"1845156\",\"songMid\":\"004QPJvL46ZEZH\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Tom Barabas\",\"textContent\":\"Wedding in Heaven\",\"title\":\"Moon dust\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":223000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003TzupI4O2sGJ.m4a?fromtag=35673&guid=12345673&uin=0&vkey=8FDABADD072B53E3BA89B1005604BC0AB877DB949AB7CC7F577CC50CF0CA1E42C11927959EA5595F472A6339591A2C74B7E0C6F389BCD7FA\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002C4amC3GnzND\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M0000019tZh70GcU9I_1.jpg\"}]},\"mediaId\":\"4896119\",\"selfData\":{\"album\":\"All the Seasons of George Winston: Piano Solos\",\"albumId\":\"30740\",\"albumPubTime\":\"1998-03-24\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"George Winston\",\"singerId\":\"8161\",\"singerPics\":[],\"song\":\"Variations On The Canon By Pachelbel\",\"songId\":\"4896119\",\"songMid\":\"002C4amC3GnzND\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"George Winston\",\"textContent\":\"All the Seasons of George Winston: Piano Solos\",\"title\":\"Variations On The Canon By Pachelbel\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":229000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000qg7fB0wtSvn.m4a?fromtag=35673&guid=12345673&uin=0&vkey=3C9EDDE57CA8DF128AFC65DE42D19F2ADE7AF0F52F7FCEE59D639FDAC8A893552F23378B3CFFBD55EAE992548FADC28616DF546E32CCABC6\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002kCENe4dHDUW\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000003zOUFV4G0Aba_1.jpg\"}]},\"mediaId\":\"692102\",\"selfData\":{\"album\":\"安德蒙减压音乐-唱游心海.Vol.3\",\"albumId\":\"58515\",\"albumPubTime\":\"2009-03-20\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Andemund Orchestra\",\"singerId\":\"21244\",\"singerPics\":[],\"song\":\"Fairy Dream\",\"songId\":\"692102\",\"songMid\":\"002kCENe4dHDUW\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Andemund Orchestra\",\"textContent\":\"安德蒙减压音乐-唱游心海.Vol.3\",\"title\":\"Fairy Dream\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":214000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003iSnJU1NjJeC.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=DFA0ED020B8B02B7F595FFECD39167A452EDFC67C9D8DF55B47386D60724B0AE6438D401BE15AF8284BD7022A8DFEB848895509CBAD8DFBC\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004gadkt3VBOLr\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001Tpuol2ztfRw_1.jpg\"}]},\"mediaId\":\"876733\",\"selfData\":{\"album\":\"Songs From a Secret Garden\",\"albumId\":\"27939\",\"albumPubTime\":\"1995-04-23\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"165097\",\"similar\":0,\"singer\":\"Secret Garden\",\"singerId\":\"8044\",\"singerPics\":[],\"song\":\"Songs From A Secret Garden\",\"songId\":\"876733\",\"songMid\":\"004gadkt3VBOLr\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"http://isure6.stream.qqmusic.qq.com/RS02063UlKX31a5YBL.mp3?guid=2000000192&vkey=A9CD600D31532474A78B203CF9176191DC51AAAC90456FF77D3C741A56BC3A7AC5F74AF8E7A76876CE399BBB89DFB320E65FA8EB7CDD08D5&uin=0&fromtag=20192\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":960887,\"tryPlayable\":1,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Secret Garden\",\"textContent\":\"Songs From a Secret Garden\",\"title\":\"Songs From A Secret Garden\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":227000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002kROXV0xUNz3.m4a?fromtag=35673&guid=12345673&uin=0&vkey=61E6DDDF88586EDA8DEDCA8516AEDE40D0B3850731CA8DEB8A9AC395AE74C60823C313F283972C5E59600C200C9CAC331B96D4DBE7A9DA8B\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004YR6fW4ICqcF\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M0000031UXjr3kzYTo_1.jpg\"}]},\"mediaId\":\"1663373\",\"selfData\":{\"album\":\"背景音乐之旅. (CD1)\",\"albumId\":\"132502\",\"albumPubTime\":\"2006-03-24\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Kevin Kern\",\"singerId\":\"8575\",\"singerPics\":[],\"song\":\"绿色通道\",\"songId\":\"1663373\",\"songMid\":\"004YR6fW4ICqcF\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Kevin Kern\",\"textContent\":\"背景音乐之旅. (CD1)\",\"title\":\"绿色通道\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":241000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003QYfHm2ESNb4.m4a?fromtag=35673&guid=12345673&uin=0&vkey=AE98D9FFA1E34399D736666BC1DBE619A7E02B2BDBC5EE81E77124D046CD691981AF4411D54FE75352DCEED3EF46F433B67C7CB07B00BF21\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003YATZT1JZKCL\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M0000026sQqY2PE4c4_2.jpg\"}]},\"mediaId\":\"4847250\",\"selfData\":{\"album\":\"理查德·克莱德曼钢琴曲全集-精彩现场\",\"albumId\":\"65445\",\"albumPubTime\":\"2002-11-27\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"464040\",\"similar\":0,\"singer\":\"Richard Clayderman\",\"singerId\":\"550\",\"singerPics\":[],\"song\":\"爱的协奏曲\",\"songId\":\"4847250\",\"songMid\":\"003YATZT1JZKCL\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Richard Clayderman\",\"textContent\":\"理查德·克莱德曼钢琴曲全集-精彩现场\",\"title\":\"爱的协奏曲\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"陪你一起听Richard Clayderman的秋日私语。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326427506110_xRQIngCgQU5OF"}} +{"level":"debug","time":"2022-08-24 15:33:47","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"秋日私语\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"selfData\":{\"displayFormat\":1,\"playMode\":2}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":202000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003Ddh2A2XULs4.m4a?fromtag=380&guid=12345673&uin=0&vkey=397A3733515828F5E5EF5C895EA450DF5AB8B38EA6DD0E77066309DA5C28A958E60BB85C27C62A2774DB334BECA5589515504665DF542806\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000Bxkyi2T1Aiq\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001k4Q4m2RYxCy_1.jpg\"}]},\"mediaId\":\"635322\",\"selfData\":{\"album\":\"理查德.克莱德曼钢琴曲精选\",\"albumId\":\"54035\",\"albumPubTime\":\"2000-02-17\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Richard Clayderman\",\"singerId\":\"550\",\"singerPics\":[],\"song\":\"秋日私语\",\"songId\":\"635322\",\"songMid\":\"000Bxkyi2T1Aiq\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Richard Clayderman\",\"textContent\":\"理查德.克莱德曼钢琴曲精选\",\"title\":\"秋日私语\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":474000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003Las7v2LicMV.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=A5F2F79F2AABA39223765AE0AE1A07831033233F065EA7C86B3CB80E956EA9CB39091068536CB8A3EFB24B5F6F5FA7C62C2E3E518F949C56\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=0029f0Ax2gB23k\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001VOBPK20l3tF_1.jpg\"}]},\"mediaId\":\"101601592\",\"selfData\":{\"album\":\"Elements Series: Water\",\"albumId\":\"906050\",\"albumPubTime\":\"2005-08-30\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Peter Kater\",\"singerId\":\"28313\",\"singerPics\":[],\"song\":\"Gently Dreaming\",\"songId\":\"101601592\",\"songMid\":\"0029f0Ax2gB23k\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Peter Kater\",\"textContent\":\"Elements Series: Water\",\"title\":\"Gently Dreaming\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":237000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003rYNqj0HzHXq.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=5F405D11E5A06CB07CB77DA50789CE4FC06FEE3A5758974D3802249DF5A50F7CBEB3C095AE1B9511F10C6E2C90717E1B30071174A05547B4\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003rYNqj0HzHXq\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001vdDyh3PUhb0_1.jpg\"}]},\"mediaId\":\"280555114\",\"selfData\":{\"album\":\"英雄赞歌\",\"albumId\":\"15088738\",\"albumPubTime\":\"2020-10-20\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"1662324\",\"similar\":0,\"singer\":\"谭维维/吕思清/陈萨\",\"singerId\":\"5979\",\"singerPics\":[],\"song\":\"英雄赞歌\",\"songId\":\"280555114\",\"songMid\":\"003rYNqj0HzHXq\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"谭维维/吕思清/陈萨\",\"textContent\":\"英雄赞歌\",\"title\":\"英雄赞歌\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":344000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000OH6Pd01IXZw.m4a?fromtag=35673&guid=12345673&uin=0&vkey=4389FB940A3F6ED1D06A2034DA2D56219EAD17A6154A3CA605C8D0F4A56CF9B2355487946377281AD049840BC0C8DBA12B7F49517D81200A\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002pcUeU0OLYN5\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001p7Pr32W8rPn_1.jpg\"}]},\"mediaId\":\"4705250\",\"selfData\":{\"album\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"albumId\":\"418181\",\"albumPubTime\":\"1997-04-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"吕思清\",\"singerId\":\"6727\",\"singerPics\":[],\"song\":\"柴可夫斯基:如歌的行板\",\"songId\":\"4705250\",\"songMid\":\"002pcUeU0OLYN5\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"吕思清\",\"textContent\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"title\":\"柴可夫斯基:如歌的行板\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":149000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400004IZL4j09NGeL.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=CBF5E46353F73C1F9FE320426AA4FAF5E4BE6B45E9C406AFDB18043A5CB24A4311F13E7BAFA6F7BDD7FA30A4B1FDE726D54AFE6A33A532A6\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000iUJDe1MH7Fs\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M0000003KxSV2b5Zja_2.jpg\"}]},\"mediaId\":\"1252082\",\"selfData\":{\"album\":\"A Change of Season\",\"albumId\":\"103959\",\"albumPubTime\":\"1998-01-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Brian Crain\",\"singerId\":\"25027\",\"singerPics\":[],\"song\":\"Broken Shadows\",\"songId\":\"1252082\",\"songMid\":\"000iUJDe1MH7Fs\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Brian Crain\",\"textContent\":\"A Change of Season\",\"title\":\"Broken Shadows\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":285000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003VkZpy1OtH7K.m4a?fromtag=35673&guid=12345673&uin=0&vkey=638DFD7C844441E68F994664904FF9825810879188D6447BE316847BB116725884ADF0E02E0B52978DE5A9E2E57DF4E84C03895832EC9028\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=001NVbPL3Vo09j\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001p7Pr32W8rPn_1.jpg\"}]},\"mediaId\":\"4705257\",\"selfData\":{\"album\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"albumId\":\"418181\",\"albumPubTime\":\"1997-04-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"吕思清\",\"singerId\":\"6727\",\"singerPics\":[],\"song\":\"蒙迪:查尔达斯\",\"songId\":\"4705257\",\"songMid\":\"001NVbPL3Vo09j\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"吕思清\",\"textContent\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"title\":\"蒙迪:查尔达斯\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":334000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003OR33j0cXkei.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=AD279233572AA9FB05886374508D39273181C71CCAC4BC3EEA4FBD37FB9E4AF1630ED531ABFB62971820AC2317A58976C73A529616CCFFA0\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=0039ZvoC48W1la\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002b9ZVS1X9gzy_2.jpg\"}]},\"mediaId\":\"4829444\",\"selfData\":{\"album\":\"Live\",\"albumId\":\"94529\",\"albumPubTime\":\"1991-06-17\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Kenny G\",\"singerId\":\"7166\",\"singerPics\":[],\"song\":\"Going Home\",\"songId\":\"4829444\",\"songMid\":\"0039ZvoC48W1la\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":132166,\"tryEnd\":192166,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Kenny G\",\"textContent\":\"Live\",\"title\":\"Going Home\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":166000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002MmNm507Uebb.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=DE96DB55D1E0025D8BF9E6A6EFBFDB00DAFF9CCEAA1A398E6DB57E334BE465091F314ACF532C4D2FF3801FA231568494D0826B1A07963B71\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=00431wyB2qXj3y\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002mllg02aWpIw_1.jpg\"}]},\"mediaId\":\"426802\",\"selfData\":{\"album\":\"In My Time\",\"albumId\":\"34709\",\"albumPubTime\":\"1993-04-12\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"561975\",\"similar\":0,\"singer\":\"Yanni\",\"singerId\":\"7591\",\"singerPics\":[],\"song\":\"One Man's Dream\",\"songId\":\"426802\",\"songMid\":\"00431wyB2qXj3y\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Yanni\",\"textContent\":\"In My Time\",\"title\":\"One Man's Dream\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":251000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000eoSaK1252bh.m4a?fromtag=30039&guid=2000000039&uin=0&vkey=ED15B254729A3B65E5E886B87C9366269307716D54C3D6EA93B5A1FFF739F9DC68B421C29E3E2A63C812BD3C633CCD4D461293E51678113F\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000NOod12xiuHj\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001ExeaG1J1EfG_1.jpg\"}]},\"mediaId\":\"102798907\",\"selfData\":{\"album\":\"夜色钢琴曲\",\"albumId\":\"1033177\",\"albumPubTime\":\"2013-06-06\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"赵海洋\",\"singerId\":\"161386\",\"singerPics\":[],\"song\":\"人生的旅途\",\"songId\":\"102798907\",\"songMid\":\"000NOod12xiuHj\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"赵海洋\",\"textContent\":\"夜色钢琴曲\",\"title\":\"人生的旅途\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":230000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002VH3gj4KlVDy.m4a?fromtag=35673&guid=12345673&uin=0&vkey=2AD71756AC64CAB94CF60A2D46DE5B77106C8A088E36A8592CA0D8AF0B598E94B4F651CEC1DB78C4A882317211BFFF83E1C57022BA236202\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002M9PkM0q9oBc\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002DOCBo3sFTDI_1.jpg\"}]},\"mediaId\":\"9478098\",\"selfData\":{\"album\":\"The Golden Piano\",\"albumId\":\"805283\",\"albumPubTime\":\"2013-01-11\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"K.Williams\",\"singerId\":\"365781\",\"singerPics\":[],\"song\":\"天空之城\",\"songId\":\"9478098\",\"songMid\":\"002M9PkM0q9oBc\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"K.Williams\",\"textContent\":\"The Golden Piano\",\"title\":\"天空之城\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":206000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000019ml2f0VXwx6.m4a?fromtag=35673&guid=12345673&uin=0&vkey=21977746295403A1DD54429B4756C0C693E3A0848192035B67C4470EA35F974965338BAD57749C9C481FE76732418AC9789BCA45E1700257\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003GpEGR35UakD\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001JQfpq06nggV_1.jpg\"}]},\"mediaId\":\"1663408\",\"selfData\":{\"album\":\"背景音乐之旅. (CD3)\",\"albumId\":\"132506\",\"albumPubTime\":\"2006-03-24\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Bandari\",\"singerId\":\"7065\",\"singerPics\":[],\"song\":\"Annie's W'onderland\",\"songId\":\"1663408\",\"songMid\":\"003GpEGR35UakD\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Bandari\",\"textContent\":\"背景音乐之旅. (CD3)\",\"title\":\"Annie's W'onderland\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":259000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002LqhBd39LZnW.m4a?fromtag=35673&guid=12345673&uin=0&vkey=6DBC72250393C877AD8B4640E41AE164EF796B2E956D4FC771C132F3B85D0997A09FFC411483048A52EAF595F7FD230926AB54C858CFA91E\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=0034OyOa0R6E6L\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001p7Pr32W8rPn_1.jpg\"}]},\"mediaId\":\"4705252\",\"selfData\":{\"album\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"albumId\":\"418181\",\"albumPubTime\":\"1997-04-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"吕思清\",\"singerId\":\"6727\",\"singerPics\":[],\"song\":\"舒伯特:小夜曲\",\"songId\":\"4705252\",\"songMid\":\"0034OyOa0R6E6L\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"吕思清\",\"textContent\":\"Traumerei: Romantic Violin Favourites (Lu Siqing)\",\"title\":\"舒伯特:小夜曲\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":346000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002LAv7Q2JNkVT.m4a?fromtag=35673&guid=12345673&uin=0&vkey=65CE4865F1F583B4A9748A70E947AAB9701B819EB08918BEC9F60E7A5971CAE8E994EC2683D22F8A5E041B38A97AB6018DABC848E3B1B910\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002Witiz1yrLV1\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000000AXKYP229Cqu_1.jpg\"}]},\"mediaId\":\"1985172\",\"selfData\":{\"album\":\"Tribute (Live)\",\"albumId\":\"188094\",\"albumPubTime\":\"1997-11-04\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Yanni\",\"singerId\":\"7591\",\"singerPics\":[],\"song\":\"Nightingale\",\"songId\":\"1985172\",\"songMid\":\"002Witiz1yrLV1\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Yanni\",\"textContent\":\"Tribute (Live)\",\"title\":\"Nightingale\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":233000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000VIoM64c0EfO.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=8A6EDA1759B67E32D9C2C8EE799433ACCCDFAA8353B2E909465A59B019D1F10623759443E3F742FA16C14455D7028D40FB85CDC3AB0123BD\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004c8gSz1YZE01\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002wOJBR2EfGYk_2.jpg\"}]},\"mediaId\":\"2500205\",\"selfData\":{\"album\":\"Somewhere In Time (Songs Of Endless Love)\",\"albumId\":\"195361\",\"albumPubTime\":\"1997-01-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Wayne Gratz\",\"singerId\":\"43821\",\"singerPics\":[],\"song\":\"A Time For Us\",\"songId\":\"2500205\",\"songMid\":\"004c8gSz1YZE01\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Wayne Gratz\",\"textContent\":\"Somewhere In Time (Songs Of Endless Love)\",\"title\":\"A Time For Us\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":162000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000AQNVz26uG6D.m4a?fromtag=35673&guid=12345673&uin=0&vkey=F0EA2B71B7BD455C333E4978D4A1FC29914361A973D012F57D5AE203D419744BE3014BEA2D926A9510B2EC77B9D853263928242B0DDB7EC9\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003BiYM71E0j7X\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000003iw6EK2YWEju_2.jpg\"}]},\"mediaId\":\"777379\",\"selfData\":{\"album\":\"理查德·克莱德曼钢琴曲全集-水边的阿狄丽娜\",\"albumId\":\"65447\",\"albumPubTime\":\"2004-01-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Richard Clayderman\",\"singerId\":\"550\",\"singerPics\":[],\"song\":\"梦中的婚礼\",\"songId\":\"777379\",\"songMid\":\"003BiYM71E0j7X\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Richard Clayderman\",\"textContent\":\"理查德·克莱德曼钢琴曲全集-水边的阿狄丽娜\",\"title\":\"梦中的婚礼\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":328000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400001fkQ2O3KYz5N.m4a?fromtag=35673&guid=12345673&uin=0&vkey=10F2986C324C4A03746097365231FB505542C1DDDB601ED933B44187669CABCB6CC02687B5E8FB72DE99EFEBD46C67C5B4F11B82203D29AB\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004QPJvL46ZEZH\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000003fm54R22mykz_2.jpg\"}]},\"mediaId\":\"1845156\",\"selfData\":{\"album\":\"Wedding in Heaven\",\"albumId\":\"144268\",\"albumPubTime\":\"1999-01-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Tom Barabas\",\"singerId\":\"21281\",\"singerPics\":[],\"song\":\"Moon dust\",\"songId\":\"1845156\",\"songMid\":\"004QPJvL46ZEZH\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Tom Barabas\",\"textContent\":\"Wedding in Heaven\",\"title\":\"Moon dust\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":223000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003TzupI4O2sGJ.m4a?fromtag=35673&guid=12345673&uin=0&vkey=8FDABADD072B53E3BA89B1005604BC0AB877DB949AB7CC7F577CC50CF0CA1E42C11927959EA5595F472A6339591A2C74B7E0C6F389BCD7FA\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002C4amC3GnzND\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M0000019tZh70GcU9I_1.jpg\"}]},\"mediaId\":\"4896119\",\"selfData\":{\"album\":\"All the Seasons of George Winston: Piano Solos\",\"albumId\":\"30740\",\"albumPubTime\":\"1998-03-24\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"George Winston\",\"singerId\":\"8161\",\"singerPics\":[],\"song\":\"Variations On The Canon By Pachelbel\",\"songId\":\"4896119\",\"songMid\":\"002C4amC3GnzND\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"George Winston\",\"textContent\":\"All the Seasons of George Winston: Piano Solos\",\"title\":\"Variations On The Canon By Pachelbel\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":229000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000qg7fB0wtSvn.m4a?fromtag=35673&guid=12345673&uin=0&vkey=3C9EDDE57CA8DF128AFC65DE42D19F2ADE7AF0F52F7FCEE59D639FDAC8A893552F23378B3CFFBD55EAE992548FADC28616DF546E32CCABC6\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=002kCENe4dHDUW\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000003zOUFV4G0Aba_1.jpg\"}]},\"mediaId\":\"692102\",\"selfData\":{\"album\":\"安德蒙减压音乐-唱游心海.Vol.3\",\"albumId\":\"58515\",\"albumPubTime\":\"2009-03-20\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Andemund Orchestra\",\"singerId\":\"21244\",\"singerPics\":[],\"song\":\"Fairy Dream\",\"songId\":\"692102\",\"songMid\":\"002kCENe4dHDUW\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Andemund Orchestra\",\"textContent\":\"安德蒙减压音乐-唱游心海.Vol.3\",\"title\":\"Fairy Dream\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":214000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003iSnJU1NjJeC.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=DFA0ED020B8B02B7F595FFECD39167A452EDFC67C9D8DF55B47386D60724B0AE6438D401BE15AF8284BD7022A8DFEB848895509CBAD8DFBC\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004gadkt3VBOLr\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001Tpuol2ztfRw_1.jpg\"}]},\"mediaId\":\"876733\",\"selfData\":{\"album\":\"Songs From a Secret Garden\",\"albumId\":\"27939\",\"albumPubTime\":\"1995-04-23\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"165097\",\"similar\":0,\"singer\":\"Secret Garden\",\"singerId\":\"8044\",\"singerPics\":[],\"song\":\"Songs From A Secret Garden\",\"songId\":\"876733\",\"songMid\":\"004gadkt3VBOLr\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"http://isure6.stream.qqmusic.qq.com/RS02063UlKX31a5YBL.mp3?guid=2000000192&vkey=A9CD600D31532474A78B203CF9176191DC51AAAC90456FF77D3C741A56BC3A7AC5F74AF8E7A76876CE399BBB89DFB320E65FA8EB7CDD08D5&uin=0&fromtag=20192\",\"tryBegin\":0,\"tryEnd\":60000,\"tryFileSize\":960887,\"tryPlayable\":1,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Secret Garden\",\"textContent\":\"Songs From a Secret Garden\",\"title\":\"Songs From A Secret Garden\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":227000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002kROXV0xUNz3.m4a?fromtag=35673&guid=12345673&uin=0&vkey=61E6DDDF88586EDA8DEDCA8516AEDE40D0B3850731CA8DEB8A9AC395AE74C60823C313F283972C5E59600C200C9CAC331B96D4DBE7A9DA8B\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=004YR6fW4ICqcF\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M0000031UXjr3kzYTo_1.jpg\"}]},\"mediaId\":\"1663373\",\"selfData\":{\"album\":\"背景音乐之旅. (CD1)\",\"albumId\":\"132502\",\"albumPubTime\":\"2006-03-24\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"Kevin Kern\",\"singerId\":\"8575\",\"singerPics\":[],\"song\":\"绿色通道\",\"songId\":\"1663373\",\"songMid\":\"004YR6fW4ICqcF\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Kevin Kern\",\"textContent\":\"背景音乐之旅. (CD1)\",\"title\":\"绿色通道\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":241000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003QYfHm2ESNb4.m4a?fromtag=35673&guid=12345673&uin=0&vkey=AE98D9FFA1E34399D736666BC1DBE619A7E02B2BDBC5EE81E77124D046CD691981AF4411D54FE75352DCEED3EF46F433B67C7CB07B00BF21\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003YATZT1JZKCL\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M0000026sQqY2PE4c4_2.jpg\"}]},\"mediaId\":\"4847250\",\"selfData\":{\"album\":\"理查德·克莱德曼钢琴曲全集-精彩现场\",\"albumId\":\"65445\",\"albumPubTime\":\"2002-11-27\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"464040\",\"similar\":0,\"singer\":\"Richard Clayderman\",\"singerId\":\"550\",\"singerPics\":[],\"song\":\"爱的协奏曲\",\"songId\":\"4847250\",\"songMid\":\"003YATZT1JZKCL\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"Richard Clayderman\",\"textContent\":\"理查德·克莱德曼钢琴曲全集-精彩现场\",\"title\":\"爱的协奏曲\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"陪你一起听Richard Clayderman的秋日私语。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:33:47","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"秋日私语\"}]}},\"response_text\":\"您的设备尚未授权,请前往格力+手机应用绑定授权。\",\"listItems\":[{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003Ddh2A2XULs4.m4a?fromtag=380&guid=12345673&uin=0&vkey=397A3733515828F5E5EF5C895EA450DF5AB8B38EA6DD0E77066309DA5C28A958E60BB85C27C62A2774DB334BECA5589515504665DF542806\",\"singer\":\"Richard Clayderman\",\"song\":\"秋日私语\",\"mediaId\":\"635322\",\"songId\":\"635322\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003Las7v2LicMV.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=A5F2F79F2AABA39223765AE0AE1A07831033233F065EA7C86B3CB80E956EA9CB39091068536CB8A3EFB24B5F6F5FA7C62C2E3E518F949C56\",\"singer\":\"Peter Kater\",\"song\":\"Gently Dreaming\",\"mediaId\":\"101601592\",\"songId\":\"101601592\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003rYNqj0HzHXq.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=5F405D11E5A06CB07CB77DA50789CE4FC06FEE3A5758974D3802249DF5A50F7CBEB3C095AE1B9511F10C6E2C90717E1B30071174A05547B4\",\"singer\":\"谭维维/吕思清/陈萨\",\"song\":\"英雄赞歌\",\"mediaId\":\"280555114\",\"songId\":\"280555114\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000OH6Pd01IXZw.m4a?fromtag=35673&guid=12345673&uin=0&vkey=4389FB940A3F6ED1D06A2034DA2D56219EAD17A6154A3CA605C8D0F4A56CF9B2355487946377281AD049840BC0C8DBA12B7F49517D81200A\",\"singer\":\"吕思清\",\"song\":\"柴可夫斯基:如歌的行板\",\"mediaId\":\"4705250\",\"songId\":\"4705250\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400004IZL4j09NGeL.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=CBF5E46353F73C1F9FE320426AA4FAF5E4BE6B45E9C406AFDB18043A5CB24A4311F13E7BAFA6F7BDD7FA30A4B1FDE726D54AFE6A33A532A6\",\"singer\":\"Brian Crain\",\"song\":\"Broken Shadows\",\"mediaId\":\"1252082\",\"songId\":\"1252082\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003VkZpy1OtH7K.m4a?fromtag=35673&guid=12345673&uin=0&vkey=638DFD7C844441E68F994664904FF9825810879188D6447BE316847BB116725884ADF0E02E0B52978DE5A9E2E57DF4E84C03895832EC9028\",\"singer\":\"吕思清\",\"song\":\"蒙迪:查尔达斯\",\"mediaId\":\"4705257\",\"songId\":\"4705257\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003OR33j0cXkei.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=AD279233572AA9FB05886374508D39273181C71CCAC4BC3EEA4FBD37FB9E4AF1630ED531ABFB62971820AC2317A58976C73A529616CCFFA0\",\"singer\":\"Kenny G\",\"song\":\"Going Home\",\"mediaId\":\"4829444\",\"songId\":\"4829444\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002MmNm507Uebb.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=DE96DB55D1E0025D8BF9E6A6EFBFDB00DAFF9CCEAA1A398E6DB57E334BE465091F314ACF532C4D2FF3801FA231568494D0826B1A07963B71\",\"singer\":\"Yanni\",\"song\":\"One Man's Dream\",\"mediaId\":\"426802\",\"songId\":\"426802\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000eoSaK1252bh.m4a?fromtag=30039&guid=2000000039&uin=0&vkey=ED15B254729A3B65E5E886B87C9366269307716D54C3D6EA93B5A1FFF739F9DC68B421C29E3E2A63C812BD3C633CCD4D461293E51678113F\",\"singer\":\"赵海洋\",\"song\":\"人生的旅途\",\"mediaId\":\"102798907\",\"songId\":\"102798907\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002VH3gj4KlVDy.m4a?fromtag=35673&guid=12345673&uin=0&vkey=2AD71756AC64CAB94CF60A2D46DE5B77106C8A088E36A8592CA0D8AF0B598E94B4F651CEC1DB78C4A882317211BFFF83E1C57022BA236202\",\"singer\":\"K.Williams\",\"song\":\"天空之城\",\"mediaId\":\"9478098\",\"songId\":\"9478098\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C4000019ml2f0VXwx6.m4a?fromtag=35673&guid=12345673&uin=0&vkey=21977746295403A1DD54429B4756C0C693E3A0848192035B67C4470EA35F974965338BAD57749C9C481FE76732418AC9789BCA45E1700257\",\"singer\":\"Bandari\",\"song\":\"Annie's W'onderland\",\"mediaId\":\"1663408\",\"songId\":\"1663408\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002LqhBd39LZnW.m4a?fromtag=35673&guid=12345673&uin=0&vkey=6DBC72250393C877AD8B4640E41AE164EF796B2E956D4FC771C132F3B85D0997A09FFC411483048A52EAF595F7FD230926AB54C858CFA91E\",\"singer\":\"吕思清\",\"song\":\"舒伯特:小夜曲\",\"mediaId\":\"4705252\",\"songId\":\"4705252\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002LAv7Q2JNkVT.m4a?fromtag=35673&guid=12345673&uin=0&vkey=65CE4865F1F583B4A9748A70E947AAB9701B819EB08918BEC9F60E7A5971CAE8E994EC2683D22F8A5E041B38A97AB6018DABC848E3B1B910\",\"singer\":\"Yanni\",\"song\":\"Nightingale\",\"mediaId\":\"1985172\",\"songId\":\"1985172\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000VIoM64c0EfO.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=8A6EDA1759B67E32D9C2C8EE799433ACCCDFAA8353B2E909465A59B019D1F10623759443E3F742FA16C14455D7028D40FB85CDC3AB0123BD\",\"singer\":\"Wayne Gratz\",\"song\":\"A Time For Us\",\"mediaId\":\"2500205\",\"songId\":\"2500205\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000AQNVz26uG6D.m4a?fromtag=35673&guid=12345673&uin=0&vkey=F0EA2B71B7BD455C333E4978D4A1FC29914361A973D012F57D5AE203D419744BE3014BEA2D926A9510B2EC77B9D853263928242B0DDB7EC9\",\"singer\":\"Richard Clayderman\",\"song\":\"梦中的婚礼\",\"mediaId\":\"777379\",\"songId\":\"777379\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400001fkQ2O3KYz5N.m4a?fromtag=35673&guid=12345673&uin=0&vkey=10F2986C324C4A03746097365231FB505542C1DDDB601ED933B44187669CABCB6CC02687B5E8FB72DE99EFEBD46C67C5B4F11B82203D29AB\",\"singer\":\"Tom Barabas\",\"song\":\"Moon dust\",\"mediaId\":\"1845156\",\"songId\":\"1845156\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003TzupI4O2sGJ.m4a?fromtag=35673&guid=12345673&uin=0&vkey=8FDABADD072B53E3BA89B1005604BC0AB877DB949AB7CC7F577CC50CF0CA1E42C11927959EA5595F472A6339591A2C74B7E0C6F389BCD7FA\",\"singer\":\"George Winston\",\"song\":\"Variations On The Canon By Pachelbel\",\"mediaId\":\"4896119\",\"songId\":\"4896119\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000qg7fB0wtSvn.m4a?fromtag=35673&guid=12345673&uin=0&vkey=3C9EDDE57CA8DF128AFC65DE42D19F2ADE7AF0F52F7FCEE59D639FDAC8A893552F23378B3CFFBD55EAE992548FADC28616DF546E32CCABC6\",\"singer\":\"Andemund Orchestra\",\"song\":\"Fairy Dream\",\"mediaId\":\"692102\",\"songId\":\"692102\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003iSnJU1NjJeC.m4a?fromtag=30192&guid=2000000192&uin=0&vkey=DFA0ED020B8B02B7F595FFECD39167A452EDFC67C9D8DF55B47386D60724B0AE6438D401BE15AF8284BD7022A8DFEB848895509CBAD8DFBC\",\"singer\":\"Secret Garden\",\"song\":\"Songs From A Secret Garden\",\"mediaId\":\"876733\",\"songId\":\"876733\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400002kROXV0xUNz3.m4a?fromtag=35673&guid=12345673&uin=0&vkey=61E6DDDF88586EDA8DEDCA8516AEDE40D0B3850731CA8DEB8A9AC395AE74C60823C313F283972C5E59600C200C9CAC331B96D4DBE7A9DA8B\",\"singer\":\"Kevin Kern\",\"song\":\"绿色通道\",\"mediaId\":\"1663373\",\"songId\":\"1663373\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003QYfHm2ESNb4.m4a?fromtag=35673&guid=12345673&uin=0&vkey=AE98D9FFA1E34399D736666BC1DBE619A7E02B2BDBC5EE81E77124D046CD691981AF4411D54FE75352DCEED3EF46F433B67C7CB07B00BF21\",\"singer\":\"Richard Clayderman\",\"song\":\"爱的协奏曲\",\"mediaId\":\"4847250\",\"songId\":\"4847250\"}]}"}}} +{"level":"info","time":"2022-08-24 15:33:47","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"music\\\",\\\"intent\\\":\\\"play\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835315751129088\\\",\\\"slots\\\":[{\\\"name\\\":\\\"song\\\",\\\"value\\\":\\\"秋日私语\\\"}]}},\\\"response_text\\\":\\\"您的设备尚未授权,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放秋日私语\\\",\\\"listItems\\\":[{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003Ddh2A2XULs4.m4a?fromtag=380\\u0026guid=12345673\\u0026uin=0\\u0026vkey=397A3733515828F5E5EF5C895EA450DF5AB8B38EA6DD0E77066309DA5C28A958E60BB85C27C62A2774DB334BECA5589515504665DF542806\\\",\\\"singer\\\":\\\"Richard Clayderman\\\",\\\"song\\\":\\\"秋日私语\\\",\\\"mediaId\\\":\\\"635322\\\",\\\"songId\\\":\\\"635322\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003Las7v2LicMV.m4a?fromtag=30192\\u0026guid=2000000192\\u0026uin=0\\u0026vkey=A5F2F79F2AABA39223765AE0AE1A07831033233F065EA7C86B3CB80E956EA9CB39091068536CB8A3EFB24B5F6F5FA7C62C2E3E518F949C56\\\",\\\"singer\\\":\\\"Peter Kater\\\",\\\"song\\\":\\\"Gently Dreaming\\\",\\\"mediaId\\\":\\\"101601592\\\",\\\"songId\\\":\\\"101601592\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003rYNqj0HzHXq.m4a?fromtag=30128\\u0026guid=2000000128\\u0026uin=0\\u0026vkey=5F405D11E5A06CB07CB77DA50789CE4FC06FEE3A5758974D3802249DF5A50F7CBEB3C095AE1B9511F10C6E2C90717E1B30071174A05547B4\\\",\\\"singer\\\":\\\"谭维维/吕思清/陈萨\\\",\\\"song\\\":\\\"英雄赞歌\\\",\\\"mediaId\\\":\\\"280555114\\\",\\\"songId\\\":\\\"280555114\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400000OH6Pd01IXZw.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=4389FB940A3F6ED1D06A2034DA2D56219EAD17A6154A3CA605C8D0F4A56CF9B2355487946377281AD049840BC0C8DBA12B7F49517D81200A\\\",\\\"singer\\\":\\\"吕思清\\\",\\\"song\\\":\\\"柴可夫斯基:如歌的行板\\\",\\\"mediaId\\\":\\\"4705250\\\",\\\"songId\\\":\\\"4705250\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400004IZL4j09NGeL.m4a?fromtag=30192\\u0026guid=2000000192\\u0026uin=0\\u0026vkey=CBF5E46353F73C1F9FE320426AA4FAF5E4BE6B45E9C406AFDB18043A5CB24A4311F13E7BAFA6F7BDD7FA30A4B1FDE726D54AFE6A33A532A6\\\",\\\"singer\\\":\\\"Brian Crain\\\",\\\"song\\\":\\\"Broken Shadows\\\",\\\"mediaId\\\":\\\"1252082\\\",\\\"songId\\\":\\\"1252082\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003VkZpy1OtH7K.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=638DFD7C844441E68F994664904FF9825810879188D6447BE316847BB116725884ADF0E02E0B52978DE5A9E2E57DF4E84C03895832EC9028\\\",\\\"singer\\\":\\\"吕思清\\\",\\\"song\\\":\\\"蒙迪:查尔达斯\\\",\\\"mediaId\\\":\\\"4705257\\\",\\\"songId\\\":\\\"4705257\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003OR33j0cXkei.m4a?fromtag=30192\\u0026guid=2000000192\\u0026uin=0\\u0026vkey=AD279233572AA9FB05886374508D39273181C71CCAC4BC3EEA4FBD37FB9E4AF1630ED531ABFB62971820AC2317A58976C73A529616CCFFA0\\\",\\\"singer\\\":\\\"Kenny G\\\",\\\"song\\\":\\\"Going Home\\\",\\\"mediaId\\\":\\\"4829444\\\",\\\"songId\\\":\\\"4829444\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400002MmNm507Uebb.m4a?fromtag=30192\\u0026guid=2000000192\\u0026uin=0\\u0026vkey=DE96DB55D1E0025D8BF9E6A6EFBFDB00DAFF9CCEAA1A398E6DB57E334BE465091F314ACF532C4D2FF3801FA231568494D0826B1A07963B71\\\",\\\"singer\\\":\\\"Yanni\\\",\\\"song\\\":\\\"One Man's Dream\\\",\\\"mediaId\\\":\\\"426802\\\",\\\"songId\\\":\\\"426802\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400000eoSaK1252bh.m4a?fromtag=30039\\u0026guid=2000000039\\u0026uin=0\\u0026vkey=ED15B254729A3B65E5E886B87C9366269307716D54C3D6EA93B5A1FFF739F9DC68B421C29E3E2A63C812BD3C633CCD4D461293E51678113F\\\",\\\"singer\\\":\\\"赵海洋\\\",\\\"song\\\":\\\"人生的旅途\\\",\\\"mediaId\\\":\\\"102798907\\\",\\\"songId\\\":\\\"102798907\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400002VH3gj4KlVDy.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=2AD71756AC64CAB94CF60A2D46DE5B77106C8A088E36A8592CA0D8AF0B598E94B4F651CEC1DB78C4A882317211BFFF83E1C57022BA236202\\\",\\\"singer\\\":\\\"K.Williams\\\",\\\"song\\\":\\\"天空之城\\\",\\\"mediaId\\\":\\\"9478098\\\",\\\"songId\\\":\\\"9478098\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C4000019ml2f0VXwx6.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=21977746295403A1DD54429B4756C0C693E3A0848192035B67C4470EA35F974965338BAD57749C9C481FE76732418AC9789BCA45E1700257\\\",\\\"singer\\\":\\\"Bandari\\\",\\\"song\\\":\\\"Annie's W'onderland\\\",\\\"mediaId\\\":\\\"1663408\\\",\\\"songId\\\":\\\"1663408\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400002LqhBd39LZnW.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=6DBC72250393C877AD8B4640E41AE164EF796B2E956D4FC771C132F3B85D0997A09FFC411483048A52EAF595F7FD230926AB54C858CFA91E\\\",\\\"singer\\\":\\\"吕思清\\\",\\\"song\\\":\\\"舒伯特:小夜曲\\\",\\\"mediaId\\\":\\\"4705252\\\",\\\"songId\\\":\\\"4705252\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400002LAv7Q2JNkVT.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=65CE4865F1F583B4A9748A70E947AAB9701B819EB08918BEC9F60E7A5971CAE8E994EC2683D22F8A5E041B38A97AB6018DABC848E3B1B910\\\",\\\"singer\\\":\\\"Yanni\\\",\\\"song\\\":\\\"Nightingale\\\",\\\"mediaId\\\":\\\"1985172\\\",\\\"songId\\\":\\\"1985172\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400000VIoM64c0EfO.m4a?fromtag=30192\\u0026guid=2000000192\\u0026uin=0\\u0026vkey=8A6EDA1759B67E32D9C2C8EE799433ACCCDFAA8353B2E909465A59B019D1F10623759443E3F742FA16C14455D7028D40FB85CDC3AB0123BD\\\",\\\"singer\\\":\\\"Wayne Gratz\\\",\\\"song\\\":\\\"A Time For Us\\\",\\\"mediaId\\\":\\\"2500205\\\",\\\"songId\\\":\\\"2500205\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400000AQNVz26uG6D.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=F0EA2B71B7BD455C333E4978D4A1FC29914361A973D012F57D5AE203D419744BE3014BEA2D926A9510B2EC77B9D853263928242B0DDB7EC9\\\",\\\"singer\\\":\\\"Richard Clayderman\\\",\\\"song\\\":\\\"梦中的婚礼\\\",\\\"mediaId\\\":\\\"777379\\\",\\\"songId\\\":\\\"777379\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400001fkQ2O3KYz5N.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=10F2986C324C4A03746097365231FB505542C1DDDB601ED933B44187669CABCB6CC02687B5E8FB72DE99EFEBD46C67C5B4F11B82203D29AB\\\",\\\"singer\\\":\\\"Tom Barabas\\\",\\\"song\\\":\\\"Moon dust\\\",\\\"mediaId\\\":\\\"1845156\\\",\\\"songId\\\":\\\"1845156\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003TzupI4O2sGJ.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=8FDABADD072B53E3BA89B1005604BC0AB877DB949AB7CC7F577CC50CF0CA1E42C11927959EA5595F472A6339591A2C74B7E0C6F389BCD7FA\\\",\\\"singer\\\":\\\"George Winston\\\",\\\"song\\\":\\\"Variations On The Canon By Pachelbel\\\",\\\"mediaId\\\":\\\"4896119\\\",\\\"songId\\\":\\\"4896119\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400000qg7fB0wtSvn.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=3C9EDDE57CA8DF128AFC65DE42D19F2ADE7AF0F52F7FCEE59D639FDAC8A893552F23378B3CFFBD55EAE992548FADC28616DF546E32CCABC6\\\",\\\"singer\\\":\\\"Andemund Orchestra\\\",\\\"song\\\":\\\"Fairy Dream\\\",\\\"mediaId\\\":\\\"692102\\\",\\\"songId\\\":\\\"692102\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003iSnJU1NjJeC.m4a?fromtag=30192\\u0026guid=2000000192\\u0026uin=0\\u0026vkey=DFA0ED020B8B02B7F595FFECD39167A452EDFC67C9D8DF55B47386D60724B0AE6438D401BE15AF8284BD7022A8DFEB848895509CBAD8DFBC\\\",\\\"singer\\\":\\\"Secret Garden\\\",\\\"song\\\":\\\"Songs From A Secret Garden\\\",\\\"mediaId\\\":\\\"876733\\\",\\\"songId\\\":\\\"876733\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400002kROXV0xUNz3.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=61E6DDDF88586EDA8DEDCA8516AEDE40D0B3850731CA8DEB8A9AC395AE74C60823C313F283972C5E59600C200C9CAC331B96D4DBE7A9DA8B\\\",\\\"singer\\\":\\\"Kevin Kern\\\",\\\"song\\\":\\\"绿色通道\\\",\\\"mediaId\\\":\\\"1663373\\\",\\\"songId\\\":\\\"1663373\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003QYfHm2ESNb4.m4a?fromtag=35673\\u0026guid=12345673\\u0026uin=0\\u0026vkey=AE98D9FFA1E34399D736666BC1DBE619A7E02B2BDBC5EE81E77124D046CD691981AF4411D54FE75352DCEED3EF46F433B67C7CB07B00BF21\\\",\\\"singer\\\":\\\"Richard Clayderman\\\",\\\"song\\\":\\\"爱的协奏曲\\\",\\\"mediaId\\\":\\\"4847250\\\",\\\"songId\\\":\\\"4847250\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:18","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"身体和灵魂的音乐灵性\",\"ip\":\"121.35.103.189\",\"originQuery\":\"身体和灵魂的音乐灵性\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:18","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:18","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:18","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"身体和灵魂的音乐灵性\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:18","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我好像没听懂,能请你换个说法试试吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我好像没听懂,能请你换个说法试试吗?\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326458665445_CQ6lIy3355Q7f"}} +{"level":"debug","time":"2022-08-24 15:34:18","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我好像没听懂,能请你换个说法试试吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我好像没听懂,能请你换个说法试试吗?\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:34:18","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我好像没听懂,能请你换个说法试试吗?\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"我好像没听懂,能请你换个说法试试吗?\"}"}}} +{"level":"info","time":"2022-08-24 15:34:18","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"我好像没听懂,能请你换个说法试试吗?\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"我好像没听懂,能请你换个说法试试吗?\\\",\\\"asr_recongize\\\":\\\"身体和灵魂的音乐灵性\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:24","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放灵性\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放灵性\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:24","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:24","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:24","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放灵性\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"singer\",\"value\":\"靈性\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"selfData\":{\"displayFormat\":1,\"playMode\":0}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":926000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003KKTNr0lRZXq.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=CDF51B174682A73AD54ACF844702E91926A6A72E094013ED994F003116C1A5A2B88CF41C0AE317B8DC68F2396A61A232E62D13527D2AA84F\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003KKTNr0lRZXq\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001tC9am0yLjhB_1.jpg\"}]},\"mediaId\":\"276811224\",\"selfData\":{\"album\":\"靜觀心靈音樂\",\"albumId\":\"14495228\",\"albumPubTime\":\"2008-03-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"二胡/廖圆荣/許國勝/水晶琴/刘露/笛子\",\"singerId\":\"3658417\",\"singerPics\":[],\"song\":\"靈性\",\"songId\":\"276811224\",\"songMid\":\"003KKTNr0lRZXq\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"二胡/廖圆荣/許國勝/水晶琴/刘露/笛子\",\"textContent\":\"靜觀心靈音樂\",\"title\":\"靈性\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":317000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400001sxCFS2GTfQ9.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=9D06AC4DAD380C6E1D6533230FE1F19CAA9E8D6C31B65F6E11B29AA73B8416A51C9AD6E4B7087198E1956F759B94D937E1DB84DDB2FC17B7\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=001sxCFS2GTfQ9\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001fMYAN3YIvn8_1.jpg\"}]},\"mediaId\":\"239511683\",\"selfData\":{\"album\":\"瑜伽音乐最好听的一首 - 器乐 | 冥想音乐大自然 | 背景音乐 | 放松方法 | 灵气 | 减少压力 | 身体和灵魂\",\"albumId\":\"8258087\",\"albumPubTime\":\"2019-09-10\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"身体和灵魂的音乐\",\"singerId\":\"4003442\",\"singerPics\":[],\"song\":\"灵性\",\"songId\":\"239511683\",\"songMid\":\"001sxCFS2GTfQ9\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"身体和灵魂的音乐\",\"textContent\":\"瑜伽音乐最好听的一首 - 器乐 | 冥想音乐大自然 | 背景音乐 | 放松方法 | 灵气 | 减少压力 | 身体和灵魂\",\"title\":\"灵性\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":247000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000F5qMg2d24QL.m4a?fromtag=302&guid=2000000107&uin=0&vkey=BA89072384CC0BAC15CAACA6F9BAC80A940981B88E7D1B3C706607243630BA0F1824952C8CED4E2079A11409CBD608B9EC42E13BB5013AAF\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000F5qMg2d24QL\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002riGvn216dJi_1.jpg\"}]},\"mediaId\":\"239507350\",\"selfData\":{\"album\":\"冥想音乐大自然 - 缓解压力 | 瑜伽音乐 | 禅宗 | 灵性 | 正念 | 音乐疗法 | 浓度 | 大自然的声音 | 环境音乐\",\"albumId\":\"8257623\",\"albumPubTime\":\"2019-09-05\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"瑜伽和冥想的音乐\",\"singerId\":\"4003299\",\"singerPics\":[],\"song\":\"瑜伽音乐冥想放松音乐\",\"songId\":\"239507350\",\"songMid\":\"000F5qMg2d24QL\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"瑜伽和冥想的音乐\",\"textContent\":\"冥想音乐大自然 - 缓解压力 | 瑜伽音乐 | 禅宗 | 灵性 | 正念 | 音乐疗法 | 浓度 | 大自然的声音 | 环境音乐\",\"title\":\"瑜伽音乐冥想放松音乐\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"你要找的是不是二胡/廖圆荣/許國勝/水晶琴/刘露/笛子的靈性?听听看吧。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326465208325_aTKonXXikAOLN"}} +{"level":"debug","time":"2022-08-24 15:34:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"singer\",\"value\":\"靈性\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"AUDIO\"},\"globalInfo\":{\"selfData\":{\"displayFormat\":1,\"playMode\":0}},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":926000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003KKTNr0lRZXq.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=CDF51B174682A73AD54ACF844702E91926A6A72E094013ED994F003116C1A5A2B88CF41C0AE317B8DC68F2396A61A232E62D13527D2AA84F\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=003KKTNr0lRZXq\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001tC9am0yLjhB_1.jpg\"}]},\"mediaId\":\"276811224\",\"selfData\":{\"album\":\"靜觀心靈音樂\",\"albumId\":\"14495228\",\"albumPubTime\":\"2008-03-01\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"二胡/廖圆荣/許國勝/水晶琴/刘露/笛子\",\"singerId\":\"3658417\",\"singerPics\":[],\"song\":\"靈性\",\"songId\":\"276811224\",\"songMid\":\"003KKTNr0lRZXq\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"二胡/廖圆荣/許國勝/水晶琴/刘露/笛子\",\"textContent\":\"靜觀心靈音樂\",\"title\":\"靈性\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":317000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400001sxCFS2GTfQ9.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=9D06AC4DAD380C6E1D6533230FE1F19CAA9E8D6C31B65F6E11B29AA73B8416A51C9AD6E4B7087198E1956F759B94D937E1DB84DDB2FC17B7\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=001sxCFS2GTfQ9\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000001fMYAN3YIvn8_1.jpg\"}]},\"mediaId\":\"239511683\",\"selfData\":{\"album\":\"瑜伽音乐最好听的一首 - 器乐 | 冥想音乐大自然 | 背景音乐 | 放松方法 | 灵气 | 减少压力 | 身体和灵魂\",\"albumId\":\"8258087\",\"albumPubTime\":\"2019-09-10\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"身体和灵魂的音乐\",\"singerId\":\"4003442\",\"singerPics\":[],\"song\":\"灵性\",\"songId\":\"239511683\",\"songMid\":\"001sxCFS2GTfQ9\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"身体和灵魂的音乐\",\"textContent\":\"瑜伽音乐最好听的一首 - 器乐 | 冥想音乐大自然 | 背景音乐 | 放松方法 | 灵气 | 减少压力 | 身体和灵魂\",\"title\":\"灵性\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}},{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":247000},\"stream\":{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000F5qMg2d24QL.m4a?fromtag=302&guid=2000000107&uin=0&vkey=BA89072384CC0BAC15CAACA6F9BAC80A940981B88E7D1B3C706607243630BA0F1824952C8CED4E2079A11409CBD608B9EC42E13BB5013AAF\"}},\"htmlView\":\"http://c.y.qq.com/v8/playsong.html?songmid=000F5qMg2d24QL\",\"image\":{\"sources\":[{\"url\":\"http://y.gtimg.cn/music/photo_new/T002R500x500M000002riGvn216dJi_1.jpg\"}]},\"mediaId\":\"239507350\",\"selfData\":{\"album\":\"冥想音乐大自然 - 缓解压力 | 瑜伽音乐 | 禅宗 | 灵性 | 正念 | 音乐疗法 | 浓度 | 大自然的声音 | 环境音乐\",\"albumId\":\"8257623\",\"albumPubTime\":\"2019-09-05\",\"expiredTime\":43200,\"hot\":0,\"lyrics\":\"\",\"mvId\":\"\",\"similar\":0,\"singer\":\"瑜伽和冥想的音乐\",\"singerId\":\"4003299\",\"singerPics\":[],\"song\":\"瑜伽音乐冥想放松音乐\",\"songId\":\"239507350\",\"songMid\":\"000F5qMg2d24QL\",\"songlist\":{\"eType\":0,\"iListenNum\":0,\"iSongNum\":0,\"lCreateTime\":0,\"lUpdateTime\":0,\"sId\":\"\",\"sListenNum\":\"\",\"sName\":\"\",\"sPic\":\"\",\"semantic\":\"\",\"vecSongInfo\":[]},\"source\":\"QQ音乐\",\"try30sUrl\":\"\",\"tryBegin\":0,\"tryEnd\":0,\"tryFileSize\":0,\"tryPlayable\":0,\"tvfilm\":\"\",\"unplayableCode\":0,\"unplayableMsg\":\"\"},\"subTitle\":\"瑜伽和冥想的音乐\",\"textContent\":\"冥想音乐大自然 - 缓解压力 | 瑜伽音乐 | 禅宗 | 灵性 | 正念 | 音乐疗法 | 浓度 | 大自然的声音 | 环境音乐\",\"title\":\"瑜伽音乐冥想放松音乐\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"你要找的是不是二胡/廖圆荣/許國勝/水晶琴/刘露/笛子的靈性?听听看吧。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:34:25","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"singer\",\"value\":\"靈性\"}]}},\"response_text\":\"您的设备尚未授权,请前往格力+手机应用绑定授权。\",\"listItems\":[{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400003KKTNr0lRZXq.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=CDF51B174682A73AD54ACF844702E91926A6A72E094013ED994F003116C1A5A2B88CF41C0AE317B8DC68F2396A61A232E62D13527D2AA84F\",\"singer\":\"二胡/廖圆荣/許國勝/水晶琴/刘露/笛子\",\"song\":\"靈性\",\"mediaId\":\"276811224\",\"songId\":\"276811224\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400001sxCFS2GTfQ9.m4a?fromtag=30128&guid=2000000128&uin=0&vkey=9D06AC4DAD380C6E1D6533230FE1F19CAA9E8D6C31B65F6E11B29AA73B8416A51C9AD6E4B7087198E1956F759B94D937E1DB84DDB2FC17B7\",\"singer\":\"身体和灵魂的音乐\",\"song\":\"灵性\",\"mediaId\":\"239511683\",\"songId\":\"239511683\"},{\"url\":\"http://isure6.stream.qqmusic.qq.com/C400000F5qMg2d24QL.m4a?fromtag=302&guid=2000000107&uin=0&vkey=BA89072384CC0BAC15CAACA6F9BAC80A940981B88E7D1B3C706607243630BA0F1824952C8CED4E2079A11409CBD608B9EC42E13BB5013AAF\",\"singer\":\"瑜伽和冥想的音乐\",\"song\":\"瑜伽音乐冥想放松音乐\",\"mediaId\":\"239507350\",\"songId\":\"239507350\"}]}"}}} +{"level":"info","time":"2022-08-24 15:34:25","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":0,\\\"domain\\\":\\\"music\\\",\\\"intent\\\":\\\"play\\\",\\\"msg\\\":\\\"\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"990835315751129088\\\",\\\"slots\\\":[{\\\"name\\\":\\\"singer\\\",\\\"value\\\":\\\"靈性\\\"}]}},\\\"response_text\\\":\\\"您的设备尚未授权,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放灵性\\\",\\\"listItems\\\":[{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400003KKTNr0lRZXq.m4a?fromtag=30128\\u0026guid=2000000128\\u0026uin=0\\u0026vkey=CDF51B174682A73AD54ACF844702E91926A6A72E094013ED994F003116C1A5A2B88CF41C0AE317B8DC68F2396A61A232E62D13527D2AA84F\\\",\\\"singer\\\":\\\"二胡/廖圆荣/許國勝/水晶琴/刘露/笛子\\\",\\\"song\\\":\\\"靈性\\\",\\\"mediaId\\\":\\\"276811224\\\",\\\"songId\\\":\\\"276811224\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400001sxCFS2GTfQ9.m4a?fromtag=30128\\u0026guid=2000000128\\u0026uin=0\\u0026vkey=9D06AC4DAD380C6E1D6533230FE1F19CAA9E8D6C31B65F6E11B29AA73B8416A51C9AD6E4B7087198E1956F759B94D937E1DB84DDB2FC17B7\\\",\\\"singer\\\":\\\"身体和灵魂的音乐\\\",\\\"song\\\":\\\"灵性\\\",\\\"mediaId\\\":\\\"239511683\\\",\\\"songId\\\":\\\"239511683\\\"},{\\\"url\\\":\\\"http://isure6.stream.qqmusic.qq.com/C400000F5qMg2d24QL.m4a?fromtag=302\\u0026guid=2000000107\\u0026uin=0\\u0026vkey=BA89072384CC0BAC15CAACA6F9BAC80A940981B88E7D1B3C706607243630BA0F1824952C8CED4E2079A11409CBD608B9EC42E13BB5013AAF\\\",\\\"singer\\\":\\\"瑜伽和冥想的音乐\\\",\\\"song\\\":\\\"瑜伽音乐冥想放松音乐\\\",\\\"mediaId\\\":\\\"239507350\\\",\\\"songId\\\":\\\"239507350\\\"}]}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:52","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放车内听雨\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放车内听雨\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:52","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:52","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:52","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放车内听雨\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:34:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"车内听雨\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326493202746_c6sAB20xQQcdL"}} +{"level":"debug","time":"2022-08-24 15:34:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"车内听雨\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:34:53","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\n\t\t\t\t\t\"header\": {\n\t\t\t\t\t\t\"semantic\": {\n\t\t\t\t\t\t\t\"code\": 0,\n\t\t\t\t\t\t\t\"domain\": \"chat\",\n\t\t\t\t\t\t\t\"intent\": \"chat\",\n\t\t\t\t\t\t\t\"msg\": \"\",\n\t\t\t\t\t\t\t\"session_complete\": true,\n\t\t\t\t\t\t\t\"skill_id\": \"music.play\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"response_text\": \"您的设备尚未授权,请前往格力+手机应用绑定授权。\"\n\t\t\t\t}"}}} +{"level":"info","time":"2022-08-24 15:34:53","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\n\\t\\t\\t\\t\\t\\t\\\"semantic\\\": {\\n\\t\\t\\t\\t\\t\\t\\t\\\"code\\\": 0,\\n\\t\\t\\t\\t\\t\\t\\t\\\"domain\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"intent\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"msg\\\": \\\"\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"session_complete\\\": true,\\n\\t\\t\\t\\t\\t\\t\\t\\\"skill_id\\\": \\\"music.play\\\"\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t},\\\"response_text\\\":\\\"您的设备尚未授权,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放车内听雨\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:27","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放棕叶下的雨\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放棕叶下的雨\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:27","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:27","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:27","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放棕叶下的雨\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:28","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"棕叶下的雨\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326527992992_cTZSdBhLNuEpX"}} +{"level":"debug","time":"2022-08-24 15:35:28","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"棕叶下的雨\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:35:28","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\n\t\t\t\t\t\"header\": {\n\t\t\t\t\t\t\"semantic\": {\n\t\t\t\t\t\t\t\"code\": 0,\n\t\t\t\t\t\t\t\"domain\": \"chat\",\n\t\t\t\t\t\t\t\"intent\": \"chat\",\n\t\t\t\t\t\t\t\"msg\": \"\",\n\t\t\t\t\t\t\t\"session_complete\": true,\n\t\t\t\t\t\t\t\"skill_id\": \"music.play\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"response_text\": \"您的设备尚未授权,请前往格力+手机应用绑定授权。\"\n\t\t\t\t}"}}} +{"level":"info","time":"2022-08-24 15:35:28","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\n\\t\\t\\t\\t\\t\\t\\\"semantic\\\": {\\n\\t\\t\\t\\t\\t\\t\\t\\\"code\\\": 0,\\n\\t\\t\\t\\t\\t\\t\\t\\\"domain\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"intent\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"msg\\\": \\\"\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"session_complete\\\": true,\\n\\t\\t\\t\\t\\t\\t\\t\\\"skill_id\\\": \\\"music.play\\\"\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t},\\\"response_text\\\":\\\"您的设备尚未授权,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放棕叶下的雨\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:36","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放虫鸣雨声\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放虫鸣雨声\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放虫鸣雨声\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 15:35:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"虫鸣雨声\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661326536308195_RWSSmCyPf7aIC"}} +{"level":"debug","time":"2022-08-24 15:35:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"虫鸣雨声\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 15:35:36","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\n\t\t\t\t\t\"header\": {\n\t\t\t\t\t\t\"semantic\": {\n\t\t\t\t\t\t\t\"code\": 0,\n\t\t\t\t\t\t\t\"domain\": \"chat\",\n\t\t\t\t\t\t\t\"intent\": \"chat\",\n\t\t\t\t\t\t\t\"msg\": \"\",\n\t\t\t\t\t\t\t\"session_complete\": true,\n\t\t\t\t\t\t\t\"skill_id\": \"music.play\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"response_text\": \"您的设备尚未授权,请前往格力+手机应用绑定授权。\"\n\t\t\t\t}"}}} +{"level":"info","time":"2022-08-24 15:35:36","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\n\\t\\t\\t\\t\\t\\t\\\"semantic\\\": {\\n\\t\\t\\t\\t\\t\\t\\t\\\"code\\\": 0,\\n\\t\\t\\t\\t\\t\\t\\t\\\"domain\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"intent\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"msg\\\": \\\"\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"session_complete\\\": true,\\n\\t\\t\\t\\t\\t\\t\\t\\\"skill_id\\\": \\\"music.play\\\"\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t},\\\"response_text\\\":\\\"您的设备尚未授权,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放虫鸣雨声\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:07","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"温柔海浪\",\"ip\":\"121.35.103.189\",\"originQuery\":\"温柔海浪\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"温柔海浪\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没听明白你刚刚说了啥。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我没听明白你刚刚说了啥。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661328307775243_BpousxI30zW7A"}} +{"level":"debug","time":"2022-08-24 16:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没听明白你刚刚说了啥。\",\"session_complete\":true,\"skill_id\":\"\"}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillIcon\":\"\",\"skillName\":\"\"},\"controlInfo\":{\"audioConsole\":\"true\",\"orientation\":\"portrait\",\"textSpeak\":\"true\",\"type\":\"TEXT\",\"version\":\"1.0.0\"},\"globalInfo\":{\"backgroundAudio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"backgroundImage\":{\"contentDescription\":\"\",\"sources\":[]},\"seeMore\":\"\"},\"listItems\":[{\"audio\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"stream\":{\"url\":\"\"}},\"htmlView\":\"\",\"image\":{\"contentDescription\":\"\",\"sources\":[]},\"mediaId\":\"\",\"textContent\":\"我没听明白你刚刚说了啥。\",\"title\":\"\",\"video\":{\"metadata\":{\"offsetInMilliseconds\":0,\"totalMilliseconds\":0},\"sources\":[]}}],\"templateInfo\":{\"t_id\":\"\"}}},\"response_text\":\"\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 16:05:07","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\"header\":{\"semantic\":{\"code\":-3,\"domain\":\"chat\",\"intent\":\"chat\",\"msg\":\"我没听明白你刚刚说了啥。\",\"session_complete\":true,\"skill_id\":\"\"}},\"response_text\":\"我没听明白你刚刚说了啥。\"}"}}} +{"level":"info","time":"2022-08-24 16:05:07","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\\"semantic\\\":{\\\"code\\\":-3,\\\"domain\\\":\\\"chat\\\",\\\"intent\\\":\\\"chat\\\",\\\"msg\\\":\\\"我没听明白你刚刚说了啥。\\\",\\\"session_complete\\\":true,\\\"skill_id\\\":\\\"\\\"}},\\\"response_text\\\":\\\"我没听明白你刚刚说了啥。\\\",\\\"asr_recongize\\\":\\\"温柔海浪\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:11","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"502cc67f0036\",\"macVoice\":\"502cc67f0036\",\"query\":\"播放温柔海浪\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放温柔海浪\",\"mid\":\"10f00\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:11","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"502cc67f0036","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:11","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_77d7b2ecafc85737779842991b52fe62","authorization":"","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":1,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:11","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"0e92608902a2c95e283d88adec41b80f\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放温柔海浪\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:05:11","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"温柔海浪\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661328311291132_3YqE2vkKdLcGr"}} +{"level":"debug","time":"2022-08-24 16:05:11","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"温柔海浪\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 16:05:11","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\n\t\t\t\t\t\"header\": {\n\t\t\t\t\t\t\"semantic\": {\n\t\t\t\t\t\t\t\"code\": 0,\n\t\t\t\t\t\t\t\"domain\": \"chat\",\n\t\t\t\t\t\t\t\"intent\": \"chat\",\n\t\t\t\t\t\t\t\"msg\": \"\",\n\t\t\t\t\t\t\t\"session_complete\": true,\n\t\t\t\t\t\t\t\"skill_id\": \"music.play\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"response_text\": \"您的设备尚未授权,请前往格力+手机应用绑定授权。\"\n\t\t\t\t}"}}} +{"level":"info","time":"2022-08-24 16:05:11","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\n\\t\\t\\t\\t\\t\\t\\\"semantic\\\": {\\n\\t\\t\\t\\t\\t\\t\\t\\\"code\\\": 0,\\n\\t\\t\\t\\t\\t\\t\\t\\\"domain\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"intent\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"msg\\\": \\\"\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"session_complete\\\": true,\\n\\t\\t\\t\\t\\t\\t\\t\\\"skill_id\\\": \\\"music.play\\\"\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t},\\\"response_text\\\":\\\"您的设备尚未授权,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放温柔海浪\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:08","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"28b77c201431\",\"macVoice\":\"28b77c201431\",\"query\":\"播放温柔海浪\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放温柔海浪\",\"mid\":\"11011\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"28b77c201431","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_1f8917ec9bbc0f1f49727b2e48078469","authorization":"BACKEND-ENCRYPT:1000,NywxMTA2MDk4MzczLDE5MzNDREJBNzEwM0I5MjBEQTRGOUZCN0VDRERGRkJBLDc2NEEyQkY5RTY4MjQ0RDJFQUU4QzA3RjkxRENCMjAyLDhkM2I2MDc2LTNiYjQtNGMyNi04OWMzLTAxMTQ0Nzk5NjA0NDozMWI2MjQ5NWJlOWI0ZmYzODllZTk1MmE0YzRiZDJjZiw4ZDNiNjA3Ni0zYmI0LTRjMjYtODljMy0wMTE0NDc5OTYwNDRfMWY4OTE3ZWM5YmJjMGYxZjQ5NzI3YjJlNDgwNzg0NjksNDQ3MzcxZDgwMDljNzBlNA==","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":3,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"fdd4b3c4a232375da32aa8695da7e023\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放温柔海浪\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"温柔海浪\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661328908740920_yzq4j8B24KOfK"}} +{"level":"debug","time":"2022-08-24 16:15:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"温柔海浪\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 16:15:08","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\n\t\t\t\t\t\"header\": {\n\t\t\t\t\t\t\"semantic\": {\n\t\t\t\t\t\t\t\"code\": 0,\n\t\t\t\t\t\t\t\"domain\": \"chat\",\n\t\t\t\t\t\t\t\"intent\": \"chat\",\n\t\t\t\t\t\t\t\"msg\": \"\",\n\t\t\t\t\t\t\t\"session_complete\": true,\n\t\t\t\t\t\t\t\"skill_id\": \"music.play\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"response_text\": \"您的设备授权过期,请前往格力+手机应用绑定授权。\"\n\t\t\t\t}"}}} +{"level":"info","time":"2022-08-24 16:15:08","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\n\\t\\t\\t\\t\\t\\t\\\"semantic\\\": {\\n\\t\\t\\t\\t\\t\\t\\t\\\"code\\\": 0,\\n\\t\\t\\t\\t\\t\\t\\t\\\"domain\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"intent\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"msg\\\": \\\"\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"session_complete\\\": true,\\n\\t\\t\\t\\t\\t\\t\\t\\\"skill_id\\\": \\\"music.play\\\"\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t},\\\"response_text\\\":\\\"您的设备授权过期,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放温柔海浪\\\"}\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:17","tag":"E:/goProject/tencent-nlu-parse/service/service.go:18","msg":"tencent-nlu-parse-grpc request","field":{"data":{"requestBody":"{\"macWifi\":\"28b77c201431\",\"macVoice\":\"28b77c201431\",\"query\":\"播放温柔海浪\",\"ip\":\"121.35.103.189\",\"originQuery\":\"播放温柔海浪\",\"mid\":\"11011\",\"requestId\":\"srwa223sasd2\"}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:17","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:98","msg":"GetAuthorizationByGRPC request","field":{"data":{"tokenSearchRequest":{"mac":"28b77c201431","requestId":"srwa223sasd2"}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:17","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/auth.go:110","msg":"GetAuthorizationByGRPC response","field":{"data":{"tokenSearchResponse":{"status":{"code":200,"msg":"成功"},"data":{"dsn":"8d3b6076-3bb4-4c26-89c3-011447996044_1f8917ec9bbc0f1f49727b2e48078469","authorization":"BACKEND-ENCRYPT:1000,NywxMTA2MDk4MzczLDE5MzNDREJBNzEwM0I5MjBEQTRGOUZCN0VDRERGRkJBLDc2NEEyQkY5RTY4MjQ0RDJFQUU4QzA3RjkxRENCMjAyLDhkM2I2MDc2LTNiYjQtNGMyNi04OWMzLTAxMTQ0Nzk5NjA0NDozMWI2MjQ5NWJlOWI0ZmYzODllZTk1MmE0YzRiZDJjZiw4ZDNiNjA3Ni0zYmI0LTRjMjYtODljMy0wMTE0NDc5OTYwNDRfMWY4OTE3ZWM5YmJjMGYxZjQ5NzI3YjJlNDgwNzg0NjksNDQ3MzcxZDgwMDljNzBlNA==","accessToken":"31b62495be9b4ff389ee952a4c4bd2cf","appKey":"8d3b6076-3bb4-4c26-89c3-011447996044","status":3,"uriType":0}}},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:17","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:150","msg":"tencent-nlu-http-post request.","field":{"data":{"requestBody":"{\"header\":{\"guid\":\"fdd4b3c4a232375da32aa8695da7e023\",\"device\":{},\"user\":{},\"qua\":\"QV=3\\u0026PL=ADR\\u0026PR=chvoice\\u0026VE=7.6\\u0026VN=3350\\u0026PP=com.geli.mtt\\u0026DE=SPEAKER\\u0026SP=3\",\"ip\":\"121.35.103.189\"},\"payload\":{\"query\":\"播放温柔海浪\"}}"},"requestId":"srwa223sasd2"}} +{"level":"info","time":"2022-08-24 16:15:17","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/semantic.go:178","msg":"tencent-nlu-http-post response.","field":{"data":{"responseBody":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"温柔海浪\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"},"requestId":"srwa223sasd2","sessionId":"gz1661328917388683_ImcSk0HA8t14W"}} +{"level":"debug","time":"2022-08-24 16:15:17","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:226","msg":"GetTencentNLUData.","field":{"data":{"tencentRespStrData":"{\"header\":{\"semantic\":{\"code\":0,\"domain\":\"music\",\"intent\":\"play\",\"msg\":\"\",\"session_complete\":true,\"skill_id\":\"990835315751129088\",\"slots\":[{\"name\":\"song\",\"value\":\"温柔海浪\"}]}},\"payload\":{\"data\":{\"json\":{\"baseInfo\":{\"skillName\":\"QQ音乐\"},\"controlInfo\":{\"subTitleSpeak\":\"false\",\"textSpeak\":\"false\",\"titleSpeak\":\"false\",\"type\":\"URI\"},\"globalInfo\":{},\"listItems\":[],\"serverInfo\":{\"msg\":\"\",\"payInfo\":{\"iNeedPush\":1,\"stGoodsInfo\":{\"currencyName\":\"CNY\",\"currencyRatio\":100,\"strCPId\":\"\",\"strCPUserId\":\"\",\"strGoodsDesc\":\"\",\"strGoodsName\":\"\",\"strIconUrl\":\"\",\"strPayInfoName\":\"\",\"vGoodsUnit\":[]},\"strSpeakText\":\"\"},\"redirectInfo\":{\"strBlob\":\"\",\"strClientDomain\":\"\",\"strClientIntent\":\"\",\"strLocDomain\":\"\",\"strLocIntent\":\"\",\"strServiceCluster\":\"\",\"strSkillId\":\"\",\"strSlotPara\":\"\"},\"ret\":0},\"uriInfo\":{\"ui\":{\"url\":\"\"}}}},\"response_text\":\"您的空调播放音乐,需要账号绑定授权。请于9月1日前更新格力+手机应用,进入语音空调语音技能页面,点击QQ音乐进行授权,授权过程不产生任何费用。\",\"ret\":0}}\n"}}} +{"level":"debug","time":"2022-08-24 16:15:17","tag":"E:/goProject/tencent-nlu-parse/service/tencentNlu/tencent.go:242","msg":"ParseTencentJson.","field":{"data":{"semanticRespStrData":"{\n\t\t\t\t\t\"header\": {\n\t\t\t\t\t\t\"semantic\": {\n\t\t\t\t\t\t\t\"code\": 0,\n\t\t\t\t\t\t\t\"domain\": \"chat\",\n\t\t\t\t\t\t\t\"intent\": \"chat\",\n\t\t\t\t\t\t\t\"msg\": \"\",\n\t\t\t\t\t\t\t\"session_complete\": true,\n\t\t\t\t\t\t\t\"skill_id\": \"music.play\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"response_text\": \"您的设备授权过期,请前往格力+手机应用绑定授权。\"\n\t\t\t\t}"}}} +{"level":"info","time":"2022-08-24 16:15:17","tag":"E:/goProject/tencent-nlu-parse/service/service.go:25","msg":"tencent-nlu-parse-grpc response","field":{"data":{"responseBody":"{\"status\":{\"msg\":\"成功\"},\"data\":{\"semanticRespJsonData\":\"{\\\"header\\\":{\\n\\t\\t\\t\\t\\t\\t\\\"semantic\\\": {\\n\\t\\t\\t\\t\\t\\t\\t\\\"code\\\": 0,\\n\\t\\t\\t\\t\\t\\t\\t\\\"domain\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"intent\\\": \\\"chat\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"msg\\\": \\\"\\\",\\n\\t\\t\\t\\t\\t\\t\\t\\\"session_complete\\\": true,\\n\\t\\t\\t\\t\\t\\t\\t\\\"skill_id\\\": \\\"music.play\\\"\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t},\\\"response_text\\\":\\\"您的设备授权过期,请前往格力+手机应用绑定授权。\\\",\\\"asr_recongize\\\":\\\"播放温柔海浪\\\"}\"}}"},"requestId":"srwa223sasd2"}} diff --git a/pkg/consul/discover.go b/pkg/consul/discover.go new file mode 100644 index 0000000..ae180a7 --- /dev/null +++ b/pkg/consul/discover.go @@ -0,0 +1,140 @@ +package consul + +import ( + "errors" + "fmt" + "math/rand" + + "github.com/hashicorp/consul/api" +) + +// 从consul中获取服务address port +func GetService(url, token, serviceName, tag string) []*api.ServiceEntry { + var lastIndex uint64 + config := api.DefaultConfig() + config.Address = url + config.Token = token + + client, err := api.NewClient(config) + if err != nil { + panic(err) + } + services, metainfo, err := client.Health().Service(serviceName, tag, true, &api.QueryOptions{ + WaitIndex: lastIndex, // 同步点,这个调用将一直阻塞,直到有新的更新 + }) + if err != nil { + panic(fmt.Sprintf("error retrieving instances from Consul:%v", err)) + } + lastIndex = metainfo.LastIndex + + return services + +} + +// 从consul中获取服务address port +func GetService2(client *api.Client, serviceName, tag string) []*api.ServiceEntry { + var lastIndex uint64 + services, metainfo, err := client.Health().Service(serviceName, tag, true, &api.QueryOptions{ + WaitIndex: lastIndex, // 同步点,这个调用将一直阻塞,直到有新的更新 + }) + if err != nil { + + } + lastIndex = metainfo.LastIndex + + return services + +} + +type serviceInfo struct { + serviceEntry []*api.ServiceEntry + indexs []int + index int +} + +func newServiceInfo(serviceEntry []*api.ServiceEntry) *serviceInfo { + serviceInfo := &serviceInfo{ + serviceEntry: serviceEntry, + index: -1, + indexs: make([]int, 0, len(serviceEntry)), + } + serviceInfo.initIndexs() + serviceInfo.initIndex() + return serviceInfo +} + +func (s *serviceInfo) IsExist() bool { + if s == nil { + return false + } + + if len(s.indexs) > 0 { + return true + } else { + return false + } +} + +func (s *serviceInfo) initIndexs() { + for i := 0; i < len(s.serviceEntry); i++ { + if s.serviceEntry[i] != nil { + s.indexs = append(s.indexs, i) + } + } +} + +func (s *serviceInfo) initIndex() { + if s.index >= 0 { + return + } + if s.IsExist() { + if len(s.indexs) == 1 { + s.index = s.indexs[0] + return + } + s.index = s.indexs[rand.Intn(len(s.indexs))] + } +} + +func (s *serviceInfo) GetAddress() string { + return s.serviceEntry[s.index].Service.Address +} + +func (s *serviceInfo) GetPort() int { + return s.serviceEntry[s.index].Service.Port +} + +type ConsulObj struct { + client *api.Client +} + +func NewConsulObj(url, token string) (*ConsulObj, error) { + config := api.DefaultConfig() + config.Address = url + config.Token = token + client, err := api.NewClient(config) + if err != nil { + return nil, err + } + + return &ConsulObj{client: client}, nil +} + +func (s *ConsulObj) GetClient() *api.Client { + if s == nil { + return nil + } + return s.client +} + +func (s *ConsulObj) GetService(serviceName, tag string) (*serviceInfo, error) { + services, _, err := s.client.Health().Service(serviceName, tag, true, nil) + if err != nil { + return nil, err + } + // fmt.Println(len(services)) + if len(services) == 0 { + return nil, errors.New("services is not exist.") + } + return newServiceInfo(services), nil +} diff --git a/pkg/consul/health.go b/pkg/consul/health.go new file mode 100644 index 0000000..21e8db9 --- /dev/null +++ b/pkg/consul/health.go @@ -0,0 +1,19 @@ +package consul + +import ( + "context" + + "google.golang.org/grpc/health/grpc_health_v1" +) + +type HealthImpl struct{} + +func (h *HealthImpl) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) { + return &grpc_health_v1.HealthCheckResponse{ + Status: grpc_health_v1.HealthCheckResponse_SERVING, + }, nil +} + +func (h *HealthImpl) Watch(request *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error { + return nil +} diff --git a/pkg/consul/kv.go b/pkg/consul/kv.go new file mode 100644 index 0000000..22aa4f6 --- /dev/null +++ b/pkg/consul/kv.go @@ -0,0 +1,32 @@ +package consul + +import ( + "github.com/hashicorp/consul/api" +) + +func GetKV(url, token string, paths ...string) []byte { + config := api.DefaultConfig() + config.Address = url + config.Token = token + + client, err := api.NewClient(config) + if err != nil { + panic(err) + } + + var kvContent []byte + + for _, path := range paths { + kv, _, err := client.KV().Get(path, nil) + if err != nil { + panic(err) + } + + if len(kvContent) > 0 { + kvContent = append(kvContent, []byte("\n\n")...) + } + kvContent = append(kvContent, kv.Value...) + } + + return kvContent +} diff --git a/pkg/consul/register.go b/pkg/consul/register.go new file mode 100644 index 0000000..6e17e0c --- /dev/null +++ b/pkg/consul/register.go @@ -0,0 +1,57 @@ +package consul + +import ( + "fmt" + "speech-nlu-parse/pkg/util" + "time" + + "github.com/hashicorp/consul/api" +) + +type ConsulSettingS struct { + RunMode string + Name string + Tag []string + IP string + Port int + ConsulAddr string + ConsulToken string + Interval time.Duration + Deregister time.Duration +} + +func RegisterService(cs *ConsulSettingS) error { + consulConfig := api.DefaultConfig() + consulConfig.Address = cs.ConsulAddr + consulConfig.Token = cs.ConsulToken // 增加token + if cs.IP == "" { + cs.IP = util.GetLocalIP() + } + + client, err := api.NewClient(consulConfig) + if err != nil { + fmt.Printf("new client error: %v\n", err) + return err + } + agent := client.Agent() + + reg := &api.AgentServiceRegistration{ + ID: fmt.Sprintf("%v-%v-%v", cs.Name, cs.IP, cs.Port), //服务结点的名称 + Name: cs.Name, //服务名称 + Tags: cs.Tag, //tag, 不可以为空 + Port: cs.Port, //服务端口 + Address: cs.IP, //服务IP + Check: &api.AgentServiceCheck{ //健康检查 + Interval: cs.Interval.String(), //健康检查间隔 + GRPC: fmt.Sprintf("%v:%v/%v", cs.IP, cs.Port, cs.Name), //grpc支持,执行健康检查的地址,service会传到Health.Check函数中 + DeregisterCriticalServiceAfter: cs.Deregister.String(), //注销时间,相当于过期时间 + }, + } + + if err := agent.ServiceRegister(reg); err != nil { + fmt.Printf("service register error: %v\n", err) + return err + } + + return nil +} diff --git a/pkg/consul/resolver.go b/pkg/consul/resolver.go new file mode 100644 index 0000000..94d5dfd --- /dev/null +++ b/pkg/consul/resolver.go @@ -0,0 +1,127 @@ +package consul + +import ( + "errors" + "fmt" + "log" + "regexp" + "sync" + + "github.com/hashicorp/consul/api" + "google.golang.org/grpc/resolver" +) + +const ( + defaultPort = "8500" +) + +var ( + errMissingAddr = errors.New("consul resolver: missing address") + errAddrMisMatch = errors.New("consul resolver: invalied uri") + errEndsWithColon = errors.New("consul resolver: missing port after port-separator colon") + regexConsul, _ = regexp.Compile("^([A-z0-9.]+)(:[0-9]{1,5})?/([A-z_-]+)$") // 发现规则存在问题 +) + +func Init() { + fmt.Println("calling consul init") + resolver.Register(NewBuilder()) +} + +type consulBuilder struct{} + +func NewBuilder() resolver.Builder { + return &consulBuilder{} +} + +func (cb *consulBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { + host, port, name, err := parseTarget(fmt.Sprintf("%s/%s", target.Authority, target.Endpoint)) + if err != nil { + return nil, err + } + + fmt.Println(fmt.Sprintf("consul service ==> host:%s, port%s, name:%s", host, port, name)) + + cr := &consulResolver{ + address: fmt.Sprintf("%s%s", host, port), + name: name, + cc: cc, + disableServiceConfig: opts.DisableServiceConfig, + lastIndex: 0, + } + + cr.wg.Add(1) + go cr.watcher() + return cr, nil +} + +func (cb *consulBuilder) Scheme() string { + return "consul" +} + +type consulResolver struct { + address string + wg sync.WaitGroup + cc resolver.ClientConn + name string + disableServiceConfig bool + lastIndex uint64 +} + +func (cr *consulResolver) watcher() { + fmt.Printf("calling [%s] consul watcher\n", cr.name) + config := api.DefaultConfig() + config.Address = cr.address + client, err := api.NewClient(config) + if err != nil { + fmt.Printf("error create consul client: %v\n", err) + return + } + + fmt.Printf("resolver connect to consul:%v,%v,%v\n", cr.address, cr.name, cr.lastIndex) + + for { + services, metainfo, err := client.Health().ServiceMultipleTags(cr.name, []string{}, + true, &api.QueryOptions{WaitIndex: cr.lastIndex}) + if err != nil { + log.Printf("error retrieving instances from Consul: %v", err) + } + + cr.lastIndex = metainfo.LastIndex + var newAddrs []resolver.Address + for _, service := range services { + addr := fmt.Sprintf("%v:%v", service.Service.Address, service.Service.Port) + newAddrs = append(newAddrs, resolver.Address{ + Addr: addr, + //type:不能是grpclb,grpclb在处理链接时会删除最后一个链接地址,不用设置即可 详见=> balancer_conn_wrappers => updateClientConnState + ServerName: service.Service.Service, + }) + } + fmt.Printf("adding service addrs:%v\n", newAddrs) + //cr.cc.NewAddress(newAddrs) + //cr.cc.NewServiceConfig(cr.name) + cr.cc.UpdateState(resolver.State{Addresses: newAddrs}) + } +} + +func (cr *consulResolver) ResolveNow(opt resolver.ResolveNowOptions) {} + +func (cr *consulResolver) Close() {} + +func parseTarget(target string) (host, port, name string, err error) { + if target == "" { + return "", "", "", errMissingAddr + } + + if !regexConsul.MatchString(target) { + return "", "", "", errAddrMisMatch + } + + groups := regexConsul.FindStringSubmatch(target) + host = groups[1] + port = groups[2] + name = groups[3] + if port == "" { + port = defaultPort + } + return host, port, name, nil +} diff --git a/pkg/errCode/common_code.go b/pkg/errCode/common_code.go new file mode 100644 index 0000000..f4a0683 --- /dev/null +++ b/pkg/errCode/common_code.go @@ -0,0 +1,20 @@ +package errCode + +var ( + Success = NewError(0, "成功") + TargetDeviceNotExist = NewError(1200, "目标设备不存在") + TargetDeviceNotOnline = NewError(1201, "目标设备不在线") + TargetDeviceNotResponding = NewError(1202, "目标设备未响应") + MultipleTargetDevices = NewError(1203, "存在多个目标设备") + MutuallyExclusiveFunction = NewError(1204, "存在互斥功能") + AlreadyTarget = NewError(1205, "已是目标状态") + TargetDeviceNotThisFunction = NewError(1206, "目标设备没有该功能") + RequestFormatError = NewError(1401, "请求格式错误") + InformationMissing = NewError(1402, "用户或设备信息缺失") + IdentityAuthenticationFailed = NewError(1403, "身份认证失败") + InternalServiceError = NewError(1500, "内部服务错误") + IotInterfaceAccessTimeout = NewError(1501, "iot接口访问超时") + IotInterfaceReturnsError = NewError(1502, "iot接口返回错误") + DingdangInterfaceTimeout = NewError(1503, "叮当服务超时") + DingdangInterfaceRequestFrequency = NewError(1504, "叮当服务请求过快") +) diff --git a/pkg/errCode/err_code.go b/pkg/errCode/err_code.go new file mode 100644 index 0000000..10f7192 --- /dev/null +++ b/pkg/errCode/err_code.go @@ -0,0 +1,27 @@ +package errCode + +import "fmt" + +// TODO 请在使用时手动添加 json 注解 +type Error struct { + code int32 + msg string +} + +var codes = map[int32]string{} + +func NewError(code int32, msg string) *Error { + if _, ok := codes[code]; ok { + panic(fmt.Sprintf("错误码 %d 已经存在,请更换一个", code)) + } + codes[code] = msg + return &Error{code: code, msg: msg} +} + +func (e *Error) Code() int32 { + return e.code +} + +func (e *Error) Msg() string { + return e.msg +} diff --git a/pkg/logger/gorm_trace.go b/pkg/logger/gorm_trace.go new file mode 100644 index 0000000..0de8cb0 --- /dev/null +++ b/pkg/logger/gorm_trace.go @@ -0,0 +1,118 @@ +package logger + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/jinzhu/gorm" +) + +const ( + zapLoggerKey = "zap_logger" + contextGormKey = "added_value" + loggerGormKey = "gorm_logger" +) + +// WithContext 用来将需要在sql日志记录的附加的值,将key设置为gorm-added +// 举例:context.WithValue(parentCtx, "gorm-added", ) +func WithContext(ctx context.Context, db *gorm.DB) *gorm.DB { + if ctx == nil { + return db + } + + return db.Set(contextGormKey, ctx) +} + +// 为数据库添加回调方法--添加数据库日志追踪 +func AddGormCallbacks(db *gorm.DB, logger *Logger) { + callbacks := newCallbacks() + + //设置logger用于记录数据库操作日志 + //此处不能使用Set方法存储 + //InstantSet方法才能影响当前的数据库标识 + db.InstantSet(zapLoggerKey, logger) + + registerCallbacks(db, "create", callbacks) + registerCallbacks(db, "query", callbacks) + registerCallbacks(db, "update", callbacks) + registerCallbacks(db, "delete", callbacks) + registerCallbacks(db, "row_query", callbacks) +} + +type callbacks struct{} + +func newCallbacks() *callbacks { + return &callbacks{} +} + +func (c *callbacks) beforeCreate(scope *gorm.Scope) { c.before(scope) } +func (c *callbacks) afterCreate(scope *gorm.Scope) { c.after(scope, "INSERT") } +func (c *callbacks) beforeQuery(scope *gorm.Scope) { c.before(scope) } +func (c *callbacks) afterQuery(scope *gorm.Scope) { c.after(scope, "SELECT") } +func (c *callbacks) beforeUpdate(scope *gorm.Scope) { c.before(scope) } +func (c *callbacks) afterUpdate(scope *gorm.Scope) { c.after(scope, "UPDATE") } +func (c *callbacks) beforeDelete(scope *gorm.Scope) { c.before(scope) } +func (c *callbacks) afterDelete(scope *gorm.Scope) { c.after(scope, "DELETE") } +func (c *callbacks) beforeRowQuery(scope *gorm.Scope) { c.before(scope) } +func (c *callbacks) afterRowQuery(scope *gorm.Scope) { c.after(scope, "") } + +func (c *callbacks) before(scope *gorm.Scope) { + fields := Fields{"begin_time": time.Now().Format("2006-01-02 15:04:05.000")} + ctx, ok := scope.Get(contextGormKey) + if ok { + fields["context_value"] = ctx.(context.Context).Value("gorm-added") + } + + scope.Set(loggerGormKey, fields) +} + +func (c *callbacks) after(scope *gorm.Scope, operation string) { + zapLogger, ok := scope.Get(zapLoggerKey) + if !ok { + return + } + logger := zapLogger.(*Logger) + if operation == "" { + operation = strings.ToUpper(strings.Split(scope.SQL, " ")[0]) + } + val, ok := scope.Get(loggerGormKey) + if !ok { + return + } + fields := val.(Fields) + fields["DBStatement"] = scope.SQL + fields["DB.SQLVar"] = scope.SQLVars + scope.SQL = strings.Replace(scope.SQL, "?", "%v", -1) + fields["DB.SQL"] = fmt.Sprintf(scope.SQL, scope.SQLVars...) + fields["db.table"] = scope.TableName() + fields["db.method"] = operation + fields["db.hasErr"] = scope.HasError() + fields["db.count"] = scope.DB().RowsAffected + logger.WithFields(fields).Info("GORM TRACE") +} + +func registerCallbacks(db *gorm.DB, name string, c *callbacks) { + beforeName := fmt.Sprintf("tracing:%v_before", name) + afterName := fmt.Sprintf("tracing:%v_after", name) + gormCallbackName := fmt.Sprintf("gorm:%v", name) + // gorm does some magic, if you pass CallbackProcessor here - nothing works + switch name { + case "create": + db.Callback().Create().Before(gormCallbackName).Register(beforeName, c.beforeCreate) + db.Callback().Create().After(gormCallbackName).Register(afterName, c.afterCreate) + case "query": + db.Callback().Query().Before(gormCallbackName).Register(beforeName, c.beforeQuery) + db.Callback().Query().After(gormCallbackName).Register(afterName, c.afterQuery) + case "update": + db.Callback().Update().Before(gormCallbackName).Register(beforeName, c.beforeUpdate) + db.Callback().Update().After(gormCallbackName).Register(afterName, c.afterUpdate) + case "delete": + db.Callback().Delete().Before(gormCallbackName).Register(beforeName, c.beforeDelete) + db.Callback().Delete().After(gormCallbackName).Register(afterName, c.afterDelete) + case "row_query": + db.Callback().RowQuery().Before(gormCallbackName).Register(beforeName, c.beforeRowQuery) + db.Callback().RowQuery().After(gormCallbackName).Register(afterName, c.afterRowQuery) + } +} diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go new file mode 100644 index 0000000..9a9a355 --- /dev/null +++ b/pkg/logger/logger.go @@ -0,0 +1,225 @@ +package logger + +import ( + "fmt" + "io" + "os" + "runtime" + "time" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +type Fields map[string]interface{} + +type Logger struct { + newLogger *zap.Logger + fields Fields + callers []string +} + +func NewLogger(hook io.Writer, mode string, serviceName string) *Logger { + encoderConfig := zapcore.EncoderConfig{ + TimeKey: "time", + LevelKey: "level", + NameKey: "service", + CallerKey: "tag", + MessageKey: "msg", + StacktraceKey: "stacktrace", + LineEnding: zapcore.DefaultLineEnding, + EncodeLevel: zapcore.LowercaseLevelEncoder, // 小写编码器 + EncodeTime: func(time time.Time, encoder zapcore.PrimitiveArrayEncoder) { + encoder.AppendString(time.Format("2006-01-02 15:04:05")) + }, // ISO8601 UTC 时间格式 + EncodeDuration: zapcore.SecondsDurationEncoder, + EncodeCaller: zapcore.FullCallerEncoder, // 全路径编码器 + EncodeName: zapcore.FullNameEncoder, + } + + // 设置日志级别 + atomicLevel := zap.NewAtomicLevel() + var syncer zapcore.WriteSyncer + if mode == "debug" { // debug模式 + // 设置日志级别 + atomicLevel.SetLevel(zap.DebugLevel) + // 输出到控制台 + syncer = zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout)) + } else { + atomicLevel.SetLevel(zap.InfoLevel) + // 输出到文件 + // syncer = zapcore.NewMultiWriteSyncer(zapcore.AddSync(hook)) //打印到文件 --打印到控制台:zapcore.AddSync(os.Stdout) + syncer = zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout)) // 打印到控制台 + + } + + core := zapcore.NewCore( + zapcore.NewJSONEncoder(encoderConfig), // 编码器配置 + // zapcore.NewMultiWriteSyncer(zapcore.AddSync(hook)), //打印到文件 --打印到控制台:zapcore.AddSync(os.Stdout) + syncer, + atomicLevel, // 日志级别 + ) + //输出文件和行号,前提是配置对象encoderConfig中必须设有CallerKey字段 + caller := zap.AddCaller() + //由于再次封装日志,因此需要打印上一级的调用,1表示向上跳一级 + callerSkip := zap.AddCallerSkip(1) + + if mode == "debug" { + //开启开发模式 + return &Logger{ + newLogger: zap.New(core, caller, callerSkip, zap.Development()).Named(serviceName), + } + } + + return &Logger{ + newLogger: zap.New(core, caller, callerSkip).Named(serviceName), + } +} + +func (l *Logger) clone() *Logger { //防止并发时的数据脏乱 + nl := *l + return &nl +} + +func (l *Logger) WithFields(f Fields) *Logger { + ll := l.clone() + if ll.fields == nil { + ll.fields = make(Fields) + } + for k, v := range f { + ll.fields[k] = v + } + return ll +} + +func (l *Logger) WithCallersFrames() *Logger { + maxCallerDepth := 25 + minCallerDepth := 1 + callers := []string{} + pcs := make([]uintptr, maxCallerDepth) + depth := runtime.Callers(minCallerDepth, pcs) + frames := runtime.CallersFrames(pcs[:depth]) + for frame, more := frames.Next(); more; frame, more = frames.Next() { + callers = append(callers, fmt.Sprintf("%s: %d %s", frame.File, frame.Line, frame.Function)) + if !more { + break + } + } + ll := l.clone() + ll.callers = callers + return ll +} + +func (l *Logger) Debug(msg string) { + if l.fields != nil { + l.newLogger.Debug(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Debug(msg) +} + +func (l *Logger) Debugf(format string, v ...interface{}) { + msg := fmt.Sprintf(format, v...) + if l.fields != nil { + l.newLogger.Debug(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Debug(msg) +} + +func (l *Logger) Info(msg string) { + if l.fields != nil { + l.newLogger.Info(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Info(msg) +} + +func (l *Logger) Infof(format string, v ...interface{}) { + msg := fmt.Sprintf(format, v...) + if l.fields != nil { + l.newLogger.Info(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Info(msg) +} + +func (l *Logger) Warn(msg string) { + if l.fields != nil { + l.newLogger.Warn(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Warn(msg) +} + +func (l *Logger) Warnf(format string, v ...interface{}) { + msg := fmt.Sprintf(format, v...) + if l.fields != nil { + l.newLogger.Warn(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Warn(msg) +} + +func (l *Logger) Error(msg string) { + if l.fields != nil { + l.newLogger.Error(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Error(msg) +} + +func (l *Logger) Errorf(format string, v ...interface{}) { + msg := fmt.Sprintf(format, v...) + if l.fields != nil { + l.newLogger.Error(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Error(msg) +} + +func (l *Logger) Fatal(msg string) { + if l.fields != nil { + l.newLogger.Fatal(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Fatal(msg) +} + +func (l *Logger) Fatalf(format string, v ...interface{}) { + msg := fmt.Sprintf(format, v...) + if l.fields != nil { + l.newLogger.Fatal(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Fatal(msg) +} + +func (l *Logger) Panic(msg string) { + if l.fields != nil { + l.newLogger.Panic(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Panic(msg) +} + +func (l *Logger) Panicf(format string, v ...interface{}) { + msg := fmt.Sprintf(format, v...) + if l.fields != nil { + l.newLogger.Panic(msg, zap.Any("field", l.fields)) + return + } + ll := l.clone() + ll.newLogger.Panic(msg) +} diff --git a/pkg/proto/TencentNluParseStream.json b/pkg/proto/TencentNluParseStream.json new file mode 100644 index 0000000..ba38abf --- /dev/null +++ b/pkg/proto/TencentNluParseStream.json @@ -0,0 +1,23 @@ +{ + "macWifi": "Hello", + "macVoice": "Hello", + "query": "第一个", + "ip": "120.198.22.24", + "originQuery": "十四十四新闻", + "mid": "10f05", + "requestId": "00e04cb723c220231104163611", + "vender": "87654321", + "appKey": "a8814080829e11eda5c8e38bb1008e50", + "accessToken": "5659be84ea8c43d9ab9243b4a40cb3ee", + "qua": "testv1", + "auth": "", + "dsn": "", + "exist": false, + "tRequestId": "gz1c02944e16990869750923801", + "requestType": "semantic.text", + "commType": "SIMPLEX", + "native": {}, + "sdkExtend": {}, + "addressInfo": {}, + "language":"chinese" +} \ No newline at end of file diff --git a/pkg/proto/TencentNluParseStream_metadata.json b/pkg/proto/TencentNluParseStream_metadata.json new file mode 100644 index 0000000..9d130de --- /dev/null +++ b/pkg/proto/TencentNluParseStream_metadata.json @@ -0,0 +1,15 @@ +{ + "macWifi": "Hello", + "ip": "120.198.22.24", + "mid": "10f05", + "requestId": "62971cb0-3b0f-11ee-9149-02420a0ac81a", + "vender": "87654321", + "appKey": "a8814080829e11eda5c8e38bb1008e50", + "accessToken": "5659be84ea8c43d9ab9243b4a40cb3ee", + "qua": "testv1", + "auth": "", + "dsn": "", + "exist": "0", + "trequestid": "", + "sessionid": "62971cb0-3b0f-11ee-9149-02420a0ac" +} \ No newline at end of file diff --git a/pkg/proto/music-spot.pb.go b/pkg/proto/music-spot.pb.go new file mode 100644 index 0000000..b580926 --- /dev/null +++ b/pkg/proto/music-spot.pb.go @@ -0,0 +1,726 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.25.1 +// source: pkg/proto/music-spot.proto + +package proto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MusicSpotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppInfo *MusicSpotRequest_AppInfo `protobuf:"bytes,1,opt,name=appInfo,proto3" json:"appInfo,omitempty"` + DevInfo *MusicSpotRequest_DevInfo `protobuf:"bytes,2,opt,name=devInfo,proto3" json:"devInfo,omitempty"` + Data *MusicSpotRequest_Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *MusicSpotRequest) Reset() { + *x = MusicSpotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_music_spot_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MusicSpotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MusicSpotRequest) ProtoMessage() {} + +func (x *MusicSpotRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_music_spot_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MusicSpotRequest.ProtoReflect.Descriptor instead. +func (*MusicSpotRequest) Descriptor() ([]byte, []int) { + return file_pkg_proto_music_spot_proto_rawDescGZIP(), []int{0} +} + +func (x *MusicSpotRequest) GetAppInfo() *MusicSpotRequest_AppInfo { + if x != nil { + return x.AppInfo + } + return nil +} + +func (x *MusicSpotRequest) GetDevInfo() *MusicSpotRequest_DevInfo { + if x != nil { + return x.DevInfo + } + return nil +} + +func (x *MusicSpotRequest) GetData() *MusicSpotRequest_Data { + if x != nil { + return x.Data + } + return nil +} + +type MusicSpotResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *MusicSpotResponse_Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Data *MusicSpotResponse_Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *MusicSpotResponse) Reset() { + *x = MusicSpotResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_music_spot_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MusicSpotResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MusicSpotResponse) ProtoMessage() {} + +func (x *MusicSpotResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_music_spot_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MusicSpotResponse.ProtoReflect.Descriptor instead. +func (*MusicSpotResponse) Descriptor() ([]byte, []int) { + return file_pkg_proto_music_spot_proto_rawDescGZIP(), []int{1} +} + +func (x *MusicSpotResponse) GetStatus() *MusicSpotResponse_Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *MusicSpotResponse) GetData() *MusicSpotResponse_Data { + if x != nil { + return x.Data + } + return nil +} + +type MusicSpotRequest_AppInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RequestId string `protobuf:"bytes,1,opt,name=requestId,proto3" json:"requestId,omitempty"` +} + +func (x *MusicSpotRequest_AppInfo) Reset() { + *x = MusicSpotRequest_AppInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_music_spot_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MusicSpotRequest_AppInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MusicSpotRequest_AppInfo) ProtoMessage() {} + +func (x *MusicSpotRequest_AppInfo) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_music_spot_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MusicSpotRequest_AppInfo.ProtoReflect.Descriptor instead. +func (*MusicSpotRequest_AppInfo) Descriptor() ([]byte, []int) { + return file_pkg_proto_music_spot_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *MusicSpotRequest_AppInfo) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +type MusicSpotRequest_DevInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + SubMac string `protobuf:"bytes,2,opt,name=subMac,proto3" json:"subMac,omitempty"` // 子设备mac,中控变成了子设备 + Mid string `protobuf:"bytes,3,opt,name=mid,proto3" json:"mid,omitempty"` // mid + Vender string `protobuf:"bytes,4,opt,name=vender,proto3" json:"vender,omitempty"` // 细分码,用于设备没授权的情况下给默认boot + Hid string `protobuf:"bytes,5,opt,name=hid,proto3" json:"hid,omitempty"` // 模组id,优先级高于细分码 - 若能匹配,优先使用 + HomeId string `protobuf:"bytes,6,opt,name=homeId,proto3" json:"homeId,omitempty"` // 设备所属家庭id + UserId string `protobuf:"bytes,7,opt,name=userId,proto3" json:"userId,omitempty"` // 用户id +} + +func (x *MusicSpotRequest_DevInfo) Reset() { + *x = MusicSpotRequest_DevInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_music_spot_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MusicSpotRequest_DevInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MusicSpotRequest_DevInfo) ProtoMessage() {} + +func (x *MusicSpotRequest_DevInfo) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_music_spot_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MusicSpotRequest_DevInfo.ProtoReflect.Descriptor instead. +func (*MusicSpotRequest_DevInfo) Descriptor() ([]byte, []int) { + return file_pkg_proto_music_spot_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *MusicSpotRequest_DevInfo) GetMac() string { + if x != nil { + return x.Mac + } + return "" +} + +func (x *MusicSpotRequest_DevInfo) GetSubMac() string { + if x != nil { + return x.SubMac + } + return "" +} + +func (x *MusicSpotRequest_DevInfo) GetMid() string { + if x != nil { + return x.Mid + } + return "" +} + +func (x *MusicSpotRequest_DevInfo) GetVender() string { + if x != nil { + return x.Vender + } + return "" +} + +func (x *MusicSpotRequest_DevInfo) GetHid() string { + if x != nil { + return x.Hid + } + return "" +} + +func (x *MusicSpotRequest_DevInfo) GetHomeId() string { + if x != nil { + return x.HomeId + } + return "" +} + +func (x *MusicSpotRequest_DevInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type MusicSpotRequest_Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` // 目前不生效 +} + +func (x *MusicSpotRequest_Data) Reset() { + *x = MusicSpotRequest_Data{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_music_spot_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MusicSpotRequest_Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MusicSpotRequest_Data) ProtoMessage() {} + +func (x *MusicSpotRequest_Data) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_music_spot_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MusicSpotRequest_Data.ProtoReflect.Descriptor instead. +func (*MusicSpotRequest_Data) Descriptor() ([]byte, []int) { + return file_pkg_proto_music_spot_proto_rawDescGZIP(), []int{0, 2} +} + +func (x *MusicSpotRequest_Data) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *MusicSpotRequest_Data) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type MusicSpotResponse_Status struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (x *MusicSpotResponse_Status) Reset() { + *x = MusicSpotResponse_Status{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_music_spot_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MusicSpotResponse_Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MusicSpotResponse_Status) ProtoMessage() {} + +func (x *MusicSpotResponse_Status) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_music_spot_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MusicSpotResponse_Status.ProtoReflect.Descriptor instead. +func (*MusicSpotResponse_Status) Descriptor() ([]byte, []int) { + return file_pkg_proto_music_spot_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *MusicSpotResponse_Status) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *MusicSpotResponse_Status) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type MusicSpotResponse_SourceItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MediaId string `protobuf:"bytes,1,opt,name=mediaId,proto3" json:"mediaId,omitempty"` + Singer string `protobuf:"bytes,2,opt,name=singer,proto3" json:"singer,omitempty"` + Song string `protobuf:"bytes,3,opt,name=song,proto3" json:"song,omitempty"` +} + +func (x *MusicSpotResponse_SourceItem) Reset() { + *x = MusicSpotResponse_SourceItem{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_music_spot_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MusicSpotResponse_SourceItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MusicSpotResponse_SourceItem) ProtoMessage() {} + +func (x *MusicSpotResponse_SourceItem) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_music_spot_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MusicSpotResponse_SourceItem.ProtoReflect.Descriptor instead. +func (*MusicSpotResponse_SourceItem) Descriptor() ([]byte, []int) { + return file_pkg_proto_music_spot_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *MusicSpotResponse_SourceItem) GetMediaId() string { + if x != nil { + return x.MediaId + } + return "" +} + +func (x *MusicSpotResponse_SourceItem) GetSinger() string { + if x != nil { + return x.Singer + } + return "" +} + +func (x *MusicSpotResponse_SourceItem) GetSong() string { + if x != nil { + return x.Song + } + return "" +} + +type MusicSpotResponse_Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ListItems []*MusicSpotResponse_SourceItem `protobuf:"bytes,1,rep,name=listItems,proto3" json:"listItems,omitempty"` +} + +func (x *MusicSpotResponse_Data) Reset() { + *x = MusicSpotResponse_Data{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_music_spot_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MusicSpotResponse_Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MusicSpotResponse_Data) ProtoMessage() {} + +func (x *MusicSpotResponse_Data) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_music_spot_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MusicSpotResponse_Data.ProtoReflect.Descriptor instead. +func (*MusicSpotResponse_Data) Descriptor() ([]byte, []int) { + return file_pkg_proto_music_spot_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *MusicSpotResponse_Data) GetListItems() []*MusicSpotResponse_SourceItem { + if x != nil { + return x.ListItems + } + return nil +} + +var File_pkg_proto_music_spot_proto protoreflect.FileDescriptor + +var file_pkg_proto_music_spot_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x75, 0x73, 0x69, + 0x63, 0x2d, 0x73, 0x70, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x03, 0x0a, 0x10, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x49, + 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x75, 0x73, + 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x65, + 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x64, 0x65, 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x1a, 0x27, 0x0a, 0x07, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x1a, 0x9f, 0x01, 0x0a, 0x07, 0x44, 0x65, + 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6d, 0x61, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x62, 0x4d, 0x61, + 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, 0x62, 0x4d, 0x61, 0x63, 0x12, + 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x69, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x6f, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x6d, + 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x1a, 0x32, 0x0a, 0x04, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, + 0xce, 0x02, 0x0a, 0x11, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x75, + 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x1a, 0x2e, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, + 0x67, 0x1a, 0x52, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x73, 0x6f, 0x6e, 0x67, 0x1a, 0x49, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x41, 0x0a, + 0x09, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, + 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, + 0x32, 0x4e, 0x0a, 0x09, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x12, 0x41, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, + 0x75, 0x73, 0x69, 0x63, 0x53, 0x70, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x13, 0x5a, 0x11, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pkg_proto_music_spot_proto_rawDescOnce sync.Once + file_pkg_proto_music_spot_proto_rawDescData = file_pkg_proto_music_spot_proto_rawDesc +) + +func file_pkg_proto_music_spot_proto_rawDescGZIP() []byte { + file_pkg_proto_music_spot_proto_rawDescOnce.Do(func() { + file_pkg_proto_music_spot_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_proto_music_spot_proto_rawDescData) + }) + return file_pkg_proto_music_spot_proto_rawDescData +} + +var file_pkg_proto_music_spot_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_pkg_proto_music_spot_proto_goTypes = []interface{}{ + (*MusicSpotRequest)(nil), // 0: proto.MusicSpotRequest + (*MusicSpotResponse)(nil), // 1: proto.MusicSpotResponse + (*MusicSpotRequest_AppInfo)(nil), // 2: proto.MusicSpotRequest.AppInfo + (*MusicSpotRequest_DevInfo)(nil), // 3: proto.MusicSpotRequest.DevInfo + (*MusicSpotRequest_Data)(nil), // 4: proto.MusicSpotRequest.Data + (*MusicSpotResponse_Status)(nil), // 5: proto.MusicSpotResponse.Status + (*MusicSpotResponse_SourceItem)(nil), // 6: proto.MusicSpotResponse.SourceItem + (*MusicSpotResponse_Data)(nil), // 7: proto.MusicSpotResponse.Data +} +var file_pkg_proto_music_spot_proto_depIdxs = []int32{ + 2, // 0: proto.MusicSpotRequest.appInfo:type_name -> proto.MusicSpotRequest.AppInfo + 3, // 1: proto.MusicSpotRequest.devInfo:type_name -> proto.MusicSpotRequest.DevInfo + 4, // 2: proto.MusicSpotRequest.data:type_name -> proto.MusicSpotRequest.Data + 5, // 3: proto.MusicSpotResponse.status:type_name -> proto.MusicSpotResponse.Status + 7, // 4: proto.MusicSpotResponse.data:type_name -> proto.MusicSpotResponse.Data + 6, // 5: proto.MusicSpotResponse.Data.listItems:type_name -> proto.MusicSpotResponse.SourceItem + 0, // 6: proto.MusicSpot.GetMusicList:input_type -> proto.MusicSpotRequest + 1, // 7: proto.MusicSpot.GetMusicList:output_type -> proto.MusicSpotResponse + 7, // [7:8] is the sub-list for method output_type + 6, // [6:7] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_pkg_proto_music_spot_proto_init() } +func file_pkg_proto_music_spot_proto_init() { + if File_pkg_proto_music_spot_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_proto_music_spot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MusicSpotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_music_spot_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MusicSpotResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_music_spot_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MusicSpotRequest_AppInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_music_spot_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MusicSpotRequest_DevInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_music_spot_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MusicSpotRequest_Data); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_music_spot_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MusicSpotResponse_Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_music_spot_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MusicSpotResponse_SourceItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_music_spot_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MusicSpotResponse_Data); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pkg_proto_music_spot_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_pkg_proto_music_spot_proto_goTypes, + DependencyIndexes: file_pkg_proto_music_spot_proto_depIdxs, + MessageInfos: file_pkg_proto_music_spot_proto_msgTypes, + }.Build() + File_pkg_proto_music_spot_proto = out.File + file_pkg_proto_music_spot_proto_rawDesc = nil + file_pkg_proto_music_spot_proto_goTypes = nil + file_pkg_proto_music_spot_proto_depIdxs = nil +} diff --git a/pkg/proto/music-spot.proto b/pkg/proto/music-spot.proto new file mode 100644 index 0000000..373266b --- /dev/null +++ b/pkg/proto/music-spot.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package proto; //新增一个可选的package声明符,用来防止不同的消息类型有命名冲突 +option go_package = "./pkg/proto;proto"; //这个选项表明生成go结构体所在的包 + +//import "google/protobuf/any.proto"; + +message MusicSpotRequest { + message AppInfo { + string requestId = 1; + } + message DevInfo { + string mac = 1; + string subMac = 2; // 子设备mac,中控变成了子设备 + string mid = 3; // mid + string vender = 4; // 细分码,用于设备没授权的情况下给默认boot + string hid = 5;// 模组id,优先级高于细分码 - 若能匹配,优先使用 + + string homeId = 6; // 设备所属家庭id + string userId = 7; // 用户id + } + AppInfo appInfo = 1; + DevInfo devInfo = 2; + message Data { + string query = 1; + int64 limit = 2; // 目前不生效 + } + Data data = 3; +} + + +message MusicSpotResponse { + message Status { + int32 code = 1; + string msg = 2; + } + message SourceItem { + string mediaId = 1; + string singer = 2; + string song = 3; + } + message Data{ + repeated SourceItem listItems = 1; + } + Status status = 1; + Data data = 2; +} + +service MusicSpot { + rpc GetMusicList(MusicSpotRequest) returns (MusicSpotResponse); // 获取音乐列表 +} + diff --git a/pkg/proto/music-spot_grpc.pb.go b/pkg/proto/music-spot_grpc.pb.go new file mode 100644 index 0000000..c5270d4 --- /dev/null +++ b/pkg/proto/music-spot_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.1 +// source: pkg/proto/music-spot.proto + +package proto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MusicSpot_GetMusicList_FullMethodName = "/proto.MusicSpot/GetMusicList" +) + +// MusicSpotClient is the client API for MusicSpot service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MusicSpotClient interface { + GetMusicList(ctx context.Context, in *MusicSpotRequest, opts ...grpc.CallOption) (*MusicSpotResponse, error) +} + +type musicSpotClient struct { + cc grpc.ClientConnInterface +} + +func NewMusicSpotClient(cc grpc.ClientConnInterface) MusicSpotClient { + return &musicSpotClient{cc} +} + +func (c *musicSpotClient) GetMusicList(ctx context.Context, in *MusicSpotRequest, opts ...grpc.CallOption) (*MusicSpotResponse, error) { + out := new(MusicSpotResponse) + err := c.cc.Invoke(ctx, MusicSpot_GetMusicList_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MusicSpotServer is the server API for MusicSpot service. +// All implementations must embed UnimplementedMusicSpotServer +// for forward compatibility +type MusicSpotServer interface { + GetMusicList(context.Context, *MusicSpotRequest) (*MusicSpotResponse, error) + mustEmbedUnimplementedMusicSpotServer() +} + +// UnimplementedMusicSpotServer must be embedded to have forward compatible implementations. +type UnimplementedMusicSpotServer struct { +} + +func (UnimplementedMusicSpotServer) GetMusicList(context.Context, *MusicSpotRequest) (*MusicSpotResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMusicList not implemented") +} +func (UnimplementedMusicSpotServer) mustEmbedUnimplementedMusicSpotServer() {} + +// UnsafeMusicSpotServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MusicSpotServer will +// result in compilation errors. +type UnsafeMusicSpotServer interface { + mustEmbedUnimplementedMusicSpotServer() +} + +func RegisterMusicSpotServer(s grpc.ServiceRegistrar, srv MusicSpotServer) { + s.RegisterService(&MusicSpot_ServiceDesc, srv) +} + +func _MusicSpot_GetMusicList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MusicSpotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MusicSpotServer).GetMusicList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MusicSpot_GetMusicList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MusicSpotServer).GetMusicList(ctx, req.(*MusicSpotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MusicSpot_ServiceDesc is the grpc.ServiceDesc for MusicSpot service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MusicSpot_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.MusicSpot", + HandlerType: (*MusicSpotServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetMusicList", + Handler: _MusicSpot_GetMusicList_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/proto/music-spot.proto", +} diff --git a/pkg/proto/service.pb.go b/pkg/proto/service.pb.go new file mode 100644 index 0000000..f009982 --- /dev/null +++ b/pkg/proto/service.pb.go @@ -0,0 +1,1690 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: pkg/proto/service.proto + +package proto + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Status struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (x *Status) Reset() { + *x = Status{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{0} +} + +func (x *Status) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Status) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +// 经纬度 +type SemanticRequestLbs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Longitude float64 `protobuf:"fixed64,1,opt,name=longitude,proto3" json:"longitude,omitempty"` + Latitude float64 `protobuf:"fixed64,2,opt,name=latitude,proto3" json:"latitude,omitempty"` +} + +func (x *SemanticRequestLbs) Reset() { + *x = SemanticRequestLbs{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SemanticRequestLbs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticRequestLbs) ProtoMessage() {} + +func (x *SemanticRequestLbs) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticRequestLbs.ProtoReflect.Descriptor instead. +func (*SemanticRequestLbs) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{1} +} + +func (x *SemanticRequestLbs) GetLongitude() float64 { + if x != nil { + return x.Longitude + } + return 0 +} + +func (x *SemanticRequestLbs) GetLatitude() float64 { + if x != nil { + return x.Latitude + } + return 0 +} + +type AddressInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Province string `protobuf:"bytes,1,opt,name=province,proto3" json:"province,omitempty"` + City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` + County string `protobuf:"bytes,3,opt,name=county,proto3" json:"county,omitempty"` +} + +func (x *AddressInfo) Reset() { + *x = AddressInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddressInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddressInfo) ProtoMessage() {} + +func (x *AddressInfo) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddressInfo.ProtoReflect.Descriptor instead. +func (*AddressInfo) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{2} +} + +func (x *AddressInfo) GetProvince() string { + if x != nil { + return x.Province + } + return "" +} + +func (x *AddressInfo) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *AddressInfo) GetCounty() string { + if x != nil { + return x.County + } + return "" +} + +type SemanticRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MacWifi string `protobuf:"bytes,1,opt,name=macWifi,proto3" json:"macWifi,omitempty"` + MacVoice string `protobuf:"bytes,2,opt,name=macVoice,proto3" json:"macVoice,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` + TestID string `protobuf:"bytes,5,opt,name=testID,proto3" json:"testID,omitempty"` + OriginQuery string `protobuf:"bytes,6,opt,name=originQuery,proto3" json:"originQuery,omitempty"` + Mid string `protobuf:"bytes,7,opt,name=mid,proto3" json:"mid,omitempty"` + RequestId string `protobuf:"bytes,8,opt,name=requestId,proto3" json:"requestId,omitempty"` + Lbs *SemanticRequestLbs `protobuf:"bytes,9,opt,name=lbs,proto3" json:"lbs,omitempty"` + Vender string `protobuf:"bytes,10,opt,name=vender,proto3" json:"vender,omitempty"` + AppKey string `protobuf:"bytes,11,opt,name=appKey,proto3" json:"appKey,omitempty"` // 云小微 + AccessToken string `protobuf:"bytes,12,opt,name=accessToken,proto3" json:"accessToken,omitempty"` + Qua string `protobuf:"bytes,13,opt,name=qua,proto3" json:"qua,omitempty"` + Auth string `protobuf:"bytes,14,opt,name=auth,proto3" json:"auth,omitempty"` + Dsn string `protobuf:"bytes,15,opt,name=dsn,proto3" json:"dsn,omitempty"` + Guid string `protobuf:"bytes,16,opt,name=guid,proto3" json:"guid,omitempty"` + Exist bool `protobuf:"varint,17,opt,name=exist,proto3" json:"exist,omitempty"` // 授权信息是否存在 + TRequestId string `protobuf:"bytes,18,opt,name=tRequestId,proto3" json:"tRequestId,omitempty"` // 腾讯v2的requestId + RequestType string `protobuf:"bytes,19,opt,name=requestType,proto3" json:"requestType,omitempty"` // 腾讯nlp websocket RequestType + CommType string `protobuf:"bytes,20,opt,name=commType,proto3" json:"commType,omitempty"` // 腾讯nlp websocket CommType + CharacterID string `protobuf:"bytes,21,opt,name=characterID,proto3" json:"characterID,omitempty"` // 腾讯nlp websocket Common.CharacterID + Event string `protobuf:"bytes,22,opt,name=event,proto3" json:"event,omitempty"` // 腾讯nlp websocket Semantic.Event + Native *SemanticRequest_Native `protobuf:"bytes,23,opt,name=native,proto3" json:"native,omitempty"` // 腾讯nlp websocket Payload.Nativate + SdkExtend *SemanticRequest_SDKExtend `protobuf:"bytes,24,opt,name=sdkExtend,proto3" json:"sdkExtend,omitempty"` // 腾讯nlp websocket Payload.SDKExtend + AddressInfo *AddressInfo `protobuf:"bytes,25,opt,name=addressInfo,proto3" json:"addressInfo,omitempty"` + Language string `protobuf:"bytes,26,opt,name=language,proto3" json:"language,omitempty"` + HomeId string `protobuf:"bytes,27,opt,name=homeId,proto3" json:"homeId,omitempty"` +} + +func (x *SemanticRequest) Reset() { + *x = SemanticRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SemanticRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticRequest) ProtoMessage() {} + +func (x *SemanticRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticRequest.ProtoReflect.Descriptor instead. +func (*SemanticRequest) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{3} +} + +func (x *SemanticRequest) GetMacWifi() string { + if x != nil { + return x.MacWifi + } + return "" +} + +func (x *SemanticRequest) GetMacVoice() string { + if x != nil { + return x.MacVoice + } + return "" +} + +func (x *SemanticRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *SemanticRequest) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *SemanticRequest) GetTestID() string { + if x != nil { + return x.TestID + } + return "" +} + +func (x *SemanticRequest) GetOriginQuery() string { + if x != nil { + return x.OriginQuery + } + return "" +} + +func (x *SemanticRequest) GetMid() string { + if x != nil { + return x.Mid + } + return "" +} + +func (x *SemanticRequest) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +func (x *SemanticRequest) GetLbs() *SemanticRequestLbs { + if x != nil { + return x.Lbs + } + return nil +} + +func (x *SemanticRequest) GetVender() string { + if x != nil { + return x.Vender + } + return "" +} + +func (x *SemanticRequest) GetAppKey() string { + if x != nil { + return x.AppKey + } + return "" +} + +func (x *SemanticRequest) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *SemanticRequest) GetQua() string { + if x != nil { + return x.Qua + } + return "" +} + +func (x *SemanticRequest) GetAuth() string { + if x != nil { + return x.Auth + } + return "" +} + +func (x *SemanticRequest) GetDsn() string { + if x != nil { + return x.Dsn + } + return "" +} + +func (x *SemanticRequest) GetGuid() string { + if x != nil { + return x.Guid + } + return "" +} + +func (x *SemanticRequest) GetExist() bool { + if x != nil { + return x.Exist + } + return false +} + +func (x *SemanticRequest) GetTRequestId() string { + if x != nil { + return x.TRequestId + } + return "" +} + +func (x *SemanticRequest) GetRequestType() string { + if x != nil { + return x.RequestType + } + return "" +} + +func (x *SemanticRequest) GetCommType() string { + if x != nil { + return x.CommType + } + return "" +} + +func (x *SemanticRequest) GetCharacterID() string { + if x != nil { + return x.CharacterID + } + return "" +} + +func (x *SemanticRequest) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *SemanticRequest) GetNative() *SemanticRequest_Native { + if x != nil { + return x.Native + } + return nil +} + +func (x *SemanticRequest) GetSdkExtend() *SemanticRequest_SDKExtend { + if x != nil { + return x.SdkExtend + } + return nil +} + +func (x *SemanticRequest) GetAddressInfo() *AddressInfo { + if x != nil { + return x.AddressInfo + } + return nil +} + +func (x *SemanticRequest) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *SemanticRequest) GetHomeId() string { + if x != nil { + return x.HomeId + } + return "" +} + +type SemanticResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Data *SemanticData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *SemanticResponse) Reset() { + *x = SemanticResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SemanticResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticResponse) ProtoMessage() {} + +func (x *SemanticResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticResponse.ProtoReflect.Descriptor instead. +func (*SemanticResponse) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{4} +} + +func (x *SemanticResponse) GetStatus() *Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *SemanticResponse) GetData() *SemanticData { + if x != nil { + return x.Data + } + return nil +} + +type SemanticData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SemanticRespJsonData string `protobuf:"bytes,1,opt,name=semanticRespJsonData,proto3" json:"semanticRespJsonData,omitempty"` +} + +func (x *SemanticData) Reset() { + *x = SemanticData{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SemanticData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticData) ProtoMessage() {} + +func (x *SemanticData) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticData.ProtoReflect.Descriptor instead. +func (*SemanticData) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{5} +} + +func (x *SemanticData) GetSemanticRespJsonData() string { + if x != nil { + return x.SemanticRespJsonData + } + return "" +} + +type TokenSearchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + RequestId string `protobuf:"bytes,2,opt,name=requestId,proto3" json:"requestId,omitempty"` + Mid string `protobuf:"bytes,3,opt,name=mid,proto3" json:"mid,omitempty"` // mid + Vender string `protobuf:"bytes,4,opt,name=vender,proto3" json:"vender,omitempty"` // 细分码,用于设备没授权的情况下给默认boot + HomeId string `protobuf:"bytes,5,opt,name=homeId,proto3" json:"homeId,omitempty"` // 设备所属家庭id + UserId string `protobuf:"bytes,6,opt,name=userId,proto3" json:"userId,omitempty"` // 用户id +} + +func (x *TokenSearchRequest) Reset() { + *x = TokenSearchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenSearchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenSearchRequest) ProtoMessage() {} + +func (x *TokenSearchRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenSearchRequest.ProtoReflect.Descriptor instead. +func (*TokenSearchRequest) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{6} +} + +func (x *TokenSearchRequest) GetMac() string { + if x != nil { + return x.Mac + } + return "" +} + +func (x *TokenSearchRequest) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +func (x *TokenSearchRequest) GetMid() string { + if x != nil { + return x.Mid + } + return "" +} + +func (x *TokenSearchRequest) GetVender() string { + if x != nil { + return x.Vender + } + return "" +} + +func (x *TokenSearchRequest) GetHomeId() string { + if x != nil { + return x.HomeId + } + return "" +} + +func (x *TokenSearchRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// +//data.uriType 取值说明: +//QQMusic = 0 // qq音乐 +//KugouMusic = 1 // 酷狗音乐 +// +//data.status 取值说明: +//Unassigned = 0 //未分配 没有AppKey 没有token +//Assigned = 1 //已分配 +//Using = 2 //已授权,使用中 +//Expired = 3 //过期 +//Invalidation = 4 //异常失效 +//Unbind = 5 //解除绑定 +// +//status.code +//200 成功 +//401 激活错误 +//403 参数格式 +//405 设备为激活 +type TokenSearchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *TokenSearchResponse_Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Data *TokenSearchResponse_TokenMemo `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *TokenSearchResponse) Reset() { + *x = TokenSearchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenSearchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenSearchResponse) ProtoMessage() {} + +func (x *TokenSearchResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenSearchResponse.ProtoReflect.Descriptor instead. +func (*TokenSearchResponse) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{7} +} + +func (x *TokenSearchResponse) GetStatus() *TokenSearchResponse_Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *TokenSearchResponse) GetData() *TokenSearchResponse_TokenMemo { + if x != nil { + return x.Data + } + return nil +} + +type SemanticRequest_Native struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + SeqID string `protobuf:"bytes,2,opt,name=seqID,proto3" json:"seqID,omitempty"` + Code int32 `protobuf:"varint,3,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` + DataVersion string `protobuf:"bytes,5,opt,name=dataVersion,proto3" json:"dataVersion,omitempty"` + Data *SemanticRequest_Native_Data `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *SemanticRequest_Native) Reset() { + *x = SemanticRequest_Native{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SemanticRequest_Native) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticRequest_Native) ProtoMessage() {} + +func (x *SemanticRequest_Native) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticRequest_Native.ProtoReflect.Descriptor instead. +func (*SemanticRequest_Native) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *SemanticRequest_Native) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SemanticRequest_Native) GetSeqID() string { + if x != nil { + return x.SeqID + } + return "" +} + +func (x *SemanticRequest_Native) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *SemanticRequest_Native) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *SemanticRequest_Native) GetDataVersion() string { + if x != nil { + return x.DataVersion + } + return "" +} + +func (x *SemanticRequest_Native) GetData() *SemanticRequest_Native_Data { + if x != nil { + return x.Data + } + return nil +} + +type SemanticRequest_SDKExtend struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CarDOA int32 `protobuf:"varint,1,opt,name=carDOA,proto3" json:"carDOA,omitempty"` + LastRspType string `protobuf:"bytes,2,opt,name=lastRspType,proto3" json:"lastRspType,omitempty"` + LastRspResult string `protobuf:"bytes,3,opt,name=lastRspResult,proto3" json:"lastRspResult,omitempty"` + LastSessionStatus int32 `protobuf:"varint,4,opt,name=lastSessionStatus,proto3" json:"lastSessionStatus,omitempty"` + LastCompleteCmdResult string `protobuf:"bytes,5,opt,name=lastCompleteCmdResult,proto3" json:"lastCompleteCmdResult,omitempty"` +} + +func (x *SemanticRequest_SDKExtend) Reset() { + *x = SemanticRequest_SDKExtend{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SemanticRequest_SDKExtend) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticRequest_SDKExtend) ProtoMessage() {} + +func (x *SemanticRequest_SDKExtend) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticRequest_SDKExtend.ProtoReflect.Descriptor instead. +func (*SemanticRequest_SDKExtend) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *SemanticRequest_SDKExtend) GetCarDOA() int32 { + if x != nil { + return x.CarDOA + } + return 0 +} + +func (x *SemanticRequest_SDKExtend) GetLastRspType() string { + if x != nil { + return x.LastRspType + } + return "" +} + +func (x *SemanticRequest_SDKExtend) GetLastRspResult() string { + if x != nil { + return x.LastRspResult + } + return "" +} + +func (x *SemanticRequest_SDKExtend) GetLastSessionStatus() int32 { + if x != nil { + return x.LastSessionStatus + } + return 0 +} + +func (x *SemanticRequest_SDKExtend) GetLastCompleteCmdResult() string { + if x != nil { + return x.LastCompleteCmdResult + } + return "" +} + +type SemanticRequest_Native_Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SemanticRequest_Native_Data) Reset() { + *x = SemanticRequest_Native_Data{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SemanticRequest_Native_Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticRequest_Native_Data) ProtoMessage() {} + +func (x *SemanticRequest_Native_Data) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticRequest_Native_Data.ProtoReflect.Descriptor instead. +func (*SemanticRequest_Native_Data) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{3, 0, 0} +} + +type TokenSearchResponse_Status struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (x *TokenSearchResponse_Status) Reset() { + *x = TokenSearchResponse_Status{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenSearchResponse_Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenSearchResponse_Status) ProtoMessage() {} + +func (x *TokenSearchResponse_Status) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenSearchResponse_Status.ProtoReflect.Descriptor instead. +func (*TokenSearchResponse_Status) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *TokenSearchResponse_Status) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *TokenSearchResponse_Status) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type TokenSearchResponse_TokenMemo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dsn string `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` + Authorization string `protobuf:"bytes,2,opt,name=authorization,proto3" json:"authorization,omitempty"` + AccessToken string `protobuf:"bytes,3,opt,name=accessToken,proto3" json:"accessToken,omitempty"` + AppKey string `protobuf:"bytes,4,opt,name=appKey,proto3" json:"appKey,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + UriType int32 `protobuf:"varint,6,opt,name=uriType,proto3" json:"uriType,omitempty"` + HomeId string `protobuf:"bytes,7,opt,name=homeId,proto3" json:"homeId,omitempty"` // 设备所绑定家庭的 homeid +} + +func (x *TokenSearchResponse_TokenMemo) Reset() { + *x = TokenSearchResponse_TokenMemo{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenSearchResponse_TokenMemo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenSearchResponse_TokenMemo) ProtoMessage() {} + +func (x *TokenSearchResponse_TokenMemo) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_service_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenSearchResponse_TokenMemo.ProtoReflect.Descriptor instead. +func (*TokenSearchResponse_TokenMemo) Descriptor() ([]byte, []int) { + return file_pkg_proto_service_proto_rawDescGZIP(), []int{7, 1} +} + +func (x *TokenSearchResponse_TokenMemo) GetDsn() string { + if x != nil { + return x.Dsn + } + return "" +} + +func (x *TokenSearchResponse_TokenMemo) GetAuthorization() string { + if x != nil { + return x.Authorization + } + return "" +} + +func (x *TokenSearchResponse_TokenMemo) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *TokenSearchResponse_TokenMemo) GetAppKey() string { + if x != nil { + return x.AppKey + } + return "" +} + +func (x *TokenSearchResponse_TokenMemo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *TokenSearchResponse_TokenMemo) GetUriType() int32 { + if x != nil { + return x.UriType + } + return 0 +} + +func (x *TokenSearchResponse_TokenMemo) GetHomeId() string { + if x != nil { + return x.HomeId + } + return "" +} + +var File_pkg_proto_service_proto protoreflect.FileDescriptor + +var file_pkg_proto_service_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x2e, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, + 0x22, 0x4e, 0x0a, 0x12, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x4c, 0x62, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, + 0x75, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, + 0x74, 0x75, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, + 0x22, 0x55, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x22, 0xc6, 0x09, 0x0a, 0x0f, 0x53, 0x65, 0x6d, 0x61, + 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x61, 0x63, 0x57, 0x69, 0x66, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, + 0x63, 0x57, 0x69, 0x66, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x63, 0x56, 0x6f, 0x69, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x61, 0x63, 0x56, 0x6f, 0x69, 0x63, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x73, 0x74, 0x49, + 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x73, 0x74, 0x49, 0x44, 0x12, + 0x20, 0x0a, 0x0b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6d, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x2b, 0x0a, 0x03, 0x6c, 0x62, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x62, 0x73, 0x52, 0x03, 0x6c, 0x62, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x4b, 0x65, 0x79, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x20, + 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x10, 0x0a, 0x03, 0x71, 0x75, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x71, + 0x75, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x75, 0x69, 0x64, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x67, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, + 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, + 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x6e, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x06, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x12, + 0x3e, 0x0a, 0x09, 0x73, 0x64, 0x6b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x18, 0x18, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, + 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x44, 0x4b, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x64, 0x52, 0x09, 0x73, 0x64, 0x6b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x12, + 0x34, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x19, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, + 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x6f, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x1b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x6f, 0x6d, 0x65, 0x49, 0x64, 0x1a, 0xc2, 0x01, 0x0a, 0x06, 0x4e, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x65, 0x71, 0x49, + 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x65, 0x71, 0x49, 0x44, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x61, 0x74, 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x06, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x1a, 0xcf, + 0x01, 0x0a, 0x09, 0x53, 0x44, 0x4b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x61, 0x72, 0x44, 0x4f, 0x41, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x61, + 0x72, 0x44, 0x4f, 0x41, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x73, 0x70, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x52, + 0x73, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x73, + 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, + 0x61, 0x73, 0x74, 0x52, 0x73, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2c, 0x0a, 0x11, + 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, 0x15, 0x6c, 0x61, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x22, 0x62, 0x0a, 0x10, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x27, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x42, 0x0a, 0x0c, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x14, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, + 0x52, 0x65, 0x73, 0x70, 0x4a, 0x73, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x14, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, + 0x4a, 0x73, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x9e, 0x01, 0x0a, 0x12, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x61, + 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, + 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x69, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x6f, 0x6d, + 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x6d, 0x65, 0x49, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x84, 0x03, 0x0a, 0x13, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x38, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x2e, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x1a, 0xc7, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x70, 0x70, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x70, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x75, 0x72, 0x69, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x75, 0x72, 0x69, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x6f, 0x6d, 0x65, + 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x6d, 0x65, 0x49, 0x64, + 0x32, 0xa2, 0x01, 0x0a, 0x0a, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, 0x75, 0x12, + 0x44, 0x0a, 0x0f, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, 0x75, 0x50, 0x61, 0x72, + 0x73, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, + 0x74, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x15, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, + 0x4e, 0x6c, 0x75, 0x50, 0x61, 0x72, 0x73, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, + 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0x59, 0x0a, 0x0b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x12, 0x4a, 0x0a, 0x11, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x13, 0x5a, 0x11, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pkg_proto_service_proto_rawDescOnce sync.Once + file_pkg_proto_service_proto_rawDescData = file_pkg_proto_service_proto_rawDesc +) + +func file_pkg_proto_service_proto_rawDescGZIP() []byte { + file_pkg_proto_service_proto_rawDescOnce.Do(func() { + file_pkg_proto_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_proto_service_proto_rawDescData) + }) + return file_pkg_proto_service_proto_rawDescData +} + +var file_pkg_proto_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_pkg_proto_service_proto_goTypes = []interface{}{ + (*Status)(nil), // 0: proto.Status + (*SemanticRequestLbs)(nil), // 1: proto.SemanticRequestLbs + (*AddressInfo)(nil), // 2: proto.AddressInfo + (*SemanticRequest)(nil), // 3: proto.SemanticRequest + (*SemanticResponse)(nil), // 4: proto.SemanticResponse + (*SemanticData)(nil), // 5: proto.SemanticData + (*TokenSearchRequest)(nil), // 6: proto.TokenSearchRequest + (*TokenSearchResponse)(nil), // 7: proto.TokenSearchResponse + (*SemanticRequest_Native)(nil), // 8: proto.SemanticRequest.Native + (*SemanticRequest_SDKExtend)(nil), // 9: proto.SemanticRequest.SDKExtend + (*SemanticRequest_Native_Data)(nil), // 10: proto.SemanticRequest.Native.Data + (*TokenSearchResponse_Status)(nil), // 11: proto.TokenSearchResponse.Status + (*TokenSearchResponse_TokenMemo)(nil), // 12: proto.TokenSearchResponse.TokenMemo +} +var file_pkg_proto_service_proto_depIdxs = []int32{ + 1, // 0: proto.SemanticRequest.lbs:type_name -> proto.SemanticRequestLbs + 8, // 1: proto.SemanticRequest.native:type_name -> proto.SemanticRequest.Native + 9, // 2: proto.SemanticRequest.sdkExtend:type_name -> proto.SemanticRequest.SDKExtend + 2, // 3: proto.SemanticRequest.addressInfo:type_name -> proto.AddressInfo + 0, // 4: proto.SemanticResponse.status:type_name -> proto.Status + 5, // 5: proto.SemanticResponse.data:type_name -> proto.SemanticData + 11, // 6: proto.TokenSearchResponse.status:type_name -> proto.TokenSearchResponse.Status + 12, // 7: proto.TokenSearchResponse.data:type_name -> proto.TokenSearchResponse.TokenMemo + 10, // 8: proto.SemanticRequest.Native.data:type_name -> proto.SemanticRequest.Native.Data + 3, // 9: proto.TencentNlu.TencentNluParse:input_type -> proto.SemanticRequest + 3, // 10: proto.TencentNlu.TencentNluParseStream:input_type -> proto.SemanticRequest + 6, // 11: proto.TokenSearch.TokenSearchHandle:input_type -> proto.TokenSearchRequest + 4, // 12: proto.TencentNlu.TencentNluParse:output_type -> proto.SemanticResponse + 4, // 13: proto.TencentNlu.TencentNluParseStream:output_type -> proto.SemanticResponse + 7, // 14: proto.TokenSearch.TokenSearchHandle:output_type -> proto.TokenSearchResponse + 12, // [12:15] is the sub-list for method output_type + 9, // [9:12] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_pkg_proto_service_proto_init() } +func file_pkg_proto_service_proto_init() { + if File_pkg_proto_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_proto_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SemanticRequestLbs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddressInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SemanticRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SemanticResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SemanticData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TokenSearchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TokenSearchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SemanticRequest_Native); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SemanticRequest_SDKExtend); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SemanticRequest_Native_Data); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TokenSearchResponse_Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TokenSearchResponse_TokenMemo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pkg_proto_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_pkg_proto_service_proto_goTypes, + DependencyIndexes: file_pkg_proto_service_proto_depIdxs, + MessageInfos: file_pkg_proto_service_proto_msgTypes, + }.Build() + File_pkg_proto_service_proto = out.File + file_pkg_proto_service_proto_rawDesc = nil + file_pkg_proto_service_proto_goTypes = nil + file_pkg_proto_service_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// TencentNluClient is the client API for TencentNlu service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type TencentNluClient interface { + TencentNluParse(ctx context.Context, in *SemanticRequest, opts ...grpc.CallOption) (*SemanticResponse, error) + TencentNluParseStream(ctx context.Context, opts ...grpc.CallOption) (TencentNlu_TencentNluParseStreamClient, error) +} + +type tencentNluClient struct { + cc grpc.ClientConnInterface +} + +func NewTencentNluClient(cc grpc.ClientConnInterface) TencentNluClient { + return &tencentNluClient{cc} +} + +func (c *tencentNluClient) TencentNluParse(ctx context.Context, in *SemanticRequest, opts ...grpc.CallOption) (*SemanticResponse, error) { + out := new(SemanticResponse) + err := c.cc.Invoke(ctx, "/proto.TencentNlu/TencentNluParse", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tencentNluClient) TencentNluParseStream(ctx context.Context, opts ...grpc.CallOption) (TencentNlu_TencentNluParseStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &_TencentNlu_serviceDesc.Streams[0], "/proto.TencentNlu/TencentNluParseStream", opts...) + if err != nil { + return nil, err + } + x := &tencentNluTencentNluParseStreamClient{stream} + return x, nil +} + +type TencentNlu_TencentNluParseStreamClient interface { + Send(*SemanticRequest) error + Recv() (*SemanticResponse, error) + grpc.ClientStream +} + +type tencentNluTencentNluParseStreamClient struct { + grpc.ClientStream +} + +func (x *tencentNluTencentNluParseStreamClient) Send(m *SemanticRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *tencentNluTencentNluParseStreamClient) Recv() (*SemanticResponse, error) { + m := new(SemanticResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// TencentNluServer is the server API for TencentNlu service. +type TencentNluServer interface { + TencentNluParse(context.Context, *SemanticRequest) (*SemanticResponse, error) + TencentNluParseStream(TencentNlu_TencentNluParseStreamServer) error +} + +// UnimplementedTencentNluServer can be embedded to have forward compatible implementations. +type UnimplementedTencentNluServer struct { +} + +func (*UnimplementedTencentNluServer) TencentNluParse(context.Context, *SemanticRequest) (*SemanticResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TencentNluParse not implemented") +} +func (*UnimplementedTencentNluServer) TencentNluParseStream(TencentNlu_TencentNluParseStreamServer) error { + return status.Errorf(codes.Unimplemented, "method TencentNluParseStream not implemented") +} + +func RegisterTencentNluServer(s *grpc.Server, srv TencentNluServer) { + s.RegisterService(&_TencentNlu_serviceDesc, srv) +} + +func _TencentNlu_TencentNluParse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SemanticRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TencentNluServer).TencentNluParse(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.TencentNlu/TencentNluParse", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TencentNluServer).TencentNluParse(ctx, req.(*SemanticRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TencentNlu_TencentNluParseStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(TencentNluServer).TencentNluParseStream(&tencentNluTencentNluParseStreamServer{stream}) +} + +type TencentNlu_TencentNluParseStreamServer interface { + Send(*SemanticResponse) error + Recv() (*SemanticRequest, error) + grpc.ServerStream +} + +type tencentNluTencentNluParseStreamServer struct { + grpc.ServerStream +} + +func (x *tencentNluTencentNluParseStreamServer) Send(m *SemanticResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *tencentNluTencentNluParseStreamServer) Recv() (*SemanticRequest, error) { + m := new(SemanticRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _TencentNlu_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.TencentNlu", + HandlerType: (*TencentNluServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TencentNluParse", + Handler: _TencentNlu_TencentNluParse_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "TencentNluParseStream", + Handler: _TencentNlu_TencentNluParseStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "pkg/proto/service.proto", +} + +// TokenSearchClient is the client API for TokenSearch service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type TokenSearchClient interface { + TokenSearchHandle(ctx context.Context, in *TokenSearchRequest, opts ...grpc.CallOption) (*TokenSearchResponse, error) +} + +type tokenSearchClient struct { + cc grpc.ClientConnInterface +} + +func NewTokenSearchClient(cc grpc.ClientConnInterface) TokenSearchClient { + return &tokenSearchClient{cc} +} + +func (c *tokenSearchClient) TokenSearchHandle(ctx context.Context, in *TokenSearchRequest, opts ...grpc.CallOption) (*TokenSearchResponse, error) { + out := new(TokenSearchResponse) + err := c.cc.Invoke(ctx, "/proto.TokenSearch/TokenSearchHandle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TokenSearchServer is the server API for TokenSearch service. +type TokenSearchServer interface { + TokenSearchHandle(context.Context, *TokenSearchRequest) (*TokenSearchResponse, error) +} + +// UnimplementedTokenSearchServer can be embedded to have forward compatible implementations. +type UnimplementedTokenSearchServer struct { +} + +func (*UnimplementedTokenSearchServer) TokenSearchHandle(context.Context, *TokenSearchRequest) (*TokenSearchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenSearchHandle not implemented") +} + +func RegisterTokenSearchServer(s *grpc.Server, srv TokenSearchServer) { + s.RegisterService(&_TokenSearch_serviceDesc, srv) +} + +func _TokenSearch_TokenSearchHandle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TokenSearchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenSearchServer).TokenSearchHandle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.TokenSearch/TokenSearchHandle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenSearchServer).TokenSearchHandle(ctx, req.(*TokenSearchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _TokenSearch_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.TokenSearch", + HandlerType: (*TokenSearchServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TokenSearchHandle", + Handler: _TokenSearch_TokenSearchHandle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/proto/service.proto", +} diff --git a/pkg/proto/service.proto b/pkg/proto/service.proto new file mode 100644 index 0000000..3240290 --- /dev/null +++ b/pkg/proto/service.proto @@ -0,0 +1,143 @@ +syntax = "proto3"; + +package proto; //新增一个可选的package声明符,用来防止不同的消息类型有命名冲突 +option go_package = "./pkg/proto;proto"; //这个选项表明生成go结构体所在的包 + +// import "google/protobuf/any.proto"; + +message Status { + int32 code = 1; + string msg = 2; +} + +// 经纬度 +message SemanticRequestLbs { + double longitude = 1; + double latitude = 2; +} + +message AddressInfo { + string province = 1; + string city = 2; + string county = 3; +} + +message SemanticRequest { + string macWifi = 1; + string macVoice = 2; + string query = 3; + string ip = 4; + string testID = 5; + string originQuery = 6; + string mid = 7; + string requestId = 8; + SemanticRequestLbs lbs = 9; + string vender = 10; + string appKey = 11; // 云小微 + string accessToken = 12; + string qua = 13; + string auth = 14; + string dsn = 15; + string guid = 16; + bool exist = 17; // 授权信息是否存在 + string tRequestId = 18; // 腾讯v2的requestId + string requestType = 19; // 腾讯nlp websocket RequestType + string commType = 20; // 腾讯nlp websocket CommType + string characterID = 21; // 腾讯nlp websocket Common.CharacterID + string event = 22; // 腾讯nlp websocket Semantic.Event + message Native { + string name = 1; + string seqID = 2; + int32 code = 3; + string message = 4; + string dataVersion = 5; + message Data { + // TODO: Native API协议数据, 由云端和客户端一起定义 + } + Data data = 6; + } + Native native = 23; // 腾讯nlp websocket Payload.Nativate + message SDKExtend { + int32 carDOA = 1; + string lastRspType = 2; + string lastRspResult = 3; + int32 lastSessionStatus = 4; + string lastCompleteCmdResult = 5; + } + SDKExtend sdkExtend = 24; // 腾讯nlp websocket Payload.SDKExtend + AddressInfo addressInfo = 25; + string language = 26; + string homeId = 27; +} + +message SemanticResponse { + Status status = 1; + SemanticData data = 2; +} + +message SemanticData { + string semanticRespJsonData = 1; +} + +service TencentNlu { + rpc TencentNluParse (SemanticRequest) returns (SemanticResponse) {} + rpc TencentNluParseStream (stream SemanticRequest) returns (stream SemanticResponse) {} +} + +/* +################## token_search.proto ################## +查询dsn及状态信息 +*/ + +message TokenSearchRequest { + string mac = 1; + string requestId = 2; + string mid = 3; // mid + string vender = 4; // 细分码,用于设备没授权的情况下给默认boot + string homeId = 5; // 设备所属家庭id + string userId = 6; // 用户id +} + + + + /* + data.uriType 取值说明: + QQMusic = 0 // qq音乐 + KugouMusic = 1 // 酷狗音乐 + + data.status 取值说明: + Unassigned = 0 //未分配 没有AppKey 没有token + Assigned = 1 //已分配 + Using = 2 //已授权,使用中 + Expired = 3 //过期 + Invalidation = 4 //异常失效 + Unbind = 5 //解除绑定 + + status.code + 200 成功 + 401 激活错误 + 403 参数格式 + 405 设备为激活 +*/ +message TokenSearchResponse { + message Status { + int32 code = 1; + string msg = 2; + } + message TokenMemo { + string dsn = 1; + string authorization = 2; + string accessToken = 3; + string appKey = 4; + int32 status = 5; + int32 uriType = 6; + string homeId = 7; // 设备所绑定家庭的 homeid + } + + Status status = 1; + TokenMemo data = 2; +} + +service TokenSearch{ + rpc TokenSearchHandle(TokenSearchRequest) returns (TokenSearchResponse); +} diff --git a/pkg/proto/tencent_nlp_skill.pb.go b/pkg/proto/tencent_nlp_skill.pb.go new file mode 100644 index 0000000..ba9dff9 --- /dev/null +++ b/pkg/proto/tencent_nlp_skill.pb.go @@ -0,0 +1,937 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: pkg/proto/tencent_nlp_skill.proto + +package proto + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type TextItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"Status,omitempty"` + Text string `protobuf:"bytes,2,opt,name=Text,proto3" json:"Text,omitempty"` + PlaceholderList []string `protobuf:"bytes,3,rep,name=PlaceholderList,proto3" json:"PlaceholderList,omitempty"` +} + +func (x *TextItem) Reset() { + *x = TextItem{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TextItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TextItem) ProtoMessage() {} + +func (x *TextItem) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TextItem.ProtoReflect.Descriptor instead. +func (*TextItem) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{0} +} + +func (x *TextItem) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *TextItem) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *TextItem) GetPlaceholderList() []string { + if x != nil { + return x.PlaceholderList + } + return nil +} + +type Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Param map[string]string `protobuf:"bytes,2,rep,name=Param,proto3" json:"Param,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TextList []*TextItem `protobuf:"bytes,3,rep,name=TextList,proto3" json:"TextList,omitempty"` +} + +func (x *Command) Reset() { + *x = Command{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Command) ProtoMessage() {} + +func (x *Command) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Command.ProtoReflect.Descriptor instead. +func (*Command) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{1} +} + +func (x *Command) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Command) GetParam() map[string]string { + if x != nil { + return x.Param + } + return nil +} + +func (x *Command) GetTextList() []*TextItem { + if x != nil { + return x.TextList + } + return nil +} + +// 腾讯识别的技能 +type TencentNlpSkillRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppInfo *TencentNlpSkillRequest_AppInfo `protobuf:"bytes,1,opt,name=appInfo,proto3" json:"appInfo,omitempty"` + DevInfo *TencentNlpSkillRequest_DevInfo `protobuf:"bytes,2,opt,name=devInfo,proto3" json:"devInfo,omitempty"` + UserInfo *TencentNlpSkillRequest_UserInfo `protobuf:"bytes,3,opt,name=userInfo,proto3" json:"userInfo,omitempty"` + Command *Command `protobuf:"bytes,4,opt,name=command,proto3" json:"command,omitempty"` +} + +func (x *TencentNlpSkillRequest) Reset() { + *x = TencentNlpSkillRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TencentNlpSkillRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TencentNlpSkillRequest) ProtoMessage() {} + +func (x *TencentNlpSkillRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TencentNlpSkillRequest.ProtoReflect.Descriptor instead. +func (*TencentNlpSkillRequest) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{2} +} + +func (x *TencentNlpSkillRequest) GetAppInfo() *TencentNlpSkillRequest_AppInfo { + if x != nil { + return x.AppInfo + } + return nil +} + +func (x *TencentNlpSkillRequest) GetDevInfo() *TencentNlpSkillRequest_DevInfo { + if x != nil { + return x.DevInfo + } + return nil +} + +func (x *TencentNlpSkillRequest) GetUserInfo() *TencentNlpSkillRequest_UserInfo { + if x != nil { + return x.UserInfo + } + return nil +} + +func (x *TencentNlpSkillRequest) GetCommand() *Command { + if x != nil { + return x.Command + } + return nil +} + +type TencentNlpSkillResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *TencentNlpSkillResponse_Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Response *TencentNlpSkillResponse_Response `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` + Result []*anypb.Any `protobuf:"bytes,3,rep,name=result,proto3" json:"result,omitempty"` + IsMultiRound bool `protobuf:"varint,4,opt,name=isMultiRound,proto3" json:"isMultiRound,omitempty"` +} + +func (x *TencentNlpSkillResponse) Reset() { + *x = TencentNlpSkillResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TencentNlpSkillResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TencentNlpSkillResponse) ProtoMessage() {} + +func (x *TencentNlpSkillResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TencentNlpSkillResponse.ProtoReflect.Descriptor instead. +func (*TencentNlpSkillResponse) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{3} +} + +func (x *TencentNlpSkillResponse) GetStatus() *TencentNlpSkillResponse_Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *TencentNlpSkillResponse) GetResponse() *TencentNlpSkillResponse_Response { + if x != nil { + return x.Response + } + return nil +} + +func (x *TencentNlpSkillResponse) GetResult() []*anypb.Any { + if x != nil { + return x.Result + } + return nil +} + +func (x *TencentNlpSkillResponse) GetIsMultiRound() bool { + if x != nil { + return x.IsMultiRound + } + return false +} + +type TencentNlpSkillRequest_AppInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppId string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"` + RequestId string `protobuf:"bytes,2,opt,name=requestId,proto3" json:"requestId,omitempty"` +} + +func (x *TencentNlpSkillRequest_AppInfo) Reset() { + *x = TencentNlpSkillRequest_AppInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TencentNlpSkillRequest_AppInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TencentNlpSkillRequest_AppInfo) ProtoMessage() {} + +func (x *TencentNlpSkillRequest_AppInfo) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TencentNlpSkillRequest_AppInfo.ProtoReflect.Descriptor instead. +func (*TencentNlpSkillRequest_AppInfo) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *TencentNlpSkillRequest_AppInfo) GetAppId() string { + if x != nil { + return x.AppId + } + return "" +} + +func (x *TencentNlpSkillRequest_AppInfo) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +type TencentNlpSkillRequest_UserInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Hid string `protobuf:"bytes,2,opt,name=hid,proto3" json:"hid,omitempty"` +} + +func (x *TencentNlpSkillRequest_UserInfo) Reset() { + *x = TencentNlpSkillRequest_UserInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TencentNlpSkillRequest_UserInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TencentNlpSkillRequest_UserInfo) ProtoMessage() {} + +func (x *TencentNlpSkillRequest_UserInfo) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TencentNlpSkillRequest_UserInfo.ProtoReflect.Descriptor instead. +func (*TencentNlpSkillRequest_UserInfo) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *TencentNlpSkillRequest_UserInfo) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *TencentNlpSkillRequest_UserInfo) GetHid() string { + if x != nil { + return x.Hid + } + return "" +} + +type TencentNlpSkillRequest_DevInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mac string `protobuf:"bytes,1,opt,name=mac,proto3" json:"mac,omitempty"` + TarMac string `protobuf:"bytes,2,opt,name=tarMac,proto3" json:"tarMac,omitempty"` +} + +func (x *TencentNlpSkillRequest_DevInfo) Reset() { + *x = TencentNlpSkillRequest_DevInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TencentNlpSkillRequest_DevInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TencentNlpSkillRequest_DevInfo) ProtoMessage() {} + +func (x *TencentNlpSkillRequest_DevInfo) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TencentNlpSkillRequest_DevInfo.ProtoReflect.Descriptor instead. +func (*TencentNlpSkillRequest_DevInfo) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{2, 2} +} + +func (x *TencentNlpSkillRequest_DevInfo) GetMac() string { + if x != nil { + return x.Mac + } + return "" +} + +func (x *TencentNlpSkillRequest_DevInfo) GetTarMac() string { + if x != nil { + return x.TarMac + } + return "" +} + +type TencentNlpSkillResponse_Status struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (x *TencentNlpSkillResponse_Status) Reset() { + *x = TencentNlpSkillResponse_Status{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TencentNlpSkillResponse_Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TencentNlpSkillResponse_Status) ProtoMessage() {} + +func (x *TencentNlpSkillResponse_Status) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TencentNlpSkillResponse_Status.ProtoReflect.Descriptor instead. +func (*TencentNlpSkillResponse_Status) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *TencentNlpSkillResponse_Status) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *TencentNlpSkillResponse_Status) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type TencentNlpSkillResponse_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` + Hint string `protobuf:"bytes,3,opt,name=hint,proto3" json:"hint,omitempty"` + Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` +} + +func (x *TencentNlpSkillResponse_Response) Reset() { + *x = TencentNlpSkillResponse_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TencentNlpSkillResponse_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TencentNlpSkillResponse_Response) ProtoMessage() {} + +func (x *TencentNlpSkillResponse_Response) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_tencent_nlp_skill_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TencentNlpSkillResponse_Response.ProtoReflect.Descriptor instead. +func (*TencentNlpSkillResponse_Response) Descriptor() ([]byte, []int) { + return file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *TencentNlpSkillResponse_Response) GetPrefix() string { + if x != nil { + return x.Prefix + } + return "" +} + +func (x *TencentNlpSkillResponse_Response) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *TencentNlpSkillResponse_Response) GetHint() string { + if x != nil { + return x.Hint + } + return "" +} + +func (x *TencentNlpSkillResponse_Response) GetSuffix() string { + if x != nil { + return x.Suffix + } + return "" +} + +var File_pkg_proto_tencent_nlp_skill_proto protoreflect.FileDescriptor + +var file_pkg_proto_tencent_nlp_skill_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x6e, 0x63, + 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x6c, 0x70, 0x5f, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x08, 0x54, 0x65, 0x78, 0x74, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x65, 0x78, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x65, 0x78, 0x74, 0x12, 0x28, 0x0a, + 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, + 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xb5, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x05, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x2b, 0x0a, 0x08, 0x54, 0x65, 0x78, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x54, 0x65, 0x78, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x38, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xac, 0x03, 0x0a, 0x16, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, 0x70, 0x53, 0x6b, + 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x07, 0x61, 0x70, + 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, 0x70, 0x53, 0x6b, + 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x07, 0x61, 0x70, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3f, 0x0a, 0x07, 0x64, + 0x65, 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, 0x70, 0x53, + 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x65, 0x76, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x64, 0x65, 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x42, 0x0a, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, + 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x28, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0x3d, 0x0a, 0x07, 0x41, 0x70, + 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x1a, 0x2e, 0x0a, 0x08, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x69, 0x64, 0x1a, 0x33, 0x0a, 0x07, 0x44, 0x65, 0x76, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6d, 0x61, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x4d, 0x61, 0x63, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x4d, 0x61, 0x63, 0x22, 0x83, + 0x03, 0x0a, 0x17, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, 0x70, 0x53, 0x6b, 0x69, + 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, 0x70, 0x53, 0x6b, 0x69, + 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, 0x6c, 0x70, 0x53, 0x6b, + 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x22, 0x0a, 0x0c, + 0x69, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x52, 0x6f, 0x75, 0x6e, 0x64, + 0x1a, 0x2e, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, + 0x1a, 0x62, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, + 0x66, 0x66, 0x69, 0x78, 0x32, 0x5b, 0x0a, 0x0f, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x4e, + 0x6c, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x48, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, + 0x6e, 0x74, 0x4e, 0x6c, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, + 0x74, 0x4e, 0x6c, 0x70, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x13, 0x5a, 0x11, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pkg_proto_tencent_nlp_skill_proto_rawDescOnce sync.Once + file_pkg_proto_tencent_nlp_skill_proto_rawDescData = file_pkg_proto_tencent_nlp_skill_proto_rawDesc +) + +func file_pkg_proto_tencent_nlp_skill_proto_rawDescGZIP() []byte { + file_pkg_proto_tencent_nlp_skill_proto_rawDescOnce.Do(func() { + file_pkg_proto_tencent_nlp_skill_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_proto_tencent_nlp_skill_proto_rawDescData) + }) + return file_pkg_proto_tencent_nlp_skill_proto_rawDescData +} + +var file_pkg_proto_tencent_nlp_skill_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_pkg_proto_tencent_nlp_skill_proto_goTypes = []interface{}{ + (*TextItem)(nil), // 0: proto.TextItem + (*Command)(nil), // 1: proto.Command + (*TencentNlpSkillRequest)(nil), // 2: proto.TencentNlpSkillRequest + (*TencentNlpSkillResponse)(nil), // 3: proto.TencentNlpSkillResponse + nil, // 4: proto.Command.ParamEntry + (*TencentNlpSkillRequest_AppInfo)(nil), // 5: proto.TencentNlpSkillRequest.AppInfo + (*TencentNlpSkillRequest_UserInfo)(nil), // 6: proto.TencentNlpSkillRequest.UserInfo + (*TencentNlpSkillRequest_DevInfo)(nil), // 7: proto.TencentNlpSkillRequest.DevInfo + (*TencentNlpSkillResponse_Status)(nil), // 8: proto.TencentNlpSkillResponse.Status + (*TencentNlpSkillResponse_Response)(nil), // 9: proto.TencentNlpSkillResponse.Response + (*anypb.Any)(nil), // 10: google.protobuf.Any +} +var file_pkg_proto_tencent_nlp_skill_proto_depIdxs = []int32{ + 4, // 0: proto.Command.Param:type_name -> proto.Command.ParamEntry + 0, // 1: proto.Command.TextList:type_name -> proto.TextItem + 5, // 2: proto.TencentNlpSkillRequest.appInfo:type_name -> proto.TencentNlpSkillRequest.AppInfo + 7, // 3: proto.TencentNlpSkillRequest.devInfo:type_name -> proto.TencentNlpSkillRequest.DevInfo + 6, // 4: proto.TencentNlpSkillRequest.userInfo:type_name -> proto.TencentNlpSkillRequest.UserInfo + 1, // 5: proto.TencentNlpSkillRequest.command:type_name -> proto.Command + 8, // 6: proto.TencentNlpSkillResponse.status:type_name -> proto.TencentNlpSkillResponse.Status + 9, // 7: proto.TencentNlpSkillResponse.response:type_name -> proto.TencentNlpSkillResponse.Response + 10, // 8: proto.TencentNlpSkillResponse.result:type_name -> google.protobuf.Any + 2, // 9: proto.TencentNlpSkill.Process:input_type -> proto.TencentNlpSkillRequest + 3, // 10: proto.TencentNlpSkill.Process:output_type -> proto.TencentNlpSkillResponse + 10, // [10:11] is the sub-list for method output_type + 9, // [9:10] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_pkg_proto_tencent_nlp_skill_proto_init() } +func file_pkg_proto_tencent_nlp_skill_proto_init() { + if File_pkg_proto_tencent_nlp_skill_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TextItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TencentNlpSkillRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TencentNlpSkillResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TencentNlpSkillRequest_AppInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TencentNlpSkillRequest_UserInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TencentNlpSkillRequest_DevInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TencentNlpSkillResponse_Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_proto_tencent_nlp_skill_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TencentNlpSkillResponse_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pkg_proto_tencent_nlp_skill_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_pkg_proto_tencent_nlp_skill_proto_goTypes, + DependencyIndexes: file_pkg_proto_tencent_nlp_skill_proto_depIdxs, + MessageInfos: file_pkg_proto_tencent_nlp_skill_proto_msgTypes, + }.Build() + File_pkg_proto_tencent_nlp_skill_proto = out.File + file_pkg_proto_tencent_nlp_skill_proto_rawDesc = nil + file_pkg_proto_tencent_nlp_skill_proto_goTypes = nil + file_pkg_proto_tencent_nlp_skill_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// TencentNlpSkillClient is the client API for TencentNlpSkill service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type TencentNlpSkillClient interface { + Process(ctx context.Context, in *TencentNlpSkillRequest, opts ...grpc.CallOption) (*TencentNlpSkillResponse, error) +} + +type tencentNlpSkillClient struct { + cc grpc.ClientConnInterface +} + +func NewTencentNlpSkillClient(cc grpc.ClientConnInterface) TencentNlpSkillClient { + return &tencentNlpSkillClient{cc} +} + +func (c *tencentNlpSkillClient) Process(ctx context.Context, in *TencentNlpSkillRequest, opts ...grpc.CallOption) (*TencentNlpSkillResponse, error) { + out := new(TencentNlpSkillResponse) + err := c.cc.Invoke(ctx, "/proto.TencentNlpSkill/Process", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TencentNlpSkillServer is the server API for TencentNlpSkill service. +type TencentNlpSkillServer interface { + Process(context.Context, *TencentNlpSkillRequest) (*TencentNlpSkillResponse, error) +} + +// UnimplementedTencentNlpSkillServer can be embedded to have forward compatible implementations. +type UnimplementedTencentNlpSkillServer struct { +} + +func (*UnimplementedTencentNlpSkillServer) Process(context.Context, *TencentNlpSkillRequest) (*TencentNlpSkillResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Process not implemented") +} + +func RegisterTencentNlpSkillServer(s *grpc.Server, srv TencentNlpSkillServer) { + s.RegisterService(&_TencentNlpSkill_serviceDesc, srv) +} + +func _TencentNlpSkill_Process_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TencentNlpSkillRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TencentNlpSkillServer).Process(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.TencentNlpSkill/Process", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TencentNlpSkillServer).Process(ctx, req.(*TencentNlpSkillRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _TencentNlpSkill_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.TencentNlpSkill", + HandlerType: (*TencentNlpSkillServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Process", + Handler: _TencentNlpSkill_Process_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/proto/tencent_nlp_skill.proto", +} diff --git a/pkg/proto/tencent_nlp_skill.proto b/pkg/proto/tencent_nlp_skill.proto new file mode 100644 index 0000000..270fd22 --- /dev/null +++ b/pkg/proto/tencent_nlp_skill.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; + +package proto; //新增一个可选的package声明符,用来防止不同的消息类型有命名冲突 +option go_package = "./pkg/proto;proto"; //这个选项表明生成go结构体所在的包 + +import "google/protobuf/any.proto"; + +message TextItem { + string Status = 1; + string Text = 2; + repeated string PlaceholderList = 3; +} + +message Command { + string Name = 1; + map Param = 2; + repeated TextItem TextList = 3; +} + +// 腾讯识别的技能 +message TencentNlpSkillRequest{ + message AppInfo { + string appId = 1; + string requestId = 2; + } + message UserInfo { + string uid = 1; + string hid = 2; + } + message DevInfo { + string mac = 1; + string tarMac = 2; + } + AppInfo appInfo = 1; + DevInfo devInfo = 2; + UserInfo userInfo = 3; + Command command = 4; + string asr_recognize = 5; // TODO: 增加识别结果 +} + +/*message AlarmRemindItem{ + int32 id = 1; + string note = 2; + string date = 3; + string time = 4; + string status = 5; +}*/ + +message TencentNlpSkillResponse{ + message Status { + int32 code = 1; + string msg = 2; + } + message Response { + string prefix = 1; + string text = 2; + string hint = 3; + string suffix = 4; + } + Status status = 1; + Response response = 2; + repeated google.protobuf.Any result = 3; + bool isMultiRound = 4; +} + +service TencentNlpSkill { + rpc Process (TencentNlpSkillRequest) returns (TencentNlpSkillResponse); +} diff --git a/pkg/setting/section.go b/pkg/setting/section.go new file mode 100644 index 0000000..c5561c3 --- /dev/null +++ b/pkg/setting/section.go @@ -0,0 +1,95 @@ +package setting + +type LogSettingS struct { + LogFileName string + LogFileExt string + LogSavePath string + MaxSize int + MaxAge int + MaxBackups int + Compress bool +} + +type DeviceSettingS struct { + Mids []string + AppID int64 + AppKey string +} + +type InternalRemoteSettingS struct { + IOT struct { + IotHost string + + GetDevsInRoomsByHomeIdAndUid string + GetDevsInfoOfHomeByMac string + GetDevCustomData string + + StartOrCancelScene string + GetScenes string + + SetCloudTimerData string + GetCloudTimerByMacs string + DelCloudTimerData string + + GetGridConList string + + SendDevCmd string + SendDevPack string + } +} + +type DBSettingS struct { + Dsn string +} + +type MusicDomainSettingS struct { + IsQQMusicRemid bool + QQMusicRemid string + AlbumList []string +} + +type AuthSettingS struct { + AuthorizationTimeout int + AuthorizationUrl string +} + +type TencentSettingS struct { + DingDangNluUrl string + TencentSha256Secret string +} + +type OthersSettingS struct { + SoundTestUrl string +} + +type ServiceSettingS struct { + Dmsdk string +} + +type DevLimitedS struct { + Mids []string + Limited LimitedS +} + +type LimitedS struct { + AlarmNum int + Recipe bool + FmDomainAlbumList []string + Memory bool + Screen bool + HistoryNum int + IsMusicRemid bool + MusicRemidText string + ShieldedDomainList []string +} + +type TencentGwSetting struct { + Gw struct { + GwHost string + GwWs string + } +} + +func (s *Setting) ReadSection(k string, v interface{}) error { + return s.vp.UnmarshalKey(k, v) +} diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go new file mode 100644 index 0000000..727f638 --- /dev/null +++ b/pkg/setting/setting.go @@ -0,0 +1,37 @@ +package setting + +import ( + "bytes" + + "speech-nlu-parse/pkg/consul" + + "github.com/spf13/viper" +) + +// TODO consul的地址和token +// var ( // 默认本地环境的地址 +// consulURL = "http://172.28.5.39:8500" +// token = "092288b5-824f-854c-39aa-a958afd9a633" +// ) + +type Setting struct { + vp *viper.Viper +} + +func NewSetting(consulAddr, consulToken string, configs ...string) (*Setting, error) { + vp := viper.New() + vp.SetConfigType("yaml") + + configContent := consul.GetKV(consulAddr, consulToken, configs...) + + err := vp.ReadConfig(bytes.NewBuffer(configContent)) + if err != nil { + return nil, err + } + + s := &Setting{ + vp: vp, + } + + return s, nil +} diff --git a/pkg/util/aes.go b/pkg/util/aes.go new file mode 100644 index 0000000..fad68a6 --- /dev/null +++ b/pkg/util/aes.go @@ -0,0 +1,133 @@ +package util + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "encoding/base64" + "io" +) + +// =================== CBC ====================== +func EncryptAESByCBC(origData []byte, key []byte) (encrypted []byte) { + // 分组秘钥 + // NewCipher该函数限制了输入k的长度必须为16, 24或者32 + block, _ := aes.NewCipher(key) + blockSize := block.BlockSize() // 获取秘钥块的长度 + origData = pkcs5Padding(origData, blockSize) // 补全码 + blockMode := cipher.NewCBCEncrypter(block, key[:blockSize]) // 加密模式 + encrypted = make([]byte, len(origData)) // 创建数组 + blockMode.CryptBlocks(encrypted, origData) // 加密 + return encrypted +} + +func DecryptAESByCBC(encrypted []byte, key []byte) (decrypted []byte) { + block, _ := aes.NewCipher(key) // 分组秘钥 + blockSize := block.BlockSize() // 获取秘钥块的长度 + blockMode := cipher.NewCBCDecrypter(block, key[:blockSize]) // 加密模式 + decrypted = make([]byte, len(encrypted)) // 创建数组 + blockMode.CryptBlocks(decrypted, encrypted) // 解密 + decrypted = pkcs5UnPadding(decrypted) // 去除补全码 + return decrypted +} + +func pkcs5Padding(ciphertext []byte, blockSize int) []byte { + padding := blockSize - len(ciphertext)%blockSize + padtext := bytes.Repeat([]byte{byte(padding)}, padding) + return append(ciphertext, padtext...) +} + +func pkcs5UnPadding(origData []byte) []byte { + length := len(origData) + unpadding := int(origData[length-1]) + return origData[:(length - unpadding)] +} + +// =================== ECB ====================== +func EncryptAESByECB(origData []byte, key string) (string, error) { + cipherBLock, err := aes.NewCipher(generateKey([]byte(key))) + if err != nil { + return "", err + } + length := (len(origData) + aes.BlockSize) / aes.BlockSize + plain := make([]byte, length*aes.BlockSize) + copy(plain, origData) + pad := byte(len(plain) - len(origData)) + for i := len(origData); i < len(plain); i++ { + plain[i] = pad + } + encrypted := make([]byte, len(plain)) + // 分组分块加密 + for bs, be := 0, cipherBLock.BlockSize(); bs <= len(origData); bs, be = bs+cipherBLock.BlockSize(), be+cipherBLock.BlockSize() { + cipherBLock.Encrypt(encrypted[bs:be], plain[bs:be]) + } + + encryptedBase64 := base64.StdEncoding.EncodeToString(encrypted) + + return encryptedBase64, nil +} + +func DecryptAESByECB(decryptData, key string) ([]byte, error) { + encrypted, err := base64.StdEncoding.DecodeString(decryptData) + if err != nil { + return nil, err + } + + cipherBLock, err := aes.NewCipher(generateKey([]byte(key))) + if err != nil { + return nil, err + } + decrypted := make([]byte, len(encrypted)) + + for bs, be := 0, cipherBLock.BlockSize(); bs < len(encrypted); bs, be = bs+cipherBLock.BlockSize(), be+cipherBLock.BlockSize() { + cipherBLock.Decrypt(decrypted[bs:be], encrypted[bs:be]) + } + + trim := 0 + if len(decrypted) > 0 { + trim = len(decrypted) - int(decrypted[len(decrypted)-1]) + } + + return decrypted[:trim], nil +} + +func generateKey(key []byte) (genKey []byte) { + genKey = make([]byte, 16) + copy(genKey, key) + for i := 16; i < len(key); { + for j := 0; j < 16 && i < len(key); j, i = j+1, i+1 { + genKey[j] ^= key[i] + } + } + return genKey +} + +// =================== CFB ====================== +func EncryptAESByCFB(origData []byte, key []byte) (encrypted []byte) { + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + encrypted = make([]byte, aes.BlockSize+len(origData)) + iv := encrypted[:aes.BlockSize] + if _, err := io.ReadFull(rand.Reader, iv); err != nil { + panic(err) + } + stream := cipher.NewCFBEncrypter(block, iv) + stream.XORKeyStream(encrypted[aes.BlockSize:], origData) + return encrypted +} + +func DecryptAESByCFB(encrypted []byte, key []byte) (decrypted []byte) { + block, _ := aes.NewCipher(key) + if len(encrypted) < aes.BlockSize { + panic("ciphertext too short") + } + iv := encrypted[:aes.BlockSize] + encrypted = encrypted[aes.BlockSize:] + + stream := cipher.NewCFBDecrypter(block, iv) + stream.XORKeyStream(encrypted, encrypted) + return encrypted +} diff --git a/pkg/util/ip.go b/pkg/util/ip.go new file mode 100644 index 0000000..4142a86 --- /dev/null +++ b/pkg/util/ip.go @@ -0,0 +1,61 @@ +package util + +import ( + "errors" + "net" +) + +// GetLocalIP 获取本地IP +func GetLocalIP() (ip string) { + netIp, err := externalIP() + if err != nil { + return "" + } + return netIp.String() +} + +func externalIP() (net.IP, error) { + ifaces, err := net.Interfaces() + if err != nil { + return nil, err + } + for _, iface := range ifaces { + if iface.Flags&net.FlagUp == 0 { + continue // interface down + } + if iface.Flags&net.FlagLoopback != 0 { + continue // loopback interface + } + addrs, err := iface.Addrs() + if err != nil { + return nil, err + } + for _, addr := range addrs { + ip := getIpFromAddr(addr) + if ip == nil { + continue + } + return ip, nil + } + } + return nil, errors.New("connected to the network?") +} + +func getIpFromAddr(addr net.Addr) net.IP { + var ip net.IP + switch v := addr.(type) { + case *net.IPNet: + ip = v.IP + case *net.IPAddr: + ip = v.IP + } + if ip == nil || ip.IsLoopback() { + return nil + } + ip = ip.To4() + if ip == nil { + return nil // not an ipv4 address + } + + return ip +} diff --git a/pkg/util/md5.go b/pkg/util/md5.go new file mode 100644 index 0000000..8e2af17 --- /dev/null +++ b/pkg/util/md5.go @@ -0,0 +1,13 @@ +package util + +import ( + "crypto/md5" + "encoding/hex" +) + +func EncodeMD5(v string) string { + h := md5.New() + h.Write([]byte(v)) + cipherStr := h.Sum(nil) + return hex.EncodeToString(cipherStr) +} diff --git a/pkg/util/utils.go b/pkg/util/utils.go new file mode 100644 index 0000000..5b8bd43 --- /dev/null +++ b/pkg/util/utils.go @@ -0,0 +1,40 @@ +package util + +import ( + "crypto/hmac" + "crypto/md5" + "crypto/sha256" + "fmt" + "io" + "math/rand" + "time" +) + +// 用appkey、appSceret和HMAC-SHA256(mac, secremacSHA256SecrettKey)三个字符串拼接,以":"作为分隔符,再做md5生成guid +func ComputerMd5(orginStr string) string { + data := []byte(orginStr) + hash := md5.Sum(data) + md5Str := fmt.Sprintf("%x", hash) + return md5Str +} + +func ComputeHmac256(message string, secret string) string { + h := hmac.New(sha256.New, []byte(secret)) + io.WriteString(h, message) + return fmt.Sprintf("%x", h.Sum(nil)) +} + +func GetRandom(count int) int { + r := rand.New(rand.NewSource(time.Now().UnixNano())) + return r.Intn(count) +} + +// 是否包含 +func IsContain(source string, targetList []string) bool { + for i := 0; i < len(targetList); i++ { + if source == targetList[i] { + return true + } + } + return false +} diff --git a/service/connect/find_grpc.go b/service/connect/find_grpc.go new file mode 100644 index 0000000..07fc71c --- /dev/null +++ b/service/connect/find_grpc.go @@ -0,0 +1,56 @@ +package connect + +import ( + "context" + "fmt" + "github.com/hashicorp/consul/api" + "speech-nlu-parse/global" + "sync" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/balancer/roundrobin" + "google.golang.org/grpc/credentials/insecure" +) + +// 技能服务连接句柄 +var skillConn sync.Map + +// 获取GRPC服务连接句柄 +func GrpcConn(serverName string) (*grpc.ClientConn, error) { + if conn, ok := skillConn.Load(serverName); ok { + return conn.(*grpc.ClientConn), nil + } + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + + // 通过 Consul 客户端查询服务实例 + consulConfig := api.DefaultConfig() + consulConfig.Address = global.ServerSetting.ConsulAddr + client, _ := api.NewClient(consulConfig) + entries, _, _ := client.Health().Service(serverName, "", true, nil) + + // 获取第一个健康实例的地址 + targetAddr := fmt.Sprintf("%s:%d", + entries[0].Service.Address, + entries[0].Service.Port) + + //target := fmt.Sprintf("consul://%s/%s", global.ConsulAddr, serverName) + //fmt.Println("1111123132131312") + fmt.Println(targetAddr) + opts := []grpc.DialOption{ + //grpc.WithBlock(), //阻塞连接直到成功或超时,存在缺陷 + grpc.WithTransportCredentials(insecure.NewCredentials()), //指定传输层安全性的凭据 + grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)), // 设置默认的负载均衡策略 + } + + var err error + conn, err := grpc.DialContext(ctx, targetAddr, opts...) + if err != nil { + return nil, err + } + + skillConn.Store(serverName, conn) + return conn, nil +} diff --git a/service/connect/music.go b/service/connect/music.go new file mode 100644 index 0000000..ba6399a --- /dev/null +++ b/service/connect/music.go @@ -0,0 +1,58 @@ +package connect + +import ( + "context" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "speech-nlu-parse/pkg/proto" + "time" +) + +const ( + MusicSpot = "music-spot" +) + +func MusicGrpc(params *model.SpeechDomainParams) (*proto.MusicSpotResponse, error) { + conn, err := GrpcConn(MusicSpot) + if err != nil { + global.Logger.Errorf("faild to connect: %v", err) + return nil, err + } + + ctx, cancel := context.WithTimeout(context.Background(), time.Second*2) + defer cancel() + + c := proto.NewMusicSpotClient(conn) + + req := &proto.MusicSpotRequest{ + AppInfo: &proto.MusicSpotRequest_AppInfo{ + RequestId: params.RequestId, + }, + DevInfo: &proto.MusicSpotRequest_DevInfo{ + Mac: params.Mac, + SubMac: "", + Mid: params.Mid, + Vender: params.MidType, + Hid: "", + HomeId: params.HomeId, + UserId: "", + }, + Data: &proto.MusicSpotRequest_Data{ + Query: params.Query, + }, + } + + resp, err := c.GetMusicList(ctx, req) + if err != nil { + global.Logger.Errorf("MusicGrpc error: %v", err) + return nil, err + } + global.Logger.WithFields(logger.Fields{ + "MusicGrpc serverName": MusicSpot, + "MusicGrpc request": req, + "MusicGrpc response": resp, + }).Info("MusicGrpc") + + return resp, nil +} diff --git a/service/iot/dev_cmd.go b/service/iot/dev_cmd.go new file mode 100644 index 0000000..a0e06d1 --- /dev/null +++ b/service/iot/dev_cmd.go @@ -0,0 +1,74 @@ +package iot + +import ( + "errors" + "time" + + "speech-nlu-parse/global" + "speech-nlu-parse/pkg/logger" + + "github.com/parnurzeal/gorequest" +) + +// TODO 在使用前,请在结构体struct中手动添加 json 注解 +// 有注释的地方为json注解的固定内容,其他为默认内容 + +var cmdUrl = global.InternalRemoteSetting.IOT.IotHost + global.InternalRemoteSetting.IOT.SendDevCmd + +// 控制命令请求数据 +type _devCmd struct { + Mac string + SubID string //subId + Opt []string + P []interface{} + Cid string +} + +// 设备响应参数 +type devResponse struct { + R int + T string + Msg string + Opt []string + P []interface{} +} + +// 控制命令下发 +func HandleDevCmd(mac string, params map[string]interface{}) error { + opt := make([]string, 0) + p := make([]interface{}, 0) + for k, v := range params { + opt = append(opt, k) + p = append(p, v) + } + + devCmd := _devCmd{ + Mac: mac, + Cid: "app", + Opt: opt, + P: p, + } + + //fmt.Printf("devCmd:%+v\n", devCmd) + + var dr devResponse + + req := gorequest.New().Timeout(3 * time.Second) + _, body, errs := req.Post(cmdUrl).Send(devCmd).EndStruct(&dr) + if len(errs) > 0 { + global.Logger.Errorf("get device command interface error: %v", errs) + return errs[0] + } + + global.Logger.WithFields(logger.Fields{ + "sendBody": devCmd, + "recvRawBody": string(body), + "recvBody": dr, + }).Debugf("success") + + if dr.R != 200 { + return errors.New(dr.Msg) + } + + return nil +} diff --git a/service/iot/dev_pack.go b/service/iot/dev_pack.go new file mode 100644 index 0000000..6e2102d --- /dev/null +++ b/service/iot/dev_pack.go @@ -0,0 +1,89 @@ +package iot + +import ( + "errors" + "fmt" + "time" + + "speech-nlu-parse/global" + "speech-nlu-parse/pkg/util" + + jsoniter "github.com/json-iterator/go" + "github.com/parnurzeal/gorequest" +) + +// TODO 在使用前,请在结构体struct中手动添加 json 注解 +// 有注释的地方为json注解的固定内容,其他为默认内容 + +var json = jsoniter.ConfigCompatibleWithStandardLibrary +var packUrl = global.InternalRemoteSetting.IOT.IotHost + global.InternalRemoteSetting.IOT.SendDevPack + +// 设备状态请求数据 +type devStatus struct { + Mac string + PackStr string //packStr +} + +// 解密后的数据格式 +type decryptData struct { + R int + Msg string + T string + Mac string + Cols []string + Dat []interface{} +} + +// 获取设备状态 +func GetDevStatus(mac, key string, fields []string) (map[string]interface{}, error) { + ec1 := struct { // TODO 此处也需要增加json注解 + T string + Cols []string + }{ + T: "status", + Cols: fields, + } + encryptContent, err := json.Marshal(&ec1) + if err != nil { + return nil, err + } + pack, err := util.EncryptAESByECB(encryptContent, key) + if err != nil { + return nil, err + } + packStr := fmt.Sprintf("{\"t\": \"pack\", \"i\": 0, \"uid\": 0, \"cid\": \"app\", \"tcid\": \"%v\", \"pack\": \"%v\"}", mac, pack) + ds := devStatus{Mac: mac, PackStr: packStr} + + req := gorequest.New().Timeout(3 * time.Second) + _, body, errs := req.Post(packUrl).Send(ds).EndBytes() + if len(errs) > 0 { + global.Logger.Errorf("get device status information interface error: %v", errs) + return nil, err + } + + r := json.Get(body, "r").ToString() + if r != "200" && r != "" { + global.Logger.Errorf("r is no 200, mac=%v, msg=%v", mac, json.Get(body, "msg").ToString()) + return nil, errors.New(json.Get(body, "msg").ToString()) + } + + pack = json.Get(body, "pack").ToString() + + decryptDataByte, err := util.DecryptAESByECB(pack, key) + if err != nil { + return nil, err + } + + global.Logger.Debugf("decryptData: %v", string(decryptDataByte)) + + var dD decryptData + err = json.Unmarshal(decryptDataByte, &dD) + if err != nil { + return nil, err + } + stat := make(map[string]interface{}) + for i, v := range dD.Cols { + stat[v] = dD.Dat[i] + } + return stat, nil +} diff --git a/service/service.go b/service/service.go new file mode 100644 index 0000000..6b186f5 --- /dev/null +++ b/service/service.go @@ -0,0 +1,782 @@ +package service + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "github.com/gorilla/websocket" + "github.com/tidwall/gjson" + "google.golang.org/grpc/metadata" + "io" + "net" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/errCode" + "speech-nlu-parse/pkg/logger" + "speech-nlu-parse/pkg/proto" + "speech-nlu-parse/service/speechNlu" + "speech-nlu-parse/service/tencentNlu" +) + +type TencentNlu struct{} + +//func (this TencentNlu) TencentNluParse(ctx context.Context, r *proto.SemanticRequest) (*proto.SemanticResponse, error) { +// requestBody, _ := json.Marshal(r) +// global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"requestBody": string(requestBody), "query": r.GetQuery()}, "mac": r.GetMacWifi(), "mid": r.GetMid(), "vender": r.GetVender(), "requestId": r.RequestId}).Info("tencent-nlu-parse-grpc request") +// semanticReq := TencentNluParseSemanticRequest2ModelSemanticReq(r) +// +// jsonStr, code := tencentNlu.TencentNlu(semanticReq) +// responseText := gjson.Get(jsonStr, "response_text").String() +// response := &proto.SemanticResponse{Status: &proto.Status{Code: code.Code(), Msg: code.Msg()}, Data: &proto.SemanticData{SemanticRespJsonData: jsonStr}} +// responseBody, _ := json.Marshal(response) +// defer global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"responseBody": string(responseBody), "query": r.GetQuery(), "responseText": responseText}, "mac": r.GetMacWifi(), "mid": r.GetMid(), "vender": r.GetVender(), "requestId": r.RequestId}).Info("tencent-nlu-parse-grpc response") +// return response, nil +//} +// +//func (TencentNlu) TencentNluParseStream(stream proto.TencentNlu_TencentNluParseStreamServer) error { +// ctx := stream.Context() +// md, ok := metadata.FromIncomingContext(stream.Context()) +// if !ok { +// global.Logger.Errorf("获取metadata失败:%v", md) +// return nil +// } +// tMetaData, err := GetSemanticReq(md) +// if err != nil { +// global.Logger.Errorf("获取metadata失败:%v", md) +// return err +// } +// if tMetaData == nil { +// global.Logger.Errorf("获取metadata失败:%v", md) +// return nil +// } +// sessionId := tMetaData.SessionId +// vender := tMetaData.Vender +// var appKey, accessToken, auth, dsn, qua, requestId, mid, mac, midType, homeId string +// qua = "QV=3&PL=ADR&PR=chvoice&VE=7.6&VN=3350&PP=com.geli.mtt&DE=SPEAKER&SP=3" +// requestId = tMetaData.RequestId +// mid = tMetaData.Mid +// mac = tMetaData.MacWifi +// midType = tMetaData.Vender +// homeId = tMetaData.HomeId +// // 查询key和secret +// dingDangBot, ok := global.DingDangBot.Get(tMetaData.Mid, tMetaData.Vender) +// if ok { +// appKey = dingDangBot.Key +// accessToken = dingDangBot.Secret +// } +// +// if tMetaData.Exist { +// appKey = tMetaData.Appkey +// accessToken = tMetaData.AccessToken +// auth = tMetaData.Auth +// dsn = tMetaData.Dsn +// qua = tMetaData.Qua +// } else { +// // 没有携带鉴权信息, 查dmsdk +// var tokenSearchResponse *model.TokenSearchResponse +// tokenSearchResponse, err = tencentNlu.GetAuthorizationByGRPC(tMetaData.MacWifi, tMetaData.RequestId, mid, tMetaData.Vender) +// if err != nil { +// global.Logger.WithFields(logger.Fields{ +// "data": map[string]interface{}{"data.MacWifi": tMetaData.MacWifi}, +// "requestId": tMetaData.RequestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Error("GetTencentNLUData: GetAuthorizationByGRPC error." + err.Error()) +// } else { +// if tokenSearchResponse.Status.Code == 200 { +// // 200: 成功; 405: 设备未激活 +// if tokenSearchResponse.Data.Status != 0 { // 未分配 的情况下无AppKey AccessToken +// if tokenSearchResponse.Data.AppKey != "" && tokenSearchResponse.Data.AccessToken != "" { +// appKey = tokenSearchResponse.Data.AppKey +// accessToken = tokenSearchResponse.Data.AccessToken +// } +// } +// if tokenSearchResponse.Data.Status == 2 { // 已授权,使用中 +// auth = tokenSearchResponse.Data.Authorization +// dsn = tokenSearchResponse.Data.Dsn +// } +// if tokenSearchResponse.Data.HomeId != "" { +// homeId = tokenSearchResponse.Data.HomeId +// } +// } else if tokenSearchResponse.Status.Code == 405 { // 未分配 +// // +// } else { // 错误码 +// global.Logger.WithFields(logger.Fields{ +// "data": map[string]interface{}{"tokenSearchResponse": tokenSearchResponse}, +// "requestId": tMetaData.RequestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Error("GetTencentNLUData: GetAuthorizationByGRPC error." + tokenSearchResponse.Status.Msg) +// } +// } +// } +// +// // 特殊处理, tencentllmtest001 将使用特殊的bot, 重新配网后会失效 +// // if mac == "tencentllmtest001" { +// // auth = "BACKEND-ENCRYPT:1000,MTAsMTAxNjk4MjcxNTIwNTAyOTg4OCw0MUNFM0QyMjRGNTcyMjg3NTA0NjcxRkEyMEI3ODc5NFlYV1YwLGFfYzg2ODI3M2ZlNjgwMGJhNTcwMzFlMGZjZDE4MjEzZjA4Mjg0ZTM0MixhNTllOTRiMDUyYWMxMWVlYWZmYWUzMTUwYzg5NDViMjphNTQ0ZDliOTY1OGE0NTkxODM0Y2Y5YzExMmRkYWY2MSx0ZXN0N2QzNTMyNmY4N2JjNDE2MTg1MmQ2Mzk2ZjFhMGVhMDQsNDFDRTNEMjI0RjU3MjI4NzUwNDY3MUZBMjBCNzg3OTRZWFdWMA==" +// // dsn = "test7d35326f87bc4161852d6396f1a0ea04" +// // appKey = "a544d9b9658a4591834cf9c112ddaf61" +// // accessToken = "a59e94b052ac11eeaffae3150c8945b2" +// // } +// +// tencentNluWs := tencentNlu.TencentNlpWs{ +// AppKey: appKey, +// AccessToken: accessToken, +// Auth: auth, +// Dsn: dsn, +// Qua: qua, +// HomeId: homeId, +// } +// var nlpWsConn *websocket.Conn +// nlpWsConn, err = tencentNluWs.GetTencentDialogHandler(appKey, accessToken, tMetaData.TRequestId, tMetaData.Ip, auth, dsn) +// if err != nil { +// global.Logger.Errorf("TencentNluParseStream GetTencentDialogHandler error. %v", err) +// return err +// } +// tencentNluWs.NlpWsConn = nlpWsConn +// defer nlpWsConn.Close() +// +// cancelCtx, cancel := context.WithCancel(context.Background()) +// +// // 监听腾讯 +// go func() { +// defer func() { +// if err := recover(); err != nil { +// global.Logger.WithFields(logger.Fields{ +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Errorf("err:%v", err) +// nlpWsConn.Close() +// cancel() +// return +// } +// }() +// for { +// select { +// case <-cancelCtx.Done(): +// nlpWsConn.Close() +// return +// default: +// data, err := tencentNluWs.Recv() +// if err != nil { +// if websocket.IsCloseError(err, websocket.CloseAbnormalClosure) || errors.Is(err, net.ErrClosed) { +// // 服务端关闭及客户端关闭的错误捕获 +// global.Logger.WithFields(logger.Fields{ +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Info("TencentNluParseStream websocket closed.") +// } else { +// global.Logger.WithFields(logger.Fields{ +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Errorf("TencentNluParseStream tencentNluWs.Recv error. %v", err) +// } +// nlpWsConn.Close() +// cancel() +// return +// } +// global.Logger.WithFields(logger.Fields{ +// "data": map[string]interface{}{"tencentNluParseStreamBody": string(data)}, +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Info("TencentNluParseStream tencentNluWs.Recv.") +// // 解析 +// // tencentNluWs := tencentNlu.TencentNlpWs{} +// res := tencentNluWs.ParseTNluData(data, mid, midType, requestId, sessionId, mac) +// if len(res) == 0 { +// // res 为空, 表示不需要返回 +// continue +// } +// +// code := errCode.Success +// resp := &proto.SemanticResponse{Status: &proto.Status{Code: code.Code(), Msg: code.Msg()}, Data: &proto.SemanticData{SemanticRespJsonData: string(res)}} +// stream.Send(resp) +// responseText := gjson.GetBytes(res, "response_text").String() +// responseBody, _ := json.Marshal(resp) +// global.Logger.WithFields(logger.Fields{ +// "data": map[string]interface{}{ +// "tencentNluParseStreamBody": string(responseBody), +// "responseText": responseText, +// }, +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Info("TencentNluParseStream stream.Send.") +// responseType := gjson.GetBytes(res, "header.semantic.ResponseType").String() +// if responseType == "semantic.close" { +// nlpWsConn.Close() +// cancel() +// return +// } +// } +// } +// }() +// +// // 不主动关闭连接 +// for { +// data, err := stream.Recv() +// if err != nil { +// if errors.Is(ctx.Err(), context.Canceled) { +// // 客户端取消 +// global.Logger.WithFields(logger.Fields{ +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Info("TencentNluParseStream stream is canceled.") +// cancel() +// return nil +// } +// +// if err == io.EOF { +// global.Logger.WithFields(logger.Fields{ +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Info("TencentNluParseStream stream closed.") +// // 客户端关闭 +// } else { +// global.Logger.WithFields(logger.Fields{ +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Errorf("TencentNluParseStream stream.Recv error. %v", err) +// } +// cancel() +// return nil +// } +// requestBody, _ := json.Marshal(data) +// global.Logger.WithFields(logger.Fields{ +// "data": map[string]interface{}{ +// "tencentNluParseStreamBody": string(requestBody), +// "query": data.Query, +// }, +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Info("TencentNluParseStream stream.Recv.") +// select { +// case <-cancelCtx.Done(): +// // 腾讯 ws 关闭了 +// return nil +// default: +// selfSemanticReq := TencentNluParseSemanticRequest2ModelSemanticReq(data) +// req := tencentNlu.TansTencentNlpWsReq(appKey, dsn, qua, auth, selfSemanticReq) +// tencentNluWs.Send(req) +// tRequestBody, _ := json.Marshal(data) +// global.Logger.WithFields(logger.Fields{ +// "data": map[string]interface{}{ +// "tencentNluParseStreamBody": string(tRequestBody), +// "query": data.Query, +// }, +// "requestId": requestId, +// "mac": mac, +// "mid": mid, +// "vender": vender, +// "sessionId": sessionId, +// }).Info("TencentNluParseStream tencentNluWs.Send.") +// } +// } +//} + +func TencentNluParseSemanticRequest2ModelSemanticReq(tencentNluParseSemanticRequest *proto.SemanticRequest) *model.SemanticReq { + if tencentNluParseSemanticRequest == nil { + return nil + } + var lbs *model.Lbs + if tencentNluParseSemanticRequest.GetLbs() == nil { + lbs = nil + } else { + lbs = &model.Lbs{ + Longitude: tencentNluParseSemanticRequest.GetLbs().GetLongitude(), + Latitude: tencentNluParseSemanticRequest.GetLbs().GetLatitude(), + } + } + var addressInfo *model.AddressInfo + if tencentNluParseSemanticRequest.GetAddressInfo() == nil { + addressInfo = &model.AddressInfo{} + } else { + addressInfo = &model.AddressInfo{ + Province: tencentNluParseSemanticRequest.GetAddressInfo().GetProvince(), + City: tencentNluParseSemanticRequest.GetAddressInfo().GetCity(), + County: tencentNluParseSemanticRequest.GetAddressInfo().GetCounty(), + } + } + + var semanticReqNativateData *model.SemanticReqNativeData + if tencentNluParseSemanticRequest.GetNative().GetData() == nil { + semanticReqNativateData = nil + } else { + semanticReqNativateData = &model.SemanticReqNativeData{ + // TODO: Native API协议数据, 由云端和客户端一起定义 + } + } + + var native *model.SemanticReqNative + if tencentNluParseSemanticRequest.GetNative() == nil { + native = nil + } else { + native = &model.SemanticReqNative{ + Name: tencentNluParseSemanticRequest.GetNative().GetName(), + SeqID: tencentNluParseSemanticRequest.GetNative().GetSeqID(), + Code: int(tencentNluParseSemanticRequest.GetNative().GetCode()), + Message: tencentNluParseSemanticRequest.GetNative().GetMessage(), + DataVersion: tencentNluParseSemanticRequest.GetNative().GetDataVersion(), + Data: semanticReqNativateData, + } + } + + var sdkExtend *model.SemanticReqSDKExtend + if tencentNluParseSemanticRequest.GetSdkExtend() == nil { + sdkExtend = nil + } else { + sdkExtend = &model.SemanticReqSDKExtend{ + CarDOA: int(tencentNluParseSemanticRequest.GetSdkExtend().GetCarDOA()), + LastRspType: tencentNluParseSemanticRequest.GetSdkExtend().GetLastRspType(), + LastRspResult: tencentNluParseSemanticRequest.GetSdkExtend().GetLastRspResult(), + LastSessionStatus: int(tencentNluParseSemanticRequest.GetSdkExtend().GetLastSessionStatus()), + LastCompleteCmdResult: tencentNluParseSemanticRequest.GetSdkExtend().GetLastCompleteCmdResult(), + } + } + + semanticReq := &model.SemanticReq{ + MacWifi: tencentNluParseSemanticRequest.MacWifi, + MacVoice: tencentNluParseSemanticRequest.MacVoice, + Query: tencentNluParseSemanticRequest.Query, + Ip: tencentNluParseSemanticRequest.Ip, + TestID: tencentNluParseSemanticRequest.TestID, + OriginQuery: tencentNluParseSemanticRequest.OriginQuery, + Mid: tencentNluParseSemanticRequest.Mid, + RequestId: tencentNluParseSemanticRequest.RequestId, + Lbs: lbs, + Vender: tencentNluParseSemanticRequest.GetVender(), + Appkey: tencentNluParseSemanticRequest.GetAppKey(), + AccessToken: tencentNluParseSemanticRequest.GetAccessToken(), + Qua: tencentNluParseSemanticRequest.GetQua(), + Auth: tencentNluParseSemanticRequest.GetAuth(), + Dsn: tencentNluParseSemanticRequest.GetDsn(), + Guid: tencentNluParseSemanticRequest.GetGuid(), + Exist: tencentNluParseSemanticRequest.GetExist(), + TRequestId: tencentNluParseSemanticRequest.GetTRequestId(), + RequestType: tencentNluParseSemanticRequest.GetRequestType(), + CommType: tencentNluParseSemanticRequest.GetCommType(), + CharacterID: tencentNluParseSemanticRequest.GetCharacterID(), + Event: tencentNluParseSemanticRequest.GetEvent(), + Nativate: native, + SDKExtend: sdkExtend, + AddressInfo: addressInfo, + Language: tencentNluParseSemanticRequest.GetLanguage(), + } + + return semanticReq +} + +/* + { + "macwifi":"8812ac3333f0", + "ip":"120.198.22.24", + "mid":"70601", + "requestid":"81e61c5f-d909-11ed-a4b5-02420a0a7d8a", + "vender":"01", + "appkey":"9756a52091cb11ed8ac31111cf5d8985", + "accesstoken":"853c1d62325346f18c0dac6f40e1128f", + "qua":"QV=3\u0026VN=MC-VTSBH02V1.0\u0026DE=CENTRALCONTROL\u0026BD=70601_01\u0026VC=GREE\u0026PL=LINUX", + "auth":"BACKEND-ENCRYPT:1000,MTAsMTAxNjk4MjcxNTIwNTAyOTg4OCxBNTJEMTVBREE3RUIxRDhBOEFGOTA0QUQ2NDU0REM1MllYV1YwLGFfOGFiY2Q5OWNiMzk4MGVhMDg3MzkxMDc5NWFkMzdlOWQ2NTQ0ZWYwZSw5NzU2YTUyMDkxY2IxMWVkOGFjMzExMTFjZjVkODk4NTo4NTNjMWQ2MjMyNTM0NmYxOGMwZGFjNmY0MGUxMTI4ZixHUkVFX1NtYXJ0X1NjcmVlbl8wMDYsQTUyRDE1QURBN0VCMUQ4QThBRjkwNEFENjQ1NERDNTJZWFdWMA==", + "dsn":"GREE_Smart_Screen_006", + "exist":"1", + "trequestid":"gzde4c62b816812695777577573" + } +*/ +func GetSemanticReq(md map[string][]string) (*model.TencentNluParseStreamMetaData, error) { + var metaData model.TencentNluParseStreamMetaData + + if macWifi, ok := md["macwifi"]; ok { + metaData.MacWifi = macWifi[0] + } else { + global.Logger.Error("metadata macwifi not found.") + return nil, errors.New("metadata macwifi not found.") + } + if ip, ok := md["ip"]; ok { + metaData.Ip = ip[0] + } else { + global.Logger.Error("metadata ip not found.") + return nil, errors.New("metadata ip not found.") + } + if mid, ok := md["mid"]; ok { + metaData.Mid = mid[0] + } else { + global.Logger.Error("metadata mid not found.") + return nil, errors.New("metadata mid not found.") + } + if requestId, ok := md["requestid"]; ok { + metaData.RequestId = requestId[0] + } else { + global.Logger.Error("metadata requestid not found.") + return nil, errors.New("metadata requestid not found.") + } + if vender, ok := md["vender"]; ok { + metaData.Vender = vender[0] + } else { + global.Logger.Error("metadata vender not found.") + return nil, errors.New("metadata vender not found.") + } + if appkey, ok := md["appkey"]; ok { + metaData.Appkey = appkey[0] + } else { + global.Logger.Error("metadata appkey not found.") + return nil, errors.New("metadata appkey not found.") + } + if accessToken, ok := md["accesstoken"]; ok { + metaData.AccessToken = accessToken[0] + } else { + global.Logger.Error("metadata accesstoken not found.") + return nil, errors.New("metadata accesstoken not found.") + } + if qua, ok := md["qua"]; ok { + metaData.Qua = qua[0] + } else { + global.Logger.Error("metadata qua not found.") + return nil, errors.New("metadata qua not found.") + } + if auth, ok := md["auth"]; ok { + metaData.Auth = auth[0] + } else { + global.Logger.Error("metadata qua not found.") + return nil, errors.New("metadata qua not found.") + } + if dsn, ok := md["dsn"]; ok { + metaData.Dsn = dsn[0] + } else { + global.Logger.Error("metadata qua not found.") + return nil, errors.New("metadata qua not found.") + } + if exist, ok := md["exist"]; ok { + metaData.Exist = exist[0] == "1" + } else { + global.Logger.Error("metadata exist not found.") + return nil, errors.New("metadata exist not found.") + } + if tRequestId, ok := md["trequestid"]; ok { + metaData.TRequestId = tRequestId[0] + } else { + global.Logger.Error("metadata trequestid not found.") + return nil, errors.New("metadata trequestid not found.") + } + if sessionId, ok := md["sessionid"]; ok { + metaData.SessionId = sessionId[0] + } else { + global.Logger.Error("metadata trequestid not found.") + return nil, errors.New("metadata trequestid not found.") + } + if homeId, ok := md["home_id"]; ok { + metaData.HomeId = homeId[0] + } else { + global.Logger.Error("metadata homeId not found.") + // return nil, errors.New("metadata homeId not found.") + } + + return &metaData, nil +} + +func (this TencentNlu) TencentNluParse(ctx context.Context, r *proto.SemanticRequest) (*proto.SemanticResponse, error) { + requestBody, _ := json.Marshal(r) + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"requestBody": string(requestBody), "query": r.GetQuery()}, "mac": r.GetMacWifi(), "mid": r.GetMid(), "vender": r.GetVender(), "requestId": r.RequestId}).Info("tencent-nlu-parse-grpc request") + semanticReq := TencentNluParseSemanticRequest2ModelSemanticReq(r) + fmt.Println(semanticReq) + + jsonStr, code := speechNlu.SpeechNlu(semanticReq) + responseText := gjson.Get(jsonStr, "response_text").String() + response := &proto.SemanticResponse{Status: &proto.Status{Code: code.Code(), Msg: code.Msg()}, Data: &proto.SemanticData{SemanticRespJsonData: jsonStr}} + responseBody, _ := json.Marshal(response) + defer global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"responseBody": string(responseBody), "query": r.GetQuery(), "responseText": responseText}, "mac": r.GetMacWifi(), "mid": r.GetMid(), "vender": r.GetVender(), "requestId": r.RequestId}).Info("tencent-nlu-parse-grpc response") + return response, nil +} + +func (TencentNlu) TencentNluParseStream(stream proto.TencentNlu_TencentNluParseStreamServer) error { + ctx := stream.Context() + md, ok := metadata.FromIncomingContext(stream.Context()) + if !ok { + global.Logger.Errorf("获取metadata失败:%v", md) + return nil + } + tMetaData, err := GetSemanticReq(md) + if err != nil { + global.Logger.Errorf("获取metadata失败:%v", md) + return err + } + if tMetaData == nil { + global.Logger.Errorf("获取metadata失败:%v", md) + return nil + } + sessionId := tMetaData.SessionId + vender := tMetaData.Vender + var appKey, auth, dsn, qua, requestId, mid, mac string + qua = "QV=3&PL=ADR&PR=chvoice&VE=7.6&VN=3350&PP=com.geli.mtt&DE=SPEAKER&SP=3" + requestId = tMetaData.RequestId + mid = tMetaData.Mid + mac = tMetaData.MacWifi + // 查询key和secret + //dingDangBot, ok := global.DingDangBot.Get(tMetaData.Mid, tMetaData.Vender) + //if ok { + // appKey = dingDangBot.Key + // accessToken = dingDangBot.Secret + //} + + //if tMetaData.Exist { + // appKey = tMetaData.Appkey + // accessToken = tMetaData.AccessToken + // auth = tMetaData.Auth + // dsn = tMetaData.Dsn + // qua = tMetaData.Qua + //} else { + // // 没有携带鉴权信息, 查dmsdk + // var tokenSearchResponse *model.TokenSearchResponse + // tokenSearchResponse, err = tencentNlu.GetAuthorizationByGRPC(tMetaData.MacWifi, tMetaData.RequestId, mid, tMetaData.Vender) + // if err != nil { + // global.Logger.WithFields(logger.Fields{ + // "data": map[string]interface{}{"data.MacWifi": tMetaData.MacWifi}, + // "requestId": tMetaData.RequestId, + // "mac": mac, + // "mid": mid, + // "vender": vender, + // "sessionId": sessionId, + // }).Error("GetTencentNLUData: GetAuthorizationByGRPC error." + err.Error()) + // } else { + // if tokenSearchResponse.Status.Code == 200 { + // // 200: 成功; 405: 设备未激活 + // if tokenSearchResponse.Data.Status != 0 { // 未分配 的情况下无AppKey AccessToken + // if tokenSearchResponse.Data.AppKey != "" && tokenSearchResponse.Data.AccessToken != "" { + // appKey = tokenSearchResponse.Data.AppKey + // accessToken = tokenSearchResponse.Data.AccessToken + // } + // } + // if tokenSearchResponse.Data.Status == 2 { // 已授权,使用中 + // auth = tokenSearchResponse.Data.Authorization + // dsn = tokenSearchResponse.Data.Dsn + // } + // if tokenSearchResponse.Data.HomeId != "" { + // homeId = tokenSearchResponse.Data.HomeId + // } + // } else if tokenSearchResponse.Status.Code == 405 { // 未分配 + // // + // } else { // 错误码 + // global.Logger.WithFields(logger.Fields{ + // "data": map[string]interface{}{"tokenSearchResponse": tokenSearchResponse}, + // "requestId": tMetaData.RequestId, + // "mac": mac, + // "mid": mid, + // "vender": vender, + // "sessionId": sessionId, + // }).Error("GetTencentNLUData: GetAuthorizationByGRPC error." + tokenSearchResponse.Status.Msg) + // } + // } + //} + + // 特殊处理, tencentllmtest001 将使用特殊的bot, 重新配网后会失效 + // if mac == "tencentllmtest001" { + // auth = "BACKEND-ENCRYPT:1000,MTAsMTAxNjk4MjcxNTIwNTAyOTg4OCw0MUNFM0QyMjRGNTcyMjg3NTA0NjcxRkEyMEI3ODc5NFlYV1YwLGFfYzg2ODI3M2ZlNjgwMGJhNTcwMzFlMGZjZDE4MjEzZjA4Mjg0ZTM0MixhNTllOTRiMDUyYWMxMWVlYWZmYWUzMTUwYzg5NDViMjphNTQ0ZDliOTY1OGE0NTkxODM0Y2Y5YzExMmRkYWY2MSx0ZXN0N2QzNTMyNmY4N2JjNDE2MTg1MmQ2Mzk2ZjFhMGVhMDQsNDFDRTNEMjI0RjU3MjI4NzUwNDY3MUZBMjBCNzg3OTRZWFdWMA==" + // dsn = "test7d35326f87bc4161852d6396f1a0ea04" + // appKey = "a544d9b9658a4591834cf9c112ddaf61" + // accessToken = "a59e94b052ac11eeaffae3150c8945b2" + // } + + speechNluWs := speechNlu.SpeechNlpWs{} + var nlpWsConn *websocket.Conn + + nlpWsConn, err = speechNluWs.SpeechWs() + if err != nil { + global.Logger.Errorf("speechWs.SpeechWs error. %v", err) + return err + } + speechNluWs.NlpWsConn = nlpWsConn + defer nlpWsConn.Close() + + cancelCtx, cancel := context.WithCancel(context.Background()) + + // 监听腾讯 + go func() { + defer func() { + if err := recover(); err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Errorf("err:%v", err) + nlpWsConn.Close() + cancel() + return + } + }() + for { + select { + case <-cancelCtx.Done(): + nlpWsConn.Close() + return + default: + data, err := speechNluWs.Recv() + if err != nil { + if websocket.IsCloseError(err, websocket.CloseAbnormalClosure) || errors.Is(err, net.ErrClosed) { + // 服务端关闭及客户端关闭的错误捕获 + global.Logger.WithFields(logger.Fields{ + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNluParseStream websocket closed.") + } else { + global.Logger.WithFields(logger.Fields{ + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Errorf("TencentNluParseStream tencentNluWs.Recv error. %v", err) + } + nlpWsConn.Close() + cancel() + return + } + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"tencentNluParseStreamBody": string(data)}, + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNluParseStream tencentNluWs.Recv.") + // 解析 + // tencentNluWs := tencentNlu.TencentNlpWs{} + res := speechNluWs.ParseSpeechNluData(data, requestId, sessionId) + if len(res) == 0 { + // res 为空, 表示不需要返回 + continue + } + + code := errCode.Success + resp := &proto.SemanticResponse{Status: &proto.Status{Code: code.Code(), Msg: code.Msg()}, Data: &proto.SemanticData{SemanticRespJsonData: string(res)}} + stream.Send(resp) + responseText := gjson.GetBytes(res, "response_text").String() + responseBody, _ := json.Marshal(resp) + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{ + "tencentNluParseStreamBody": string(responseBody), + "responseText": responseText, + }, + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNluParseStream stream.Send.") + responseType := gjson.GetBytes(res, "header.semantic.ResponseType").String() + if responseType == "semantic.close" { + nlpWsConn.Close() + cancel() + return + } + } + } + }() + + // 不主动关闭连接 + for { + data, err := stream.Recv() + if err != nil { + if errors.Is(ctx.Err(), context.Canceled) { + // 客户端取消 + global.Logger.WithFields(logger.Fields{ + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNluParseStream stream is canceled.") + cancel() + return nil + } + + if err == io.EOF { + global.Logger.WithFields(logger.Fields{ + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNluParseStream stream closed.") + // 客户端关闭 + } else { + global.Logger.WithFields(logger.Fields{ + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Errorf("TencentNluParseStream stream.Recv error. %v", err) + } + cancel() + return nil + } + requestBody, _ := json.Marshal(data) + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{ + "tencentNluParseStreamBody": string(requestBody), + "query": data.Query, + }, + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNluParseStream stream.Recv.") + select { + case <-cancelCtx.Done(): + // 腾讯 ws 关闭了 + return nil + default: + selfSemanticReq := TencentNluParseSemanticRequest2ModelSemanticReq(data) + req := tencentNlu.TansTencentNlpWsReq(appKey, dsn, qua, auth, selfSemanticReq) + speechNluWs.Send(req) + tRequestBody, _ := json.Marshal(data) + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{ + "tencentNluParseStreamBody": string(tRequestBody), + "query": data.Query, + }, + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNluParseStream tencentNluWs.Send.") + } + } +} diff --git a/service/speechNlu/constant.go b/service/speechNlu/constant.go new file mode 100644 index 0000000..f8e911c --- /dev/null +++ b/service/speechNlu/constant.go @@ -0,0 +1,155 @@ +package speechNlu + +const ( + //腾讯返回listItems为空时的兜底话术 + //eply_when_request_tencent_error = "" //腾讯接口异常时 + reply_when_control_nonresponse = "当前网络不稳定,请稍后再试吧" + alarm_remind_common = "时间到了,记得" + unisound_request_error = "unisound_request: " + tencent_response_error = "tencent_response: " + gree_nlu_err = "gree_nlu: " + tencent_nlu_err = "tencent_nlu: " + datetimeLayout = "2006-01-02 15:04:05" + dateLayout = "2006-01-02" + //speech_type = "0" //终端闹钟提醒方式 + chatDomainStr = "chat" //chat other +) + +const ( + errorLogfile = "logfile/ctoc/error/unisoundCtoC_Errorlogfile_" + tencentLogFile = "logfile/ctoc/tencentnlu/tencentnlu_ctoc_logfile_" +) + +const ( + onlyTTS = "0" + onlyRing = "1" + Mixed = "2" + defaultRing = "3" + timeoutCount = 10 //设置两小时内的超时总数量 + timeoutTime = 3 //设置接口三秒超时 + timeoutPercent = 0.1 //设置超时请求数比例阈值 10% +) + +const ( + alarm = "0" + remind = "1" + countdown = "2" +) + +const ( + once = "1" + everyDay = "2" + everyWeek = "3" + everyMonth = "4" + everyWorkDay = "5" + holiday = "6" +) + +const ( + //devDB = "de_records_ctocst" //空调聊天记录数据表 + devDB = "de_ctoclog_st" + //devDB = "de_records" + asDB = "as_records" //语音助手聊条记录数据表 + arDB = "alarm_remind" //闹钟数据表 + notsupportTB = "greenlu_notsupport" //格力NLU不支持的语句 + errorLog = "ctoc_errorlog" + greenlu_semantic = "ctoc_greenlu_semantic" + tencent_senmantic = "ctoc_tencent_semantic_log" + control_semantic = "ctoc_control_semantic" + skillUseDB = "ctoc_skill_user_like" + homeinfoDB = "de_homeinfo_conn" + ctoc_req_ala = "ctoc_req_ala" +) + +// 腾讯技能的Domain +const ( + WEATHER = "天气" + JOKE = "笑话" + CHAT = "闲聊全库" + CALENDAR = "日历" + + NEWS = "新闻" + ANCIENTPOEM = "诗词" + SPORTS = "sports" + ASTRO = "星座" + STOCK = "stock" + TRANSLATE = "翻译大全" + ALARM = "提醒" + SCIENCE = "计算器" + CHENGYU = "成语" + BAIKE = "百科" + FM = "网络电台" + CHILDMUSIC = "儿歌" + GLOBALCTRL = "中控" + PlayCTRL = "播放控制" + MUSIC = "音乐" + HELP = "产品形象" + HOLIDAY = "holiday" + + SOUND = "sound" + ALMANAC = "almanac" + FINANCE = "finance" + FOOD = "food" + GENERALQA = "general_question_answering" + COMMONQA = "common_qa" + + RECIPE = "recipe" + HISTORY = "history" + + GEOGRAPHY = "geography" + + REMINDERV2 = "reminder_v2" + XIAOLIAO = "xianliao-1073423540231241728" + CITYINFO = "cityinfo" + WORLDRECORDS = "world_records" + HTWHYS = "htwhys" + DISEASE = "disease" + GARBAGECLASS = "garbage_class" + YIQINGWENDA = "yiqingwenda-1223872807159873536" + + INVENTIONQAPAIRS = "invention_qa_pairs" + PLANTS_KBQA = "plants_kbqa" + MEDIACTRL = "mediactrl3" + DEFAULT = "default" + VOLUMECTRL3 = "volumectrl3" + SCREENCONTROL = "screen_control" + GLOBALCTRL3 = "globalctrl3" + MCHAT = "mchat" + WORLDRECORDSQAPAIRS = "world_records_qa_pairs" + + LLM = "llm" + GEOGRAPHYKBQA = "geography_kbqa" + GENERALQUESTIONANSWERING = "general_question_answering" + HTWHYS_QA_PAIRS = "htwhys_qa_pairs" + INVENTION_QA_PAIRS = "invention_qa_pairs" + XIANLIAO = "xianliao" + MUSIC_YUE = "music_yue" + WEATHER_YUE = "weather_yue" + JOKE_YUE = "joke_yue" + NEWS_YUE = "news_yue" + FM_YUE = "fm_yue" + TRANSLATE_YUE = "translate_yue" + SCIENCE_YUE = "science_yue" + SPORTS_YUE = "sports_yue" + ASTRO_YUE = "astro_yue" + HOLIDAY_YUE = "holiday_yue" + STOCK_YUE = "stock_yue" + HELP_YUE = "help_yue" + ANCIENT_POEM_YUE = "ancient_poem_yue" + CHENGYU_YUE = "chengyu_yue" + ALARM_YUE = "alarm_yue" + REMINDER_V2_YUE = "reminder_v2_yue" + SOUND_YUE = "sound_yue" + GLOBALCTRL3_YUE = "globalctrl3_yue" + MEDIACTRL3_YUE = "mediactrl3_yue" + VOLUMECTRL3_YUE = "volumectrl3_yue" + ASTRONOMY_KBQA = "astronomy_kbqa" + COMMON_QA_QA_PAIRS = "common_qa_qa_pairs" + GLETKT_XLCJ_1245258905417052160 = "gletkt_xlcj-1245258905417052160" + CESHI_1149914105856290816 = "ceshi-1149914105856290816" + GELIYOUPINGKONGTIAO_1289106967398617088 = "geliyoupingkongtiao-1289106967398617088" + JHDPBXZSWD_1364089899207012352 = "jhdpbxzswd-1364089899207012352" + LXTEST_1697504067777118921 = "lxtest-1697504067777118921" + LXTEST_1697504245166677379 = "lxtest-1697504245166677379" + LCHAT_1736631343458063755 = "lchat-1736631343458063755" +) diff --git a/service/speechNlu/domain.go b/service/speechNlu/domain.go new file mode 100644 index 0000000..81abfa1 --- /dev/null +++ b/service/speechNlu/domain.go @@ -0,0 +1,741 @@ +package speechNlu + +import ( + "encoding/json" + "errors" + "fmt" + "regexp" + "speech-nlu-parse/dao" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "speech-nlu-parse/service/connect" + "strconv" + "strings" + "time" +) + +const ( + speech_nlu_parse = "speech_nlu_parse" +) + +//type DomainParams struct { +// SpeechWsResp *SpeechWsResp +// Query string +// RequestId string +// Mac string +// Domain string +// Mid string +// MidType string +// SessionId string +// HomeId string +// AppKey string +//} + +// 屏蔽处理 +func shieldedDomain() []byte { + // 暂不支持此功能 + resultTextStr := shielded_reply + return replyWithChat(resultTextStr, "chat.chat") +} + +func baseParse(params *model.SpeechDomainParams) (*model.ResponseBody, error) { + if !params.CheckDm() || !params.CheckWidget() { + return nil, errors.New("SpeechNlpResp check error.") + } + + var result model.ResponseBody + result.Header.Semantic.Code = 0 + //result.Header.Semantic.Domain = "joke" + //result.Header.Semantic.Intent = "tell" + result.Header.Semantic.Msg = speech_nlu_parse + result.Header.Semantic.SessionComplete = params.SpeechWsResp.Dm.ShouldEndSession //params.SpeechWsResp.Dm.ShouldEndSession + //result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent + result.ResponseText = params.SpeechWsResp.Dm.Nlg + result.AsrRecongize = params.SpeechWsResp.Dm.Input + + return &result, nil +} + +// 待更新带屏设备部分 +func weatherDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("weatherDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.SessionComplete = true + res.Header.Semantic.Domain = "weather" + res.Header.Semantic.Intent = "general_search" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + //todo:带屏设备的待改 + + return Marshal(params, res) +} + +// 假期 speech 返回是日历 +func calendarDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("calendarDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "holiday" + res.Header.Semantic.Intent = "search_dateDiff" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + return Marshal(params, res) +} + +func chatDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("chatDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + //res.Header.Semantic.SessionComplete = true + res.Header.Semantic.Domain = "chat" + res.Header.Semantic.Intent = "chat" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + return Marshal(params, res) +} + +// 目前无返回 +func newsDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("newsDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + return Marshal(params, res) +} + +func ancientpoemDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("ancientpoemDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "ancient_poem" + res.Header.Semantic.Intent = "search_tangshi" + + if params.SpeechWsResp.Dm.IntentName == "查询诗词释义" { + res.Header.Semantic.Intent = "search_ancientpoem_meaning" + res.ListItems = append(res.ListItems, map[string]interface{}{ + "content": params.SpeechWsResp.Dm.Widget.Extra.ContentTranslation, + "title": params.SpeechWsResp.Dm.Widget.Extra.Title, + "type": params.SpeechWsResp.Dm.Widget.Type, //原来是 TEXT,看看是否能播放 + "url": "", + "mediaId": "", + }) + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + return Marshal(params, res) + } + + res.ListItems = make([]map[string]interface{}, 0) + + sliceData, isSlice := params.SpeechWsResp.Dm.Widget.Content.([]interface{}) + if !isSlice { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("params.SpeechWsResp.Dm.Widget.Content不是数组类型") + return replyWithChat(error_reply, "doudi") + } else { + for _, item := range sliceData { + itemBytes, _ := json.Marshal(item) + var con model.Content + if err := json.Unmarshal(itemBytes, &con); err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Errorf("json.Unmarshal元素解析失败: %v", err) + return replyWithChat(error_reply, "doudi") + } + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": con.LinkUrl, + "title": con.Title, + "content": con.Text, + "author": con.Author, + "dynasty": con.Extra.Dynasty, + "mediaId": "", + "type": params.SpeechWsResp.Dm.Widget.Type, //原来是 AUDIO,看看是否能播放 + }) + } + } + + //if len(params.SpeechWsResp.Dm.Widget.Content) > 0 { + // for i := 0; i < len(params.SpeechWsResp.Dm.Widget.Content); i++ { + // res.ListItems = append(res.ListItems, map[string]interface{}{ + // "url": params.SpeechWsResp.Dm.Widget.Content[i].LinkUrl, + // "title": params.SpeechWsResp.Dm.Widget.Content[i].Title, + // "content": params.SpeechWsResp.Dm.Widget.Content[i].Text, + // "author": params.SpeechWsResp.Dm.Widget.Content[i].Author, + // "dynasty": params.SpeechWsResp.Dm.Widget.Content[i].Extra.Dynasty, + // "mediaId": "", + // "type": params.SpeechWsResp.Dm.Widget.Type, //原来是 AUDIO,看看是否能播放 + // //思必驰的没有回复话术 + // //"content": params.Dm.Widget.Content[i].TextContent, + // }) + // } + //} + + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + return Marshal(params, res) +} + +func jokeDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("jokeDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "joke" + res.Header.Semantic.Intent = "tell" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + res.ListItems = make([]map[string]interface{}, 0) + + sliceData, isSlice := params.SpeechWsResp.Dm.Widget.Content.([]interface{}) + if !isSlice { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("params.SpeechWsResp.Dm.Widget.Content不是数组类型") + return replyWithChat(error_reply, "doudi") + } + + for _, item := range sliceData { + itemBytes, _ := json.Marshal(item) + var con model.Content + if err := json.Unmarshal(itemBytes, &con); err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Errorf("json.Unmarshal元素解析失败: %v", err) + return replyWithChat(error_reply, "doudi") + } + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": con.LinkUrl, + "title": con.Title, + //思必驰的没有回复话术 + //"content": params.Dm.Widget.Content[i].TextContent, + }) + } + return Marshal(params, res) +} + +func astroDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("astroDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "astro" + res.Header.Semantic.Intent = "search_info" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + return Marshal(params, res) +} + +func translateDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("translateDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "translate" + res.Header.Semantic.Intent = "translate" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + return Marshal(params, res) +} + +func alarmDevFilter(params *model.SpeechDomainParams) bool { + if params.Mid == "10f05" && params.MidType == "87654321" { + return true + } else if params.Mid == "10f05" && params.MidType == "7e000024" && params.AppKey == "a8814080829e11eda5c8e38bb1008e50" { + return true + } + return false +} + +type AlarmItem struct { + Content string `json:"content"` + Id string `json:"id"` + Note string `json:"note"` + RepeatType int `json:"repeatType"` + SpeechType int `json:"speechType"` + Start string `json:"start"` + Type int `json:"type"` + Url string `json:"url"` +} + +// 闹钟待写 +func alarmDomain(params *model.SpeechDomainParams) []byte { + mac := params.Mac + + if !params.CheckDm() || !params.CheckDmParam() { + return replyWithChat(error_reply, "doudi") + } + + var result model.ResponseBody + result.Header.Semantic.Code = 0 + result.Header.Semantic.Msg = speech_nlu_parse + result.Header.Semantic.SessionComplete = params.SpeechWsResp.Dm.ShouldEndSession + //result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent + result.AsrRecongize = params.SpeechWsResp.Dm.Input + + var alarmDBData model.AlarmRemindInfo + alarmDBData.Mac = params.Mac + alarmDBData.Note = "" + alarmDBData.URL = "" + alarmDBData.Speech_Type = onlyTTS + alarmDBData.Createtime = time.Now().String()[:19] + //items := "" + contentTTS := "" + + if params.SpeechWsResp.Dm.Param.Object == "闹钟" { + alarmDBData.E_type = alarm + result.Header.Semantic.Domain = "alarm" + } else { + alarmDBData.E_type = remind + result.Header.Semantic.Domain = "reminder_v2" + if !params.CheckEvent() { + contentTTS = alarm_remind_common + params.SpeechWsResp.Dm.Param.Event + } else { + contentTTS = alarm_remind_raw + } + alarmDBData.Note = contentTTS + } + fmt.Println(contentTTS) + + if params.SpeechWsResp.Dm.Api == "DUI.Alerts.SetAlert" { + result.Header.Semantic.Intent = "new" + if !params.CheckDate() { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType}).Error("params.CheckDate() error") + return replyWithChat(error_reply, "doudi") + } else { + //如果日期存在 + t, err := time.Parse("20060102", params.SpeechWsResp.Dm.Param.Date) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType}).Error(err.Error()) + return replyWithChat(error_reply, "doudi") + } + + // 将日期转换为目标格式 + formatted := t.Format("2006-01-02") + alarmDBData.E_date = formatted + //获得时间 + alarmDBData.E_time = params.SpeechWsResp.Dm.Param.Time + } + + if !params.CheckRepeat() { + alarmDBData.Repeat_type = 1 + } else if params.SpeechWsResp.Dm.Param.Repeat == "W1W2W3W4W5W6W7" { + alarmDBData.Repeat_type = 2 + } else if params.SpeechWsResp.Dm.Param.Repeat == "W1W2W3W4W5" { + alarmDBData.Repeat_type = 5 + } else if strings.Contains(strings.ToLower(params.SpeechWsResp.Dm.Param.Repeat), "M") { + alarmDBData.Repeat_type = 4 + } else if strings.Contains(strings.ToLower(params.SpeechWsResp.Dm.Param.Repeat), "W") { + alarmDBData.Repeat_type = 3 + //每周几待写 + } + dao.SaveAlarmRemindData(alarmDBData) + if params.SpeechWsResp.Dm.Nlg != "" { + result.ResponseText = params.SpeechWsResp.Dm.Nlg + } else { + result.ResponseText = "已经设置好了" + } + + } else if params.SpeechWsResp.Dm.Api == "DUI.Alerts.QueryAlert" { + result.Header.Semantic.Intent = "check" + dao.DeleteOverdueAlarmRemindData(mac) + + } else if params.SpeechWsResp.Dm.Api == "DUI.Alerts.DeleteAlert" { + result.Header.Semantic.Intent = "delete" + } + + result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent + + if !alarmDevFilter(params) { + return Marshal(params, &result) + } + + return Marshal(params, &result) +} + +func scienceDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("scienceDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "science" + res.Header.Semantic.Intent = "calculator" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + return Marshal(params, res) +} + +func chengyuDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("chengyuDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "chat" //成语原来腾讯的返回的就是chat + res.Header.Semantic.Intent = "chat" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + return Marshal(params, res) +} + +func baikeDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("baikeDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "baike" //成语原来腾讯的返回的就是chat + res.Header.Semantic.Intent = "search_baike" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + + return Marshal(params, res) +} + +func fmDomain(params *model.SpeechDomainParams) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("fmDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.Header.Semantic.Domain = "fm" + res.Header.Semantic.Intent = "play_radio" + res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent + res.ListItems = make([]map[string]interface{}, 0) + sliceData, isSlice := params.SpeechWsResp.Dm.Widget.Content.([]interface{}) + if !isSlice { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("params.SpeechWsResp.Dm.Widget.Content不是数组类型") + return replyWithChat(error_reply, "doudi") + } + + for _, item := range sliceData { + itemBytes, _ := json.Marshal(item) + var con model.Content + if err := json.Unmarshal(itemBytes, &con); err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Errorf("json.Unmarshal元素解析失败: %v", err) + return replyWithChat(error_reply, "doudi") + } + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": con.LinkUrl, + "title": con.Title, + }) + } + + //if len(params.SpeechWsResp.Dm.Widget.Content) > 0 { + // for i := 0; i < len(params.SpeechWsResp.Dm.Widget.Content); i++ { + // res.ListItems = append(res.ListItems, map[string]interface{}{ + // "url": params.SpeechWsResp.Dm.Widget.Content[i].LinkUrl, + // "title": params.SpeechWsResp.Dm.Widget.Content[i].Title, + // //思必驰的没有回复话术 + // //"content": params.Dm.Widget.Content[i].TextContent, + // }) + // } + //} + return Marshal(params, res) +} + +func globalCtrlDomain(params *model.SpeechDomainParams) []byte { + query := params.SpeechWsResp.Dm.Input + if !params.CheckCommandParam() { + return replyWithChat(error_reply, "doudi") + } else { + if params.SpeechWsResp.Dm.Command.Param.Volume != "" && params.SpeechWsResp.Dm.Command.Api == "DUI.MediaController.SetVolume" { + if strings.Contains(params.SpeechWsResp.Dm.Command.Param.Volume, "-") || strings.Contains(params.SpeechWsResp.Dm.Command.Param.Volume, "+") { + pattern := `([+-]?)(\d+)` // 分组1:符号(+/-),分组2:数字 + re := regexp.MustCompile(pattern) + + // 查找所有匹配项 + matches := re.FindAllStringSubmatch(params.SpeechWsResp.Dm.Command.Param.Volume, -1) + var sign, numStr, action string + + for _, match := range matches { + sign = match[1] // 符号部分(可能为空) + numStr = match[2] // 数字部分 + fmt.Printf("符号: [%s], 数字: %s\n", sign, numStr) + } + semanticParams := make(map[string]interface{}) + + if numStr != "" { + semanticParams["degree"] = model.ParamsStr{Origin: numStr, Norm: numStr, Code: 0} + } + + if sign == "-" { + action = "control_reduceVol" + } else { + action = "control_riseVol" + } + + return transformGreeProtocolReply(query, "UniversalControl", action, &semanticParams) + } else if params.SpeechWsResp.Dm.Command.Param.Volume == "max" { + return transformGreeProtocolReply(query, "UniversalControl", "control_riseVolMax", nil) + } else if params.SpeechWsResp.Dm.Command.Param.Volume == "min" { + return transformGreeProtocolReply(query, "UniversalControl", "control_reduceVolMin", nil) + } else { + semanticParams := make(map[string]interface{}) + // 百分数 + if strings.Contains(params.SpeechWsResp.Dm.Command.Param.Volume, "%") { + parts := strings.SplitN(params.SpeechWsResp.Dm.Command.Param.Volume, "%", 2) + semanticParams["degree"] = model.ParamsStr{Origin: parts[0], Norm: parts[0], Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_setVol", &semanticParams) + } + + // 分数 + if strings.Contains(params.SpeechWsResp.Dm.Command.Param.Volume, "/") { + num, err := fractionToPercent(params.SpeechWsResp.Dm.Command.Param.Volume) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Errorf("fractionToPercent error: %v", err) + return replyWithChat(error_reply, "doudi") + } + + semanticParams["degree"] = model.ParamsStr{Origin: strconv.Itoa(num), Norm: strconv.Itoa(num), Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_setVol", &semanticParams) + } + + semanticParams["degree"] = model.ParamsStr{Origin: params.SpeechWsResp.Dm.Command.Param.Volume, Norm: params.SpeechWsResp.Dm.Command.Param.Volume, Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_setVol", &semanticParams) + } + } else if params.SpeechWsResp.Dm.Command.Api == "DUI.System.Sounds.OpenMode" && params.SpeechWsResp.Dm.Command.Param.Mode == "静音模式" { + return transformGreeProtocolReply(query, "SystemControl", "control_volumeOff", nil) + } else if params.SpeechWsResp.Dm.Command.Api == "DUI.System.Sounds.CloseMode" && params.SpeechWsResp.Dm.Command.Param.Mode == "静音模式" { + return transformGreeProtocolReply(query, "SystemControl", "control_volumeOn", nil) + } + } + + return replyWithChat(error_reply, "doudi") +} + +func playCtrlDomain(params *model.SpeechDomainParams) []byte { + query := params.SpeechWsResp.Dm.Input + if !params.CheckDmParam() { + return replyWithChat(error_reply, "doudi") + } else { + if params.SpeechWsResp.Dm.Param.Operate != "" { + switch params.SpeechWsResp.Dm.Param.Operate { + case "暂停": + return transformGreeProtocolReply(query, "PlayControl", "control_pause", nil) + case "继续": + return transformGreeProtocolReply(query, "PlayControl", "control_resume", nil) + case "停止": + return transformGreeProtocolReply(query, "PlayControl", "control_stop", nil) + } + } else if params.SpeechWsResp.Dm.Param.Number != "" { + switch params.SpeechWsResp.Dm.Param.Number { + case "+1": + return transformGreeProtocolReply(query, "UniversalControl", "control_next", nil) + case "-1": + return transformGreeProtocolReply(query, "UniversalControl", "control_previous", nil) + } + } + } + + return replyWithChat(error_reply, "doudi") +} + +func musicDomain(params *model.SpeechDomainParams) []byte { + list, err := connect.MusicGrpc(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Errorf("connect.MusicGrpc error:%v", err) + return replyWithChat(error_reply, "doudi") + } + + var result model.ResponseBody + result.Header.Semantic.Code = 0 + result.Header.Semantic.Domain = "music" + result.Header.Semantic.Intent = "play" + result.Header.Semantic.Msg = speech_nlu_parse + result.Header.Semantic.SessionComplete = params.SpeechWsResp.Dm.ShouldEndSession + result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent + result.ResponseText = params.SpeechWsResp.Dm.Nlg + result.AsrRecongize = params.SpeechWsResp.Dm.Input + result.ListItems = make([]map[string]interface{}, 0) + if len(list.Data.ListItems) > 0 { + for i := 0; i < len(list.Data.ListItems); i++ { + result.ListItems = append(result.ListItems, map[string]interface{}{ + "mediaId": list.Data.ListItems[i].MediaId, + "singer": list.Data.ListItems[i].Singer, + "song": list.Data.ListItems[i].Song, + }) + } + } + return Marshal(params, &result) +} + +func helpDomain(params *model.SpeechDomainParams) []byte { + resultTextStr := "我可以控制空调开机、播放音乐、查询时间天气、调节温度,设置模式,例如您可以对我说,空调开机。" + return replyWithChat(resultTextStr, "chat.chat") +} + +func Marshal(params *model.SpeechDomainParams, res *model.ResponseBody) []byte { + if res.Header.Semantic.Domain == "" { + res.Header.Semantic.Domain = "chat" + } + if res.Header.Semantic.Intent == "" { + res.Header.Semantic.Domain = "chat" + } + resByte, err := json.Marshal(res) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Errorf("Marshal error. %v", err) + return replyWithChat(error_reply, "doudi") + } + return resByte +} + +func otherDomain(params *model.SpeechDomainParams) []byte { + resultText := reply_when_tencent_empty + return replyWithChat(resultText, "chat.chat") +} + +func fractionToPercent(fraction string) (int, error) { + // 1. 按 "/" 分割字符串 + parts := strings.Split(fraction, "/") + if len(parts) != 2 { + return 0, fmt.Errorf("invalid fraction format: %s", fraction) + } + + // 2. 转换分子和分母为整数 + numerator, err := strconv.Atoi(parts[0]) + if err != nil { + return 0, fmt.Errorf("invalid numerator: %s", parts[0]) + } + + denominator, err := strconv.Atoi(parts[1]) + if err != nil { + return 0, fmt.Errorf("invalid denominator: %s", parts[1]) + } + + // 3. 检查分母是否为0 + if denominator == 0 { + return 0, fmt.Errorf("denominator cannot be zero") + } + + // 4. 计算百分比并四舍五入取整 + percent := float64(numerator) / float64(denominator) * 100 + return int(percent + 0.5), nil // 四舍五入 +} diff --git a/service/speechNlu/register.go b/service/speechNlu/register.go new file mode 100644 index 0000000..2808640 --- /dev/null +++ b/service/speechNlu/register.go @@ -0,0 +1,73 @@ +package speechNlu + +import "speech-nlu-parse/model" + +type DomainFunc func(params *model.SpeechDomainParams) []byte + +var handlers = make(map[string]DomainFunc) + +// 注册函数:将处理函数绑定到特定key +func DomainRegister(key string, value DomainFunc) { + handlers[key] = value +} + +// 查询函数:通过key获取对应的处理函数 +func getHandler(key string) (handler DomainFunc, ok bool) { + handler, ok = handlers[key] + return +} + +func register() { + DomainRegister(WEATHER, weatherDomain) + DomainRegister(CHAT, chatDomain) + DomainRegister(CALENDAR, calendarDomain) + DomainRegister(NEWS, newsDomain) + DomainRegister(ANCIENTPOEM, ancientpoemDomain) + + //体育无 + //DomainRegister(SPORTS, sportsDomain) + + DomainRegister(JOKE, jokeDomain) + DomainRegister(ASTRO, astroDomain) + + //股票无 + //DomainRegister(STOCK, stockDomain) + + DomainRegister(TRANSLATE, translateDomain) + DomainRegister(ALARM, alarmDomain) + DomainRegister(SCIENCE, scienceDomain) + DomainRegister(CHENGYU, chengyuDomain) + DomainRegister(BAIKE, baikeDomain) + DomainRegister(FM, fmDomain) + DomainRegister(CHILDMUSIC, musicDomain) + DomainRegister(GLOBALCTRL, globalCtrlDomain) + DomainRegister(PlayCTRL, playCtrlDomain) + DomainRegister(MUSIC, musicDomain) + DomainRegister(HELP, helpDomain) + + // + //DomainRegisterV2(CHAT, chatDomainV2) + //DomainRegisterV2(MCHAT, chatDomainV2) // mchat + //DomainRegisterV2(HOLIDAY, holidayDomainV2) + //DomainRegisterV2(NEWS, newsDomainV2) + //DomainRegisterV2(ANCIENTPOEM, ancientpoemDomainV2) + //DomainRegisterV2(SPORTS, sportsDomainV2) + //DomainRegisterV2(JOKE, jokeDomainV2) + //DomainRegisterV2(ASTRO, astroDomainV2) + //DomainRegisterV2(STOCK, stockDomainV2) + //DomainRegisterV2(TRANSLATE, translateDomainV2) + //DomainRegisterV2(ALARM, alarmDomainV2) + //DomainRegisterV2(SCIENCE, scienceDomainV2) + //DomainRegisterV2(CHENGYU, chengyuDomainV2) + //DomainRegisterV2(REMINDERV2, alarmDomainV2) + //DomainRegisterV2(GLOBALCTRL3, globalCtrlDomainV2) + //DomainRegisterV2(MEDIACTRL, mediaCtrlDomainV2) + //DomainRegisterV2(BAIKE, baikeDomainV2) + //DomainRegisterV2(FM, fmDomainV2) + //DomainRegisterV2(DEFAULT, defaultDomainV2) + //DomainRegisterV2(MUSIC, musicDomainV2) + //DomainRegisterV2(VOLUMECTRL3, volumeCtrl3DomainV2) + //DomainRegisterV2(SCREENCONTROL, screenCtrlDomainV2) + //DomainRegisterV2(WORLDRECORDSQAPAIRS, worldRecordsQaPairsDomainV2) + +} diff --git a/service/speechNlu/reply.go b/service/speechNlu/reply.go new file mode 100644 index 0000000..2bef3b4 --- /dev/null +++ b/service/speechNlu/reply.go @@ -0,0 +1,117 @@ +package speechNlu + +import ( + "encoding/json" + "speech-nlu-parse/model" +) + +var ( + reply_when_tencent_empty = "我还不够聪明,没有找到你想要的内容" + reply_when_geography_empty = "抱歉,没找到你想要的" + alarm_remind_raw = "到提醒时间了" + reply_when_recourse_limited = "很抱歉,暂时还没有相关资源" + shielded_reply = "抱歉,暂不支持该功能,我还在努力学习中" + error_reply = "抱歉,没找到你想要的" // 错误兜底回复 + frequency_request_reply = "抱歉,没找到你想要的" // TODO: 请求过于频繁的回复话术 + expired_reply = "QQ音乐账号绑定已过期,请前往格力+手机应用重新绑定。" // 授权过期回复语 + not_using_reply = "您的设备尚未绑定QQ音乐账号,请前往格力+手机应用绑定激活。" // 未授权回复语 +) + +// 兜底话术 +var replyMessage = []string{"你的问题太难了,我没法回答", "人类的语言真是太复杂了,我听不懂", "这个要求有点高,我现在还不会。", "很抱歉,没有找到你想要的内容", + "抱歉,暂不支持该功能,我还在努力学习中", "抱歉,我还不够聪明,没有找到你想要的内容"} + +var musicReplyMessage = []string{ + "好的", + "注意听", + "马上为您播放", + "请欣赏", +} + +var weatherReplyMessage = []string{ + "出门记得带伞哦", + "记得带伞", + "别忘记带伞", +} + +var recipeReply = []string{"菜品具体的做法推荐您去网上查看哦", "很难只通过只言片语就将一道好菜描述清楚哦,推荐您去网上查看对应菜谱", "具体的做法建议您去相关的菜谱网站上查看哦", "这道菜的做法难以通过三言两语描述清楚,您最好去相关的菜谱网站查看哦"} + +// 讲格力NLU返回的播报话术拼接腾讯的chat格式返回 +func getGreeNluChatReply(responseText, domain, query string) []byte { + replyData := `{ + "header": { + "semantic": { + "code": 0, + "domain": "` + chatDomainStr + `", + "intent": "` + "chat" + `", + "msg": "gree_mix_tencent", + "session_complete": true, + "skill_id": "` + domain + `" + } + }, + "response_text": "` + responseText + `", + "asr_recongize": "` + query + `" + }` //updated25 + return []byte(replyData) +} + +// 未知技能用chat格式兜底 +func replyWithChat(response_text, domain string) []byte { + jsonStr := `{"header":{"semantic":{"code":0,"domain":"` + chatDomainStr + `","intent":"chat","msg":"","session_complete":true,"skill_id":"` + domain + `"}},"response_text":"` + response_text + `"}` + return []byte(jsonStr) +} + +func replyWithChatV2(response_text, domain, intent string) []byte { + jsonStr := `{"header":{"semantic":{"code":0,"domain":"` + domain + `","intent":"` + intent + `","msg":"","session_complete":true,"skill_id":"` + domain + `"}},"response_text":"` + response_text + `"}` + return []byte(jsonStr) +} + +func replyWithHeader(heraderRaw string, responseText string) []byte { + jsonStr := `{"header":` + heraderRaw + `,"response_text":"` + responseText + `"}` + return []byte(jsonStr) +} + +func reply(response_text, domain, intent string) []byte { + jsonStr := `{ + "header": { + "semantic": { + "code": 0, + "domain": "` + domain + `", + "intent": "` + intent + `", + "msg": "", + "session_complete": true, + "skill_id": "` + domain + `" + } + }, + "response_text": "` + response_text + `" + }` + return []byte(jsonStr) +} + +// 测试音频 +func getTencentSongReply(url, content, query string) []byte { + songJsonStr := `{"header":{"semantic":{"code":0,"domain":"fm","intent":"play","msg":"","session_complete":true,"skill_id":"990835382587363328"}},"response_text":"` + content + `","asr_recongize":"` + query + `","listItems":[{"url":"` + url + `","singer":"测试音频","song":"测试音频"}]}` + return []byte(songJsonStr) +} + +// 腾讯协议转格力协议reply +func transformGreeProtocolReply(query, service, action string, params *map[string]interface{}) []byte { + // "time": { "orgin": "2021-04-14 00:00:00", "norm": "2021-04-14 00:00:00", "code": 0 } + greeNluProtocol := model.GreeNluProtocol{} + + semantic := make(map[string]interface{}) + semantic["service"] = service + semantic["action"] = action + if params != nil { + semantic["params"] = params + } + + semantic["outputContext"] = model.OutputContextStr{Service: "SPEECH-NLU"} + greeNluProtocol.Semantic = &semantic + greeNluProtocol.Query = query + + resultData := make(map[string]interface{}) + greeNluProtocol.Result.ResultData = &resultData + jsonStr, _ := json.Marshal(greeNluProtocol) + return jsonStr +} diff --git a/service/speechNlu/speech.go b/service/speechNlu/speech.go new file mode 100644 index 0000000..263802f --- /dev/null +++ b/service/speechNlu/speech.go @@ -0,0 +1,224 @@ +package speechNlu + +import ( + "encoding/json" + "fmt" + "github.com/gorilla/websocket" + "speech-nlu-parse/dao" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/errCode" + "sync" + "time" +) + +func init() { + // 注册 + register() +} + +var SpeechWg = &sync.WaitGroup{} + +func SpeechNlu(reqStruct *model.SemanticReq) (string, *errCode.Error) { + if reqStruct == nil { + return string(replyWithChat(error_reply, "doudi")), errCode.RequestFormatError + } + + // 结果 + var channelStr string + + //ts := time.Now() + err, content, url := dao.GetTestContent(reqStruct.MacWifi, reqStruct.Query) + //tc := time.Since(ts) + //fmt.Println(time.Now().String()[:19], err, reqStruct.MacWifi, reqStruct.Query, tc) + if err == nil { + channelStr = string(getTencentSongReply(url, content, reqStruct.Query)) + } else { + if reqStruct.Query == "声道测试" || reqStruct.Query == "音响音质测试" || reqStruct.Query == "音箱音质测试" { + // channelStr = string(getTencentSongReply("", reqStruct.Query)) + // err, content, url := dao.GetAnyTestContent(reqStruct.MacWifi, reqStruct.Query) + url = global.OthersSetting.SoundTestUrl + content = "" + channelStr = string(getTencentSongReply(url, content, reqStruct.Query)) + + } else if reqStruct.Query == "重定向测试" { + url = "http://nlu.gree.com/temp/music" + content = "" + channelStr = string(getTencentSongReply(url, content, reqStruct.Query)) + + } else if reqStruct.Query == "编号七零六八一" && reqStruct.MacWifi == "f4911e594443" { + channelStr = string(getGreeNluChatReply("好的,计时五分钟马上开始,五,四,三,二,一", "countdown", reqStruct.Query)) + } else { + fmt.Println("---------------------待解析---------------------") + + data := SpeechNlpWsReq(reqStruct) + + speechNluWs := SpeechNlpWs{} + var nlpWsConn *websocket.Conn + + nlpWsConn, err = speechNluWs.SpeechWs() + if err != nil { + global.Logger.Errorf("speechWs.SpeechWs error. %v", err) + return string(replyWithChat(error_reply, "doudi")), errCode.InternalServiceError + } + speechNluWs.NlpWsConn = nlpWsConn + defer nlpWsConn.Close() + + done := make(chan struct{}) + dataChan := make(chan []model.SpeechWsResp, 1) // 缓冲通道避免阻塞 + + go receiveMessage(nlpWsConn, done, dataChan) + + if err := sendRunTaskMsg(nlpWsConn, data); err != nil { + fmt.Println("发送run-task指令失败:", err) + return string(replyWithChat(error_reply, "doudi")), errCode.InternalServiceError + } + + var responses []model.SpeechWsResp + select { + case <-done: + responses = <-dataChan + fmt.Println("任务成功完成,接收数据如下:") + + for _, resp := range responses { + semanticRespByteData := ParseSpeechJson(resp, reqStruct.MacWifi, reqStruct.OriginQuery, reqStruct.Mid) + return string(semanticRespByteData), errCode.Success + //fmt.Printf("%+v\n", resp) + } + case <-time.After(5 * time.Minute): + fmt.Println("任务超时,尝试获取已接收数据...") + select { + case responses = <-dataChan: + fmt.Println("部分接收数据如下:") + for _, resp := range responses { + fmt.Printf("%+v\n", resp) + } + default: + fmt.Println("未接收到任何数据") + return string(replyWithChat(error_reply, "doudi")), errCode.InternalServiceError + } + } + + return string(replyWithChat(error_reply, "doudi")), errCode.InternalServiceError + } + } + + return channelStr, errCode.Success +} + +func sendRunTaskMsg(conn *websocket.Conn, v interface{}) error { + msgJSON, err := json.Marshal(v) + if err != nil { + return err + } + return conn.WriteMessage(websocket.TextMessage, msgJSON) +} + +func receiveMessage(conn *websocket.Conn, done chan struct{}, dataChan chan<- []model.SpeechWsResp) { + var responses []model.SpeechWsResp + defer func() { + dataChan <- responses + close(done) + }() + + for { + _, message, err := conn.ReadMessage() + if err != nil { + fmt.Println("\n消息接收终止:", err) + return + } + //思必驰nlu回复 + fmt.Println("原始消息") + fmt.Println(string(message)) + + var resp model.SpeechWsResp + if err := json.Unmarshal(message, &resp); err != nil { + fmt.Println("消息解析失败:", err) + continue + } + + fmt.Printf("\n收到新消息:%+v\n", string(message)) + responses = append(responses, resp) + + //resp.Dm.ShouldEndSession不能判定是否结束 + //if resp.Dm.ShouldEndSession { + // fmt.Println("\n收到会话结束标志,终止接收") + // return + //} + if resp.Dm != nil { + return + } + + //r := resp.SpeechWsResponse(p.RequestId) + // + //if resp.Topic == "tts.error" { + // global.Logger.WithFields(logger.Fields{ + // "RequestId": p.RequestId, + // "Code": resp.Error.ErrId, + // "Message": resp.Error.Error, + // "Time": time.Since(st), + // "SpeechWsRequestId": resp.RecordId, + // }).Error("[SpeechWs] 返回message错误") + // r.Status.Code = int32(YXWConvertErrorCode(YXWRespCode(r.Status.Code))) + // p.Send(r) + // return + //} + //p.Send(r) + // + //fmt.Println("1111111") + //fmt.Println(resp) + // + //if resp.Topic == "tts.stream.end" { + // global.Logger.WithFields(logger.Fields{ + // "RequestId": p.RequestId, + // "Topic": resp.Topic, + // "Time": time.Since(st).Seconds(), + // "SpeechWsRequestId": resp.RecordId, + // }).Info("[SpeechWs] 读取结束") + // + // close(audioChan) + // break + //} + } +} + +func ParseSpeechJson(speechJson model.SpeechWsResp, mac string, query, mid string) []byte { + //思必驰返回的domain是中文,待改 + domain := speechJson.Skill + + var jsonByte []byte + //reply_when_tencent_empty = replyMessage[util.GetRandom(len(replyMessage))] + + params := &model.SpeechDomainParams{ + SpeechWsResp: &speechJson, + Query: query, + RequestId: "", + Mac: mac, + Domain: domain, + Mid: mid, + MidType: "", + SessionId: "", + HomeId: "", + AppKey: "", + } + + // 根据mid屏蔽部分domain, 并返回 + //if util.IsContain(domain, global.GetLimitedSetting(mid).ShieldedDomainList) { + // jsonByte = shieldedDomain() + // return jsonByte + //} + + //jsonByte = jokeDomain(speechJson) + + fmt.Println("domain:", domain) + + if value, ok := getHandler(domain); ok { + jsonByte = value(params) + } else { + // 其他domain进行兜底 + fmt.Println("兜底") + jsonByte = otherDomain(params) + } + + return jsonByte +} diff --git a/service/speechNlu/speechWs.go b/service/speechNlu/speechWs.go new file mode 100644 index 0000000..39e9a06 --- /dev/null +++ b/service/speechNlu/speechWs.go @@ -0,0 +1,246 @@ +package speechNlu + +import ( + "encoding/json" + "fmt" + "github.com/gorilla/websocket" + "io/ioutil" + "net/http" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "sync" + "time" +) + +type SpeechNlpWs struct { + NlpWsConn *websocket.Conn + mutex sync.Mutex +} + +func (this *SpeechNlpWs) SpeechWs() (*websocket.Conn, error) { + SpeechWs_Url := "wss://dds.dui.ai/dds/v2/test" + SpeechWs_ProductId := "279629895" + SpeechWs_ApiKey := "0c74988953dd4ed4bf31955527802cf3" + + //st := time.Now() + dialer := websocket.Dialer{ + HandshakeTimeout: 30 * time.Second, + } + + header := http.Header{} + SpeechUrl := SpeechWs_Url + "?serviceType=websocket&productId=" + SpeechWs_ProductId + + "&apikey=" + SpeechWs_ApiKey + + fmt.Println(SpeechUrl) + + conn, resp, err := dialer.Dial(SpeechUrl, header) + if err != nil { + global.Logger.WithFields(logger.Fields{ + //"RequestId": p.RequestId, + "resp": readResp(resp), + }).Errorf("[SpeechWs] Connect error : %v", err.Error()) + //p.Send(ErrorResponse(CodeConnectError, "connect speechWs error")) + return nil, err + } + return conn, nil +} + +func (this *SpeechNlpWs) Send(data interface{}) error { + this.NlpWsConn.WriteJSON(data) + return nil +} + +func (this *SpeechNlpWs) Recv() ([]byte, error) { + _, msg, err := this.NlpWsConn.ReadMessage() + return msg, err +} + +func readResp(resp *http.Response) string { + if resp == nil { + return "" + } + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + panic(err) + } + return fmt.Sprintf("code=%d,body=%s", resp.StatusCode, string(b)) +} + +func SpeechNlpWsReq(data *model.SemanticReq) *SpeechWsData { + req := new(SpeechWsData) + req.Topic = "nlu.input.text" + req.RecordId = data.Guid + //sessionId待定 + req.RefText = data.Query + return req +} + +func (this *SpeechNlpWs) ParseSpeechNluData(jsonData []byte, requestId, sessionId string) []byte { + speechNlpWsResp := model.SpeechWsResp{} + err := json.Unmarshal(jsonData, &speechNlpWsResp) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData Unmarshal error.") + return replyWithChat(error_reply, "doudi") + } + + //var jsonByte []byte + + fmt.Println(jsonData) + + return jsonData +} + +func (this *SpeechNlpWs) WsSend(body *SpeechWsData) { + this.Send(body) +} + +//type SpeechWsConnection struct { +// conn *websocket.Conn +// mutex sync.Mutex +//} +// +//var SpeechWg = &sync.WaitGroup{} + +type SpeechWsData struct { + Topic string `json:"topic"` // 必选 + RecordId string `json:"recordId"` // 可选,uuid,请求标识 + SessionId string `json:"sessionId"` // 可选,首轮不带此参数,非首轮必须带此参数 + RefText string `json:"refText"` // 必选,请求文本 +} + +//func SpeechWs(data model.SemanticReq) { +// da := SpeechNlpWsReq(data) +// +// st := time.Now() +// dialer := websocket.Dialer{ +// HandshakeTimeout: 30 * time.Second, +// } +// +// header := http.Header{} +// SpeechUrl := SpeechWs_Url + "?serviceType=websocket&productId=" + SpeechWs_ProductId + +// "&apikey=" + SpeechWs_ApiKey +// global.Logger.WithFields(logger.Fields{ +// "Header": header, +// "RequestId": data.RequestId, +// "Url": SpeechUrl, +// }).Info("[SpeechWs] dial") +// conn, resp, err := dialer.Dial(SpeechUrl, header) +// if err != nil { +// global.Logger.WithFields(logger.Fields{ +// "RequestId": data.RequestId, +// "resp": readResp(resp), +// }).Errorf("[SpeechWs] Connect error : %v", err.Error()) +// //p.Send(ErrorResponse(CodeConnectError, "connect speechWs error")) +// return +// } +// +// c := SpeechWsConnection{ +// conn: conn, +// mutex: sync.Mutex{}, +// } +// defer c.conn.Close() +// +// global.Logger.WithFields(logger.Fields{ +// "RequestId": data.RequestId, +// }).Info("[SpeechWs] Send start") +// +// SpeechWg.Add(2) +// go c.read(st, SpeechWg, data) +// go c.write(da, SpeechWg, data) +// SpeechWg.Wait() +//} +// +//func (c *SpeechWsConnection) write(v interface{}, wg *sync.WaitGroup, p model.SemanticReq) { +// defer wg.Done() +// c.mutex.Lock() +// if err := c.conn.WriteJSON(v); err != nil { +// global.Logger.WithFields(logger.Fields{ +// "data": v, +// "RequestId": p.RequestId, +// }).Errorf("[SpeechWs] write error: %v", err.Error()) +// } else { +// global.Logger.WithFields(logger.Fields{ +// "data": v, +// "RequestId": p.RequestId, +// }).Info("[SpeechWs] write success") +// } +// c.mutex.Unlock() +//} +// +//func (c *SpeechWsConnection) read(st time.Time, wg *sync.WaitGroup, p model.SemanticReq) { +// defer wg.Done() +// +// // XF使用的是追加上传 +// //var nextPos int64 +// for { +// var resp = SpeechWsResp{} +// _, message, err := c.conn.ReadMessage() +// if err != nil { +// global.Logger.WithFields(logger.Fields{ +// "RequestId": p.RequestId, +// "SpeechWsRequestId": resp.RecordId, +// }).Errorf("[SpeechWs] 读取message失败: %v", err.Error()) +// // +// //if websocket.IsCloseError(err, websocket.CloseAbnormalClosure) { +// // p.YunXiaoWeiWs() +// // continue +// //} +// +// //p.Send(ErrorResponse(CodeReadOrParseMsgError, "[SpeechWs] 读取message失败")) +// break +// } +// err = json.Unmarshal(message, &resp) +// if err != nil { +// global.Logger.WithFields(logger.Fields{ +// "RequestId": p.RequestId, +// "SpeechWsRequestId": resp.RecordId, +// }).Errorf("[SpeechWs] 解析message失败: %v", err.Error()) +// //p.Send(ErrorResponse(CodeReadOrParseMsgError, "[SpeechWs] 解析message失败")) +// return +// } +// fmt.Println(message) +// //r := resp.SpeechWsResponse(p.RequestId) +// // +// //if resp.Topic == "tts.error" { +// // global.Logger.WithFields(logger.Fields{ +// // "RequestId": p.RequestId, +// // "Code": resp.Error.ErrId, +// // "Message": resp.Error.Error, +// // "Time": time.Since(st), +// // "SpeechWsRequestId": resp.RecordId, +// // }).Error("[SpeechWs] 返回message错误") +// // r.Status.Code = int32(YXWConvertErrorCode(YXWRespCode(r.Status.Code))) +// // p.Send(r) +// // return +// //} +// //p.Send(r) +// // +// // +// //if resp.Topic == "tts.stream.end" { +// // global.Logger.WithFields(logger.Fields{ +// // "RequestId": p.RequestId, +// // "Topic": resp.Topic, +// // "Time": time.Since(st).Seconds(), +// // "SpeechWsRequestId": resp.RecordId, +// // }).Info("[SpeechWs] 读取结束") +// // +// // close(audioChan) +// // break +// //} +// } +//} +// +//func readResp(resp *http.Response) string { +// if resp == nil { +// return "" +// } +// b, err := ioutil.ReadAll(resp.Body) +// if err != nil { +// panic(err) +// } +// return fmt.Sprintf("code=%d,body=%s", resp.StatusCode, string(b)) +//} diff --git a/service/tencentNlu/auth.go b/service/tencentNlu/auth.go new file mode 100644 index 0000000..2c4eaaf --- /dev/null +++ b/service/tencentNlu/auth.go @@ -0,0 +1,81 @@ +package tencentNlu + +import ( + "context" + "errors" + "fmt" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "speech-nlu-parse/pkg/proto" + "time" + + "google.golang.org/grpc" +) + +func GetAuthorizationByGRPC(macWifi, requestId, mid, vender string) (*model.TokenSearchResponse, error) { + + // consul注册中心获取host port + serviceInfo, err := global.ConsulObj.GetService(global.ServiceSetting.Dmsdk, "") + if err != nil { + return nil, err + } + startTime := time.Now() + // conn, err := grpc.Dial(fmt.Sprintf("%s:%d", global.AuthSetting.Ip, global.AuthSetting.GrpcPort), grpc.WithInsecure()) + conn, err := grpc.Dial(fmt.Sprintf("%s:%d", serviceInfo.GetAddress(), serviceInfo.GetPort()), grpc.WithInsecure(), grpc.WithNoProxy()) + + if err != nil { + return nil, err + } + defer conn.Close() + + c := proto.NewTokenSearchClient(conn) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*2) + defer cancel() + + req := proto.TokenSearchRequest{Mac: macWifi, RequestId: requestId, Mid: mid, Vender: vender} + + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"tokenSearchRequest": &req}, "mac": macWifi, "mid": mid, "vender": vender, "requestId": requestId}).Info("GetAuthorizationByGRPC request") + + rep, err := c.TokenSearchHandle(ctx, &req) + if err != nil { + return nil, err + } + // 转换 + tokenSearchResponse, err := GrpcTokenSearchResponse2ModelTokenSearchResponse(rep) + if err != nil { + return nil, err + } + cost := time.Now().Sub(startTime).Milliseconds() + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"tokenSearchResponse": tokenSearchResponse}, "mac": macWifi, "mid": mid, "vender": vender, "cost": cost, "requestId": requestId}).Info("GetAuthorizationByGRPC response") + + return tokenSearchResponse, nil +} + +// 结构体转换 +func GrpcTokenSearchResponse2ModelTokenSearchResponse(grpcTokenSearchResponse *proto.TokenSearchResponse) (*model.TokenSearchResponse, error) { + if grpcTokenSearchResponse == nil { + return nil, nil + } + var modelTokenSearchResponse model.TokenSearchResponse + + if grpcTokenSearchResponse.Status == nil { + return nil, errors.New("grpcTokenSearchResponse.Status is nil.") + } + + modelTokenSearchResponse.Status.Code = grpcTokenSearchResponse.Status.Code + modelTokenSearchResponse.Status.Msg = grpcTokenSearchResponse.Status.Msg + + if grpcTokenSearchResponse.Data == nil { + return nil, errors.New("grpcTokenSearchResponse.Data is nil.") + } + + modelTokenSearchResponse.Data.Dsn = grpcTokenSearchResponse.Data.Dsn + modelTokenSearchResponse.Data.Authorization = grpcTokenSearchResponse.Data.Authorization + modelTokenSearchResponse.Data.AccessToken = grpcTokenSearchResponse.Data.AccessToken + modelTokenSearchResponse.Data.AppKey = grpcTokenSearchResponse.Data.AppKey + modelTokenSearchResponse.Data.Status = grpcTokenSearchResponse.Data.Status + modelTokenSearchResponse.Data.UriType = grpcTokenSearchResponse.Data.UriType + + return &modelTokenSearchResponse, nil +} diff --git a/service/tencentNlu/check.go b/service/tencentNlu/check.go new file mode 100644 index 0000000..8c89980 --- /dev/null +++ b/service/tencentNlu/check.go @@ -0,0 +1,22 @@ +package tencentNlu + +import ( + "speech-nlu-parse/global" + "speech-nlu-parse/pkg/logger" + + "github.com/tidwall/gjson" +) + +// 校验jsonData 键值对 +func KeyValueCheck(jsonData []byte) bool { + if !gjson.GetBytes(jsonData, "header").Exists() { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"jsonData": jsonData}}).Error("jsonData header is not exist.") + return false + } + if !gjson.GetBytes(jsonData, "payload").Exists() { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"jsonData": jsonData}}).Error("jsonData payload is not exist.") + return false + } + + return true +} diff --git a/service/tencentNlu/config.go b/service/tencentNlu/config.go new file mode 100644 index 0000000..0c783f0 --- /dev/null +++ b/service/tencentNlu/config.go @@ -0,0 +1,22 @@ +package tencentNlu + +type Config struct { + // Conn *sql.DB + // DingDangBotKey *string + // DingDangBotSecret *string + // DingDangNluUrl *string + // TencentSha256Secret *string + // LogfileError *string + // TencentNluErr string + // AuthorizationTimeout *int + // AuthorizationUrl *string + // IsQQMusicRemid *bool + // QQMusicRemid *string + // AlbumList *[]string +} + +var config *Config + +func SetConfig(c *Config) { + config = c +} diff --git a/service/tencentNlu/constant.go b/service/tencentNlu/constant.go new file mode 100644 index 0000000..605ac8e --- /dev/null +++ b/service/tencentNlu/constant.go @@ -0,0 +1,145 @@ +package tencentNlu + +const ( + //腾讯返回listItems为空时的兜底话术 + //eply_when_request_tencent_error = "" //腾讯接口异常时 + reply_when_control_nonresponse = "当前网络不稳定,请稍后再试吧" + alarm_remind_common = "时间到了,记得" + unisound_request_error = "unisound_request: " + tencent_response_error = "tencent_response: " + gree_nlu_err = "gree_nlu: " + tencent_nlu_err = "tencent_nlu: " + datetimeLayout = "2006-01-02 15:04:05" + dateLayout = "2006-01-02" + //speech_type = "0" //终端闹钟提醒方式 + chatDomainStr = "chat" //chat other +) + +const ( + errorLogfile = "logfile/ctoc/error/unisoundCtoC_Errorlogfile_" + tencentLogFile = "logfile/ctoc/tencentnlu/tencentnlu_ctoc_logfile_" +) + +const ( + onlyTTS = "0" + onlyRing = "1" + Mixed = "2" + defaultRing = "3" + timeoutCount = 10 //设置两小时内的超时总数量 + timeoutTime = 3 //设置接口三秒超时 + timeoutPercent = 0.1 //设置超时请求数比例阈值 10% +) + +const ( + alarm = "0" + remind = "1" + countdown = "2" +) + +const ( + once = "1" + everyDay = "2" + everyWeek = "3" + everyMonth = "4" + everyWorkDay = "5" + holiday = "6" +) + +const ( + //devDB = "de_records_ctocst" //空调聊天记录数据表 + devDB = "de_ctoclog_st" + //devDB = "de_records" + asDB = "as_records" //语音助手聊条记录数据表 + arDB = "alarm_remind" //闹钟数据表 + notsupportTB = "greenlu_notsupport" //格力NLU不支持的语句 + errorLog = "ctoc_errorlog" + greenlu_semantic = "ctoc_greenlu_semantic" + tencent_senmantic = "ctoc_tencent_semantic_log" + control_semantic = "ctoc_control_semantic" + skillUseDB = "ctoc_skill_user_like" + homeinfoDB = "de_homeinfo_conn" + ctoc_req_ala = "ctoc_req_ala" +) + +// 腾讯技能的Domain +const ( + MUSIC = "music" + NEWS = "news" + WEATHER = "weather" + ANCIENTPOEM = "ancient_poem" + FM = "fm" + SPORTS = "sports" + JOKE = "joke" + ASTRO = "astro" + HOLIDAY = "holiday" + STOCK = "stock" + TRANSLATE = "translate" + SOUND = "sound" + ALMANAC = "almanac" + FINANCE = "finance" + FOOD = "food" + GENERALQA = "general_question_answering" + COMMONQA = "common_qa" + BAIKE = "baike" + CHENGYU = "chengyu" + SCIENCE = "science" + RECIPE = "recipe" + HISTORY = "history" + CHAT = "chat" + GEOGRAPHY = "geography" + ALARM = "alarm" + REMINDERV2 = "reminder_v2" + XIAOLIAO = "xianliao-1073423540231241728" + CITYINFO = "cityinfo" + WORLDRECORDS = "world_records" + HTWHYS = "htwhys" + DISEASE = "disease" + GARBAGECLASS = "garbage_class" + YIQINGWENDA = "yiqingwenda-1223872807159873536" + GLOBALCTRL = "globalctrl" + INVENTIONQAPAIRS = "invention_qa_pairs" + PLANTS_KBQA = "plants_kbqa" + MEDIACTRL = "mediactrl3" + DEFAULT = "default" + VOLUMECTRL3 = "volumectrl3" + SCREENCONTROL = "screen_control" + GLOBALCTRL3 = "globalctrl3" + MCHAT = "mchat" + WORLDRECORDSQAPAIRS = "world_records_qa_pairs" + HELP = "help" + LLM = "llm" + GEOGRAPHYKBQA = "geography_kbqa" + GENERALQUESTIONANSWERING = "general_question_answering" + HTWHYS_QA_PAIRS = "htwhys_qa_pairs" + INVENTION_QA_PAIRS = "invention_qa_pairs" + XIANLIAO = "xianliao" + MUSIC_YUE = "music_yue" + WEATHER_YUE = "weather_yue" + JOKE_YUE = "joke_yue" + NEWS_YUE = "news_yue" + FM_YUE = "fm_yue" + TRANSLATE_YUE = "translate_yue" + SCIENCE_YUE = "science_yue" + SPORTS_YUE = "sports_yue" + ASTRO_YUE = "astro_yue" + HOLIDAY_YUE = "holiday_yue" + STOCK_YUE = "stock_yue" + HELP_YUE = "help_yue" + ANCIENT_POEM_YUE = "ancient_poem_yue" + CHENGYU_YUE = "chengyu_yue" + ALARM_YUE = "alarm_yue" + REMINDER_V2_YUE = "reminder_v2_yue" + SOUND_YUE = "sound_yue" + GLOBALCTRL3_YUE = "globalctrl3_yue" + MEDIACTRL3_YUE = "mediactrl3_yue" + VOLUMECTRL3_YUE = "volumectrl3_yue" + ASTRONOMY_KBQA = "astronomy_kbqa" + COMMON_QA_QA_PAIRS = "common_qa_qa_pairs" + GLETKT_XLCJ_1245258905417052160 = "gletkt_xlcj-1245258905417052160" + CESHI_1149914105856290816 = "ceshi-1149914105856290816" + GELIYOUPINGKONGTIAO_1289106967398617088 = "geliyoupingkongtiao-1289106967398617088" + JHDPBXZSWD_1364089899207012352 = "jhdpbxzswd-1364089899207012352" + LXTEST_1697504067777118921 = "lxtest-1697504067777118921" + LXTEST_1697504245166677379 = "lxtest-1697504245166677379" + LCHAT_1736631343458063755 = "lchat-1736631343458063755" +) diff --git a/service/tencentNlu/domain.go b/service/tencentNlu/domain.go new file mode 100644 index 0000000..7a0af03 --- /dev/null +++ b/service/tencentNlu/domain.go @@ -0,0 +1,1819 @@ +package tencentNlu + +import ( + "encoding/json" + "fmt" + "regexp" + "speech-nlu-parse/dao" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "strconv" + "strings" + "time" + + "github.com/tidwall/gjson" +) + +// TODO: 增对 音频 图文 不同类型进行解析 + +// zww 2018-11-22 兜底 +// func musicDomain(jsonData []byte, authInterface string) ([]byte, []TencentReport) { +func musicDomain(params *model.DomainParams) []byte { + // 获取参数 jsonData auth + var jsonData []byte + jsonData = params.JsonData + // var auth string + tokenSearchResponse := params.TokenSearchResponse + + query := params.Query + +Start: + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + responseText := replyMessage[getRandom(len(replyMessage))] + if !header.Exists() || !payload.Exists() { + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + + } + domain := gjson.GetBytes(jsonData, "header.semantic.domain").String() + intent := gjson.GetBytes(jsonData, "header.semantic.intent").String() + // slots := gjson.GetBytes(jsonData, "header.semantic.slots").Array() + //resultTexts := gjson.GetBytes(jsonData, "payload.response_text") + switch intent { + case "play", "play_album", "play_favorite", "choose_song", "play_operation_list", "change_bacth", "play_in_times": + resultUrl := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.audio.stream.url") + resultSinger := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.singer") + resultSong := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.song") + resultSongId := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.songId") + resultText := gjson.GetBytes(jsonData, "payload.response_text") + resultLen := len(resultUrl.Array()) + var reportDatas []model.TencentReport + var reportData model.TencentReport + resultMediaId := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.mediaId") + if resultLen != 0 && resultLen == len(resultSinger.Array()) && resultLen == len(resultSong.Array()) { + for i := 0; i < resultLen; i++ { + if i == 0 { + items = `{"url":` + resultUrl.Array()[i].Raw + `,"singer":` + resultSinger.Array()[i].Raw + + `,"song":` + resultSong.Array()[i].Raw + `,"mediaId":` + resultMediaId.Array()[i].Raw + `,"songId":` + resultSongId.Array()[i].Raw + `}` + + } else { + items += `,{"url":` + resultUrl.Array()[i].Raw + `,"singer":` + resultSinger.Array()[i].Raw + + `,"song":` + resultSong.Array()[i].Raw + `,"mediaId":` + resultMediaId.Array()[i].Raw + `,"songId":` + resultSongId.Array()[i].Raw + `}` + } + reportData.UserId = "test" + reportData.Domain = "music" + reportData.Intent = gjson.GetBytes(jsonData, "header.semantic.intent").String() + reportData.ResourceId = resultMediaId.Array()[i].String() + reportData.DataSource = "..." + if reportData.ResourceId != "" { + reportDatas = append(reportDatas, reportData) + } + } + } else { // 列表为空时也需要进行回复语提示 + // chat回复需修改 + if global.GetLimitedSetting(params.Mid).IsMusicRemid && tokenSearchResponse != nil { + if tokenSearchResponse.Data.Status == 3 { // 过期提醒 + return replyWithChat(expired_reply, domain+"."+intent) + } + if tokenSearchResponse.Data.Status != 2 { // 未授权提醒 + return replyWithChat(not_using_reply, domain+"."+intent) + } + } + return replyWithChat(resultText.String(), domain+"."+intent) + // 无法进行验证, 建议domain和intent改成chat + // return replyWithHeader(header.Raw, resultText.String()) + } + + response := resultText.String() + + // 鉴权-qq音乐 + // remind := "" + if global.GetLimitedSetting(params.Mid).IsMusicRemid && tokenSearchResponse != nil { + if tokenSearchResponse.Data.Status == 3 { // 过期提醒 + response = expired_reply + } else if tokenSearchResponse.Data.Status != 2 { // 未授权提醒 + response = not_using_reply + } + } + jsonStr := "" + if resultLen > 0 { + jsonStr = `{"header":` + header.Raw + `,"response_text":"` + response + `","listItems":[` + items + `]}` + return []byte(jsonStr) + } else { + // chat回复需修改 + return replyWithChat(resultText.String(), domain+"."+intent) + // 无法进行验证, 建议domain和intent改成chat + // return replyWithHeader(header.Raw, response) + + } + case "prev", "previous": + // previous 停止维护了 + resultUrl := gjson.GetBytes(jsonData, "payload.data.json_template.0.strDestURL") + resultStrData := gjson.GetBytes(jsonData, "payload.data.json_template.0.strData") + resultData := []byte(resultStrData.String()) + resultSinger := gjson.GetBytes(resultData, "person") + resultSong := gjson.GetBytes(resultData, "contentName") + resultText := gjson.GetBytes(jsonData, "payload.response_text") + resultSongId := gjson.GetBytes(resultData, "strId") + // 下一首,上一首均没有response_text + if resultUrl.Exists() { // 列表可能出现空的问题 + var singerStr, songStr, songIdStr string + singerStr = `""` + songStr = `""` + songIdStr = `""` + + if resultSinger.Exists() { + singerStr = resultSinger.Raw + } + if resultSong.Exists() { + songStr = resultSong.Raw + } + if resultSongId.Exists() { + songIdStr = resultSongId.Raw + } + + items = `{"url":` + resultUrl.Raw + `,"singer":` + singerStr + `,"song":` + songStr + `,"songId":` + songIdStr + `}` + + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `,"listItems":[` + items + `]}` + return []byte(jsonStr) + + } else { + return replyWithChat(resultText.String(), domain+"."+intent) + } + + // return []byte(jsonStr), nil + + // 禅道 #64 + case "pause", "pause_v2": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_PAUSE, nil) + case "next": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_NEXT, nil) + case "resume": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_RESUME, nil) + case "replay": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_REPLAY, nil) + case "stop": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_STOP, nil) + case "exit": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_EXIT, nil) + case "search_cur_song": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_QUERY_SONG, nil) + + case "ctrl_single_cycle", "ctrl_break_cycle", "ctrl_list_cycle", "ctrl_sequential", "ctrl_shuffle": + // intent 为 pause 与 resume, response_text为空字符串 + resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + // return []byte(jsonStr), nil + + return []byte(jsonStr) + case "search_singer", "query_song_editions", "search_song", "search_lyrics", "search_song_property", "search_album": + resultText := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + // return []byte(jsonStr), nil + return []byte(jsonStr) + case "search_prev_song": + return replyWithChat(shielded_reply, domain+"."+intent) + case "pay": + // 采用兜底话术 + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + responseText + `"}` + // return []byte(jsonStr), nil + return []byte(jsonStr) + // 2022年9月5日11:06:23 特殊处理, 更改"playmore", "dislike" 为 "play" + case "playmore": + var tempJson map[string]interface{} + _ = json.Unmarshal(jsonData, &tempJson) + tempJson["header"].(map[string]interface{})["semantic"].(map[string]interface{})["intent"] = "play" + jsonData, _ = json.Marshal(tempJson) + goto Start + case "dislike": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_NEXT, nil) + default: + // 其他intent会被屏蔽掉,返回不支持的兜底话术 + // 2021年7月24日15:42:41 优化兜底处理, 当带有资源列表的但intent字段为空字符串, intent赋值为"play" + resultUrl := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.audio.stream.url") + if len(resultUrl.Array()) > 0 && intent == "" { + // 更改jsonData + var tempJson map[string]interface{} + _ = json.Unmarshal(jsonData, &tempJson) + tempJson["header"].(map[string]interface{})["semantic"].(map[string]interface{})["intent"] = "play" + jsonData, _ = json.Marshal(tempJson) + goto Start + } + // 兜底 + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + responseText + `"}` + // return []byte(jsonStr), nil + return []byte(jsonStr) + } +} + +// 修复501问题 zww 2018-11-21 +// 修复intent为空时的判定问题 zww 2018-11-22 +func newsDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + responseText := "暂不支持该功能,我还在努力学习中" + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + intent := gjson.GetBytes(jsonData, "header.semantic.intent").String() + domain := gjson.GetBytes(jsonData, "header.semantic.domain").String() + + switch intent { + case "search", "playmore", "": + resultUrl := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.audio.stream.url") + resultFrom := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.newsFrom") + resultType := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.type") + resultText := gjson.GetBytes(jsonData, "payload.response_text") + resultTitle := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.title") + resultLen := len(resultUrl.Array()) + if resultLen != 0 && resultLen == len(resultFrom.Array()) && resultLen == len(resultType.Array()) { + for i := 0; i < resultLen; i++ { + /* + reportData.ResourceId = resultMediaId.Array()[i].String() + reportData.DataSource = resultSource.Array()[i].String() + reportStatus := semantic.ReportTencentStatus(reportData) + if nil == reportStatus { + fmt.Println("report error!") + } else { + fmt.Println(string(reportStatus)) + } + */ + if i == 0 { + items = `{"url":` + resultUrl.Array()[i].Raw + `,"newsFrom":` + resultFrom.Array()[i].Raw + + `,"newsType":` + resultType.Array()[i].Raw + `,"resultTitle":` + resultTitle.Array()[i].Raw + `}` + } else { + items += `,{"url":` + resultUrl.Array()[i].Raw + `,"newsFrom":` + resultFrom.Array()[i].Raw + + `,"newsType":` + resultType.Array()[i].Raw + `,"resultTitle":` + resultTitle.Array()[i].Raw + `}` + } + } + } else if resultLen == 0 { + // 修改: 2021年7月16日15:25:15, 家技部要求以chat进行回复 + // jsonStr := `{"header":` + header.Raw + `,"response_text":"` + resultText.Str + `"}` + // return []byte(jsonStr) + return replyWithChat(resultText.Str, domain) + } else { + //items = `{"code":501,"errorType":"result length of url/singer/song does not math!"}` + items = `{"header":` + header.Raw + `,"response_text":"` + reply_when_tencent_empty + `"}` + return []byte(items) + } + if resultText.Str == "" { + responseText = "为你找到以下新闻:" + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + responseText + `","listItems":[` + items + `]}` + return []byte(jsonStr) + } + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `,"listItems":[` + items + `]}` + return []byte(jsonStr) + case "replay_all", "next", "previous", "pause", "stop", "resume", "replay_present": + // next, previous pause resume stop 的response_text为空字符串 + resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + return []byte(jsonStr) + default: + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + responseText + `"}` + return []byte(jsonStr) + } +} + +// tencent weather domain +func weatherDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + var test string + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + //植入广告 + //ad := "格力空调祝您生活愉快。" + tips := "" //温馨提示 + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":500,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + + //resultText := gjson.GetBytes(jsonData, "payload.response_text") + //jsonStr := `{"header":` + header.String() + `,"response_text":"`+ resultText.String() + ad +`"}` + resultComplete := gjson.GetBytes(jsonData, "header.semantic.session_complete") + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + weatherIndex := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.selfData.vecCityWeatherInfo.0."+ + "stDobbyCurrentWeather.sDWeaIndex").String() + if weatherIndex == "3" || weatherIndex == "4" || weatherIndex == "5" || weatherIndex == "6" { + tips = weatherReplyMessage[getRandom(len(weatherReplyMessage))] + } + + if resultComplete.String() == "true" { + test = resultContent.String() + tips + } else { + test = resultContent.String() + } + test = resultContent.Raw + jsonStr := "" + /* //展厅I-铂II 视频拍摄 + if mac == "f4911e56854f" { + locationCity := "" + slotsNames := gjson.GetBytes(jsonData, "header.semantic.slots.#.name").Array() + slotsValues := gjson.GetBytes(jsonData, "header.semantic.slots.#.value").Array() + for i := 0; i < len(slotsNames); i++ { + if slotsNames[i].Str == "location" { + locationCity = slotsValues[i].Str + break; + } + } + if locationCity == "珠海" || locationCity == "珠海市" { + testForSmartHosuse := "珠海市今天多云,气温26度到33度,空气质量优" + jsonStr = `{"header":` + header.Raw + `,"response_text":"`+ testForSmartHosuse +`"}` + return []byte(jsonStr) + } + } + */ + + // 增加带屏设备的输出 + if !global.GetLimitedSetting(params.Mid).Memory { + listItems := gjson.GetBytes(jsonData, "payload.data.json.listItems") + jsonStr = `{"header":` + header.Raw + `,"response_text":` + test + `,"listItems":` + listItems.Raw + `}` + return []byte(jsonStr) + } else { + jsonStr = `{"header":` + header.Raw + `,"response_text":` + test + `}` + return []byte(jsonStr) + } +} + +// zww 2018-11-21 修复返回url为空的问题 +func poemDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + query := params.Query + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + // domain := gjson.GetBytes(jsonData, "header.semantic.domain").String() + intent := gjson.GetBytes(jsonData, "header.semantic.intent").String() + resultType := gjson.GetBytes(jsonData, "payload.data.json.controlInfo.type") + resultUrl := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.audio.stream.url") + resultTitle := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.title") + // 缺少mediaId + resultMediaId := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.mediaId") + + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.textContent") + resultText := gjson.GetBytes(jsonData, "payload.response_text") + author := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.author") + dynasty := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.dynasty") + title := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.title") + //if resultText.String() == "" { + // resultText = gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + //} + resultLen := len(resultUrl.Array()) + if resultLen == len(resultTitle.Array()) && resultLen == len(resultContent.Array()) && resultLen == len(author. + Array()) { + if resultType.String() == "AUDIO" { + for i := 0; i < resultLen; i++ { + + if resultUrl.Array()[i].Str == "" { + continue + } + authorI := "" + dynastyI := "" + titleI := "" + if len(author.Array()) == resultLen && resultLen > 0 { + authorI = author.Array()[i].Raw + dynastyI = dynasty.Array()[i].Raw + titleI = title.Array()[i].Raw + } + + if i == 0 { + items = `{"type":` + resultType.Raw + `,"url":` + resultUrl.Array()[i].Raw + `,"title":` + titleI + `,"content":` + + resultContent.Array()[i].Raw + `,"author":` + authorI + `,"dynasty":` + dynastyI + `,"mediaId":` + resultMediaId.Array()[i].Raw + `}` + } else { + if items != "" { + items += `,{"type":` + resultType.Raw + `,"url":` + resultUrl.Array()[i].Raw + `,"title":` + titleI + `,"content":` + + resultContent.Array()[i].Raw + `,"author":` + authorI + `,"dynasty":` + dynastyI + `,"mediaId":` + resultMediaId.Array()[i].Raw + `}` + } else { + items = `{"type":` + resultType.Raw + `,"url":` + resultUrl.Array()[i].Raw + `,"title":` + titleI + + `,"content":` + resultContent.Array()[i].Raw + `,"author":` + authorI + `,"dynasty":` + dynastyI + + `,"mediaId":` + resultMediaId.Array()[i].Raw + `}` + } + } + } + } else { + for i := 0; i < resultLen; i++ { + if resultContent.Array()[i].Str == "" { + continue + } + if i == 0 { + items = `{"type":` + resultType.Raw + `,"url":` + resultUrl.Array()[i].Raw + `,"title":` + resultTitle.Array()[i].Raw + + `,"content":` + resultContent.Array()[i].Raw + `,"mediaId":` + resultMediaId.Array()[i].Raw + `}` + } else { + if items != "" { + items += `,{"type":` + resultType.Raw + `,"url":` + resultUrl.Array()[i].Raw + `,"title":` + resultTitle.Array()[i].Raw + + `,"content":` + resultContent.Array()[i].Raw + `,"mediaId":` + resultMediaId.Array()[i].Raw + `}` + } else { + items = `{"type":` + resultType.Raw + `,"url":` + resultUrl.Array()[i].Raw + `,"title":` + resultTitle.Array()[i].Raw + + `,"content":` + resultContent.Array()[i].Raw + `,"mediaId":` + resultMediaId.Array()[i].Raw + `}` + } + + } + + } + } + } else { + //items = `{"code":501,"errorType":"result length of url/title/content does not math!"}` + items = `{"header":` + header.Raw + `,"response_text":"` + reply_when_tencent_empty + `"}` + return []byte(items) + } + + switch intent { + // 特殊处理 2022年9月5日11:35:44 对next进行协议转换 + case "next": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_NEXT, nil) + case "search_ancientpoem_meaning", "search_ancientpoem_appreciation", "search_ancientpoem_chains": + var jsonStr string + if resultContent.Exists() && len(resultContent.Array()) > 0 { + var resText = resultText.String() + resultContent.Array()[0].String() + resText = strconv.Quote(resText) + + jsonStr = `{"header":` + header.Raw + `,"response_text":` + resText + `,"listItems":[` + items + `]}` + } else { + jsonStr = `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `,"listItems":[` + items + `]}` + } + fmt.Println("#######################") + fmt.Println(jsonStr) + + return []byte(jsonStr) + default: + + if items == "" { + items = `{"type":"TEXT","url":"","title":"","content":"` + "这首诗我还不会,等学会了再来告诉你吧" + `"}` + jsonStr := `{"header":` + header.Raw + `,"response_text":"这首诗我还不会,等学会了再来告诉你吧","listItems":[` + items + `]}` + return []byte(jsonStr) + } + var responseText string + if resultText.String() == "" && resultContent.Exists() && len(resultContent.Array()) > 0 { + responseText = resultContent.Array()[0].Raw + } else { + responseText = resultText.Raw + } + jsonStr := `{"header":` + header.Raw + `,"response_text":` + responseText + `,"listItems":[` + items + `]}` + return []byte(jsonStr) + } +} + +// tencent fm(story) domain ("\"Gjson 会自动删除转义字符) +func fmDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + query := params.Query + +Start: + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + responseText := "暂不支持该功能,我还在努力学习中" + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + domain := gjson.GetBytes(jsonData, "header.semantic.domain").String() + intent := gjson.GetBytes(jsonData, "header.semantic.intent").String() + switch intent { + case "play_radio", "query_album_update", "play", "search_radio", "search_anchor", "query_cur_play", "change": + resultUrl := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.audio.stream.url") + resultTitle := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.title") + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.textContent") + resultText := gjson.GetBytes(jsonData, "payload.response_text") + resultLen := len(resultUrl.Array()) + resultMediaId := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.mediaId") + eShowType := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.selfData.eShowType") + + slotsNames := gjson.GetBytes(jsonData, "header.semantic.slots.#.name").Array() + slotsValues := gjson.GetBytes(jsonData, "header.semantic.slots.#.value").Array() + // ap和儿童空调均无此判断逻辑 + for i := 0; i < len(slotsNames); i++ { + if slotsNames[i].String() == "album" { + // 屏蔽资源 + for _, nonexistAlbum := range global.GetLimitedSetting(params.Mid).FmDomainAlbumList { + if slotsValues[i].String() == nonexistAlbum { + // chat 回复需修改 + return replyWithChat("很抱歉,暂时还没有相关资源", "fm") + // 已验证, 返回play intent 会继续播放音乐, 应该改成chat + // return replyWithHeader(header.Raw, reply_when_recourse_limited) + } + } + } + } + var responseText string = resultText.Raw + var liveUrlFlag bool = false + if resultLen != 0 && resultLen == len(resultTitle.Array()) && resultLen == len(resultContent.Array()) { + items = "" + for i := 0; i < resultLen; i++ { + if eShowType.Array()[i].Int() == 1 { + // eShowType为1时表示链接为直播类型, 过滤掉 + liveUrlFlag = true + continue + } + if len(items) == 0 { + items = `{"url":` + resultUrl.Array()[i].Raw + `,"title":` + resultTitle.Array()[i].Raw + + `,"content":` + resultContent.Array()[i].Raw + `,"mediaId":` + resultMediaId.Array()[i].Raw + `}` + } else { + items += `,{"url":` + resultUrl.Array()[i].Raw + `,"title":` + resultTitle.Array()[i].Raw + + `,"content":` + resultContent.Array()[i].Raw + `,"mediaId":` + resultMediaId.Array()[i].Raw + `}` + } + } + } else { + //items = `{"code":501,"errorType":"result length of url/title/content does not math!"}` + // 兜底的domain与儿童空调不一样, 儿童空调返回为闲聊 + // 当资源列表为空时, 要以chat进行返回, 否则会出现本机与app返回不一致 + // items = `{"header":` + header.Raw + `,"response_text":"` + reply_when_tencent_empty + `"}` + //utils.LogErrorToFile(logfileError, tencent_response_error + " fm电台 ") + // return []byte(items) + response_raw := resultText.Raw + response_text := response_raw[1 : len(response_raw)-1] + + return replyWithChat(response_text, domain+"."+intent) + + } + // 更改直播类型链接的回复语 + if liveUrlFlag && items == "" { + responseText = "\"小格没有找到相关的资源哦\"" + } + jsonStr := `{"header":` + header.Raw + `,"response_text":` + responseText + `,"listItems":[` + items + `]}` + return []byte(jsonStr) + // case "next", "prev": + // resultUrl := gjson.GetBytes(jsonData, "payload.data.json_template.0.strDestURL") + // resultText := gjson.GetBytes(jsonData, "payload.response_text") + // items = `{"url":"` + resultUrl.Str + `"}` + // jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `,"listItems":[` + items + `]}` + // return []byte(jsonStr) + + // 2022年9月5日11:51:58 协议转换 next, prev, + case "next": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_NEXT, nil) + case "prev": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_PREVIOUS, nil) + // 禅道 #71 + case "pause": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_PAUSE, nil) + case "exit": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_EXIT, nil) + case "stop": + return transformGreeProtocolReply(query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_STOP, nil) + + case "resume": + resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + return []byte(jsonStr) + // playmore + case "playmore": + // 列表为空 + var tempJson map[string]interface{} + _ = json.Unmarshal(jsonData, &tempJson) + tempJson["header"].(map[string]interface{})["semantic"].(map[string]interface{})["intent"] = "play" + jsonData, _ = json.Marshal(tempJson) + goto Start + + default: + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + responseText + `"}` + return []byte(jsonStr) + } + +} + +func sportsDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + results := gjson.GetBytes(jsonData, "payload.data.json.listItems").Array() + if len(results) == 0 { + //items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + items = `{"header":` + header.Raw + `,"response_text":"` + reply_when_tencent_empty + `"}` + return []byte(items) + } + resultText := results[0].Get("textContent") + //resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + return []byte(jsonStr) + +} + +// Tencent joke domain +func jokeDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + // 修复腾讯返回空资源的问题, testStr为错误示例 + // testStr := `{"header":{"semantic":{"code":0,"domain":"joke","intent":"next","msg":"","session_complete":true,"skill_id":"990835372646862848"}},"payload":{"data":{"json":{"controlInfo":{"audioConsole":"true","backgroundImageValid":"true","orientation":"portrait","subTitleSpeak":"true","textSpeak":"true","titleSpeak":"true","type":"NONE","version":"1.0.0"},"listItems":[{"audio":{"stream":{"url":""}},"mediaId":"","title":""}]}},"response_text":"","ret":0}}` + // jsonData = []byte(testStr) + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + + domainStr := gjson.GetBytes(jsonData, "header.semantic.domain").String() + intentStr := gjson.GetBytes(jsonData, "header.semantic.intent").String() + + typeStr := gjson.GetBytes(jsonData, "payload.data.json.controlInfo.type").String() + // 只接受音频类数据 + if typeStr != "AUDIO" { + return replyWithChat(reply_when_tencent_empty, domainStr+"."+intentStr) + } + + resultText := gjson.GetBytes(jsonData, "payload.response_text") + listItems := gjson.GetBytes(jsonData, "payload.data.json.listItems") + + // 校验listItems 修复因listItems缺少对应的字段导致的错误 + if len(listItems.Array()) > 0 { // 校验是否为空列表 + // 校验字段是否存在 + isUrlExist := gjson.GetBytes([]byte(listItems.Array()[0].Raw), "audio.stream.url").Exists() + isTextContentExist := gjson.GetBytes([]byte(listItems.Array()[0].Raw), "textContent").Exists() + + // 缺少字段, 返回兜底 + if !isUrlExist || !isTextContentExist { + return replyWithChat(reply_when_tencent_empty, domainStr+"."+intentStr) + } + } else { + // 空列表返回兜底 + return replyWithChat(reply_when_tencent_empty, domainStr+"."+intentStr) + } + + resultUrl := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.audio.stream.url") + // ap 解析了textContent字段, content字段有换行符 + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.textContent") + // 获取长度 + resultUrlLength := len(resultUrl.Array()) + resultContentLength := len(resultContent.Array()) + + // 重复请求获取列表策略 + //lenth := len(resultUrl.Array()) + //if lenth == 1 { + // for j := 0; j < 3; j++ { + // var dataReq semantic.SemanticReq + // dataReq.Query = "下一个笑话" + // if j == 0 { + // items = `{"url":`+ resultUrl.Array()[0].Raw + `}` + // } else { + // tencentRespByteData, err := semantic.GetTencentNLUData(&dataReq) + // if nil != err { + // items += `,{"url":`+ "" + `}` + // } else { + // resultUrl := gjson.GetBytes(tencentRespByteData,"payload.data.json.listItems.0.audio.stream.url") + // items += `,{"url":`+ resultUrl.Raw + `}` + // } + // } + // } + //} else { + // for i, item := range resultUrl.Array() { + // if i == 0 { + // items = `{"url":`+ item.Raw + `}` + // } else { + // items += `,{"url":`+ item.Raw + `}` + // } + // } + //} + + // 腾讯返回的 resultUrlLength 和 resultContentLength 不一致的情况, 导致数组越界, 缺少字段导致为空 + if resultUrlLength != 0 && resultUrlLength == resultContentLength { + for i, item := range resultUrl.Array() { + var contentStr string + contentStr = resultContent.Array()[i].Raw + + if i == 0 { + items = `{"url":` + item.Raw + `,"content":` + contentStr + `}` + } else { + items += `,{"url":` + item.Raw + `,"content":` + contentStr + `}` + } + } + } else { + // 资源列表为空, 或者长度不一致的情况 + responseText := resultText.String() + if responseText == "" { + responseText = reply_when_tencent_empty + } + return replyWithChat(responseText, domainStr+"."+intentStr) + + } + + //resultMediaId := gjson.GetBytes(jsonData,"payload.data.json.sMongoNewId") + // resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `,"listItems":[` + items + `]}` + return []byte(jsonStr) +} + +// zww +func astroDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + results := gjson.GetBytes(jsonData, "payload.data.json.listItems").Array() + if len(results) == 0 { + //items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + items = `{"header":` + header.Raw + `,"response_text":"` + reply_when_tencent_empty + `"}` + return []byte(items) + } + resultText := results[0].Get("textContent") + //resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + return []byte(jsonStr) +} + +// Tencent holiday domain +func holidayDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultContent.Raw + `}` + return []byte(jsonStr) +} + +// Tencent stock domain +func stockDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + //resultText := gjson.GetBytes(jsonData, "payload.response_text") + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultContent.Raw + `}` + return []byte(jsonStr) +} + +// Tencent translate domain +func translateDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + items := "" + var response_text string + response_text = resultContent.String() + + // TODO: 针对个别空调特殊处理 + slots := gjson.GetBytes(jsonData, "header.semantic.slots").Array() + for i := 0; i < len(slots); i++ { + if key, ok := slots[i].Map()["name"]; ok && key.String() == "language" { + if value, ok := slots[i].Map()["value"]; ok && !(value.String() == "英语" || value.String() == "中文") { + response_text = "当前仅支持中英文翻译。" + } + } + } + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + response_text + `"}` + return []byte(jsonStr) +} + +func soundDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + resultType := gjson.GetBytes(jsonData, "payload.data.json.controlInfo.type") + resultText := gjson.GetBytes(jsonData, "payload.response_text").Str + resultUrl := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.audio.stream.url") + resultTitle := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.title") + //durationTime := gjson.GetBytes(jsonData, "payload.data.json.globalInfo.selfData.sDurationTime") + for i := 0; i < len(resultUrl.Array()); i++ { + if resultUrl.Array()[i].Str == "" { + continue + } + if i == 0 { + items = `{"type":` + resultType.Raw + `,"url":` + resultUrl.Array()[i].Raw + `,"title":` + resultTitle.Array()[i].Raw + `}` + } else { + items += `,{"type":` + resultType.Raw + `,"url":` + resultUrl.Array()[i].Raw + `,"title":` + resultTitle.Array()[i].Raw + `}` + } + } + //if durationTime.Raw != "" { + // jsonStr := `{"header":` + header.String() + `,"response_text":`+ resultText.Raw + `,"durationTime":`+ durationTime.Raw + `,"listItems":[` + items + `]}` + // return []byte(jsonStr) + //} + + if resultText == "" { + listItems := gjson.GetBytes(jsonData, "payload.data.json.listItems").Array() + if len(listItems) > 0 { + resultText = listItems[0].Get("textContent").Str + jsonStr := `{"header":` + header.String() + `,"response_text":"` + resultText + `","listItems":[` + items + `]` + return []byte(jsonStr) + } else { + jsonStr := `{"header":` + header.String() + `,"response_text":"` + reply_when_tencent_empty + `"}` + return []byte(jsonStr) + } + } else { + jsonStr := `{"header":` + header.String() + `,"response_text":"` + resultText + `","listItems":[` + items + `]` + return []byte(jsonStr) + } + +} + +// Tencent almanac domain +func almanacDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + resultText := gjson.GetBytes(jsonData, "payload.response_text") + if resultText.String() == "" { + resultText = gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + } + if resultText.String() == "" { + resultText = gjson.GetBytes(jsonData, "payload.data.json.globalInfo.selfData.noSupport") + } + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + return []byte(jsonStr) +} + +// Tencent finance domain +func financeDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + resultText := gjson.GetBytes(jsonData, "payload.response_text") + if resultText.String() == "" { + resultText = gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + } + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + return []byte(jsonStr) +} + +func cityinfoDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + domain := params.Domain + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + + //resultText := gjson.GetBytes(jsonData, "payload.response_text") + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + // chat回复需修改 + jsonStr := replyWithChat(strings.Replace(resultContent.String(), "\n", "", -1), domain) + // 已验证, 无法进行正常播报, 建议domain和intent改为chat + // jsonStr := replyWithHeader(header.Raw, strings.Replace(resultContent.String(), "\n", "", -1)) + //jsonStr := `{"header":` + header.Raw + `,"response_text":`+ resultContent.Raw + `}` + return jsonStr +} + +// Tencent general_question_answering domain +func generalQADomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + // chat回复需修改 + return replyWithChat(resultContent.Str, "general_question_answering") + // 已验证, 无法进行正常播报, 建议domain和intent改为chat + // return replyWithHeader(header.Raw, resultContent.Str) + //jsonStr := `{"header":` + header.Raw + `,"response_text":`+ resultContent.Raw + `}` + //return []byte(jsonStr) +} + +// Tencent common_qa domain +func commonQADomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + //jsonStr := `{"header":` + header.Raw + `,"response_text":`+ resultContent.Raw + `}` + // chat回复需修改 + response_text := resultContent.String() + response_text = strings.Replace(response_text, "\n", "", -1) + return replyWithChat(response_text, "common_qa") + // 无法进行验证, 建议domain和intent改成chat + // return replyWithHeader(header.Raw, resultContent.Str) + /* + jsonStr := `{ + "header": { + "semantic": { + "code": 0, + "domain": "chat", + "intent": "chat", + "msg": "", + "session_complete": true, + "skill_id": "221364_common_qa" + } + }, + "response_text": ` + resultContent.Raw + ` + }` + + return []byte(jsonStr) + */ +} + +func baikeDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + + var text string + textContents := gjson.GetBytes(jsonData, "payload.data.json.listItems.#.textContent") + resultContent := gjson.GetBytes(jsonData, "payload.data.json_template.0.strContentData") + if len(textContents.Array()) > 0 && textContents.Array()[0].String() != "" { + text = textContents.Array()[0].Raw + } else { + text = resultContent.Raw + } + + //jsonStr := `{"header":` + header.Raw + `,"response_text":`+ test + `,"listItems":`+ resultListItems.Raw +`}` + jsonStr := `{"header":` + header.Raw + `,"response_text":` + text + `}` + return []byte(jsonStr) +} + +// Tencent chenyu domain +func chengyuDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + + //resultText := gjson.GetBytes(jsonData, "payload.response_text") + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent") + // chat回复需修改 + jsonStr := replyWithChat(resultContent.String(), "chengyu") + // 已验证, 无法进行正常播报, 建议domain和intent改为chat + // jsonStr := replyWithHeader(header.Raw, resultContent.String()) + //jsonStr := `{"header":` + header.Raw + `,"response_text":`+ resultContent.Raw + `}` + return jsonStr +} + +// Tencent science domain +func scienceDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + intentString := gjson.GetBytes(jsonData, "header.semantic.intent").String() + + if intentString == "calculator" { + resultText := "" + calResult := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.selfData.sResult").String() + if calResult == "" { + resultText = gjson.GetBytes(jsonData, "payload.response_text").String() + } else { + resultText = "等于" + calResult + } + + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + resultText + `"}` + return []byte(jsonStr) + } else { + resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + return []byte(jsonStr) + } +} + +// Tencent recipe domain +func recipeDomain(params *model.DomainParams) []byte { + // jsonData := params.JsonData + + // header := gjson.GetBytes(jsonData, "header") + //resultText := gjson.GetBytes(jsonData, "payload.response_text") + //resultText := "一道好菜很难通过三言两语描述清楚,建议您浏览相关菜谱网站。" + // 区别返回, 带屏与非带屏需要做差异化 + if global.GetLimitedSetting(params.Mid).Recipe { + resultText := recipeReply[getRandom(len(recipeReply))] + // chat回复需修改 + return replyWithChat(resultText, "recipe") + // 已验证, 无法进行正常播报, 建议domain和intent改为chat + // return replyWithHeader(header.Raw, resultText) + } else { + jsonData := params.JsonData + header := gjson.GetBytes(jsonData, "header") + resultText := gjson.GetBytes(jsonData, "payload.response_text").String() + listItems := gjson.GetBytes(jsonData, "payload.data.json.listItems") + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + resultText + `", "listItems":` + listItems.Raw + `}` + return []byte(jsonStr) + } + + /* + jsonStr := `{"header":` + header.Raw + `,"response_text":"`+ resultText + `"}` + return []byte(jsonStr) + */ +} + +// Tencent history domain +func historyDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + domainStr := gjson.GetBytes(jsonData, "header.semantic.domain").String() + intentStr := gjson.GetBytes(jsonData, "header.semantic.intent").String() + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + //intent := gjson.GetBytes(jsonData, "header.semantic.intent") + items := "" + + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items = `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent").String() + resStra := strings.Trim(strings.Replace(resultContent, "\n", ",", -1), ",") + var resStrb string + historyDays := strings.Split(resStra, ",") + var l int + if len(historyDays) < global.GetLimitedSetting(params.Mid).HistoryNum { + l = len(historyDays) + } else { // 使用限制的条数 + l = global.GetLimitedSetting(params.Mid).HistoryNum + } + if l < 0 { // 不作限制 + resStrb = resStra + } else { + for i := 0; i < l; i++ { // 进行条数限制, 无屏空调内存受限 + resStrb += fmt.Sprintf("%s,", historyDays[i]) + } + } + + //strings.LastIndex(resStra, ",") + // chat回复需修改 + return replyWithChat(resStrb, domainStr+"."+intentStr) + // 已验证, 无法进行正常播报, 建议domain和intent改为chat + // return replyWithHeader(header.Raw, resStrb) +} + +/* +//增加敏感词过滤 zww 2018-11-21 +func chatDomain(jsonData []byte) []byte { + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + code := gjson.GetBytes(jsonData, "header.semantic.code").String() + if code == "0" { + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent").Str + //resultContent = filter.WordReplace(resultContent) //替换聊天域中的腾讯关键字 + jsonStr := `{"header":` + header.Raw + `,"response_text":"`+ resultContent + `"}` + return []byte(jsonStr) + } else { + resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":`+ resultText.Raw + `}` + return []byte(jsonStr) + } +} +*/ +//增加敏感词过滤 zww 2018-11-21 +//取消敏感词过滤 zww 2018-12-04 +func chatDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + code := gjson.GetBytes(jsonData, "header.semantic.code").String() + if code == "0" { + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent").Str + //resultContent = filter.WordReplace(resultContent) //替换聊天域中的腾讯关键字 //取消 + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + resultContent + `"}` + return []byte(jsonStr) + } else if code == "-3" { + resultContent := gjson.GetBytes(jsonData, "header.semantic.msg").Str + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + resultContent + `"}` + return []byte(jsonStr) + } else { + resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":` + resultText.Raw + `}` + return []byte(jsonStr) + } +} + +// 地理领域 zww 2018-12-04 +func geographyDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + domainStr := gjson.GetBytes(jsonData, "header.semantic.domain").String() + intentStr := gjson.GetBytes(jsonData, "header.semantic.intent").String() + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + // 处于逻辑与ap保持一致 + responseTextStr := gjson.GetBytes(jsonData, "payload.response_text").Str + textContentStr := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent").Str + var resultTextStr string + if responseTextStr != "" { + resultTextStr = responseTextStr + } else if textContentStr != "" { + resultTextStr = textContentStr + } else { + resultTextStr = reply_when_geography_empty + } + + // chat回复需修改 + return replyWithChat(resultTextStr, domainStr+"."+intentStr) + // 已验证, 无法进行正常播报, 建议domain和intent改为chat + // return replyWithHeader(header.Raw, resultTextStr) + /* + jsonStr := `{ + "header": { + "semantic": { + "code": 0, + "domain": "chat", + "intent": "chat", + "msg": "", + "session_complete": true, + "skill_id": "221364_geography" + } + }, + "response_text": ` + resultText.Raw + ` + }` + + //jsonStr := `{"header":` + header.Raw + `,"response_text":`+ resultText.Raw + `}` + return []byte(jsonStr) + */ +} + +// alarm domain zww 2018-11-30 +func alarmDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + mac := params.Mac + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + responseText := gjson.GetBytes(jsonData, "payload.response_text") + if !header.Exists() || !payload.Exists() { + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + + //header = gjson.GetBytes([]byte(doudiJsonTencent), "header") //暂时以聊天域返回 + + intent := gjson.GetBytes(jsonData, "header.semantic.intent") + domain := gjson.GetBytes(jsonData, "header.semantic.domain") + + // ret 标识是否成功 + ret := gjson.GetBytes(jsonData, "payload.ret").Int() + + isSessionCompleted := gjson.GetBytes(jsonData, "header.semantic.session_complete").Bool() + var alarmDBData model.AlarmRemindInfo + alarmDBData.Mac = mac + alarmDBData.Note = "" + alarmDBData.URL = "" + alarmDBData.Speech_Type = onlyTTS + alarmDBData.Createtime = time.Now().String()[:19] + items := "" + //alarmSlotsName := gjson.GetBytes(jsonData, "header.semantic.slots.#.name") + //alarmSlotsValue := gjson.GetBytes(jsonData, "header.semantic.slots.#.value") + var startAlarmList []gjson.Result + var repeatTypeList []gjson.Result + var notes []gjson.Result + var affectAlarm []gjson.Result + var affectAlarmRepeaet []gjson.Result + var affectAlarmNote []gjson.Result + var idList []gjson.Result + var affectIdList []gjson.Result + + if domain.Str == "alarm" { + idList = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAlarmCell.#.lId").Array() + startAlarmList = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAlarmCell.#.lStart").Array() + repeatTypeList = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAlarmCell.#.eRepeatType").Array() + notes = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAlarmCell.#.sNote").Array() + affectIdList = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectAlarmCell.#.lId").Array() + affectAlarm = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectAlarmCell.#.lStart").Array() + affectAlarmRepeaet = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectAlarmCell.#.eRepeatType").Array() + affectAlarmNote = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectAlarmCell.#.sNote").Array() + //alarmDBData.E_type = remind + alarmDBData.E_type = alarm + } else if domain.Str == "reminder_v2" { + idList = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vReminderCell.#.lId").Array() + startAlarmList = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vReminderCell.#.lStart").Array() + repeatTypeList = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vReminderCell.#.eRepeatType").Array() + notes = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vReminderCell.#.sNote").Array() + affectIdList = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectReminderCell.#.lId").Array() + affectAlarm = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectReminderCell.#.lStart").Array() + affectAlarmRepeaet = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectReminderCell.#.eRepeatType").Array() + affectAlarmNote = gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectReminderCell.#.sNote").Array() + alarmDBData.E_type = remind + } else { + jsonStr := `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } + for i := 0; i < len(startAlarmList); i++ { + repeaetType := int(repeatTypeList[i].Int()) + contentTTS := "" + if alarmDBData.E_type == remind { + if notes[i].Str != "" { + contentTTS = alarm_remind_common + notes[i].Str + } else { + contentTTS = alarm_remind_raw + } + } + + if i == 0 { + items = `{"id":"` + strconv.FormatInt(idList[i].Int(), 10) + `","speechType":` + onlyTTS + `,"type":` + alarmDBData.E_type + `,"url":"` + "" + `","note":"` + + notes[i].Str + `", "repeatType":` + strconv.Itoa(repeaetType) + `, "start":` + strconv.FormatInt(startAlarmList[i].Int(), 10) + `, "content":"` + contentTTS + `"}` + } else { + items += `,{"id":"` + strconv.FormatInt(idList[i].Int(), 10) + `","speechType":` + onlyTTS + `,"type":` + alarmDBData.E_type + `,"url":"` + "" + `", "note":"` + notes[i].Str + `", "repeatType":` + strconv.Itoa(repeaetType) + `, "start":` + strconv.FormatInt(startAlarmList[i].Int(), 10) + `, "content":"` + contentTTS + `"}` + } + + //与同步接口同步更改 2019-07-10 DONE:2019-07-15 + //需要做差异化 + // if i == 15 { + if i >= global.GetLimitedSetting(params.Mid).AlarmNum && global.GetLimitedSetting(params.Mid).AlarmNum >= 0 { + break + } + } + + if intent.Str == "new" { + jsonStr := "" + if !isSessionCompleted { + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `, "listItems":[` + items + `]}` + return []byte(jsonStr) + } + /* old + if len(alarmSlotsName.Array()) == 0 { + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } else if len(alarmSlotsName.Array()) == 1 { //循环 + if alarmSlotsName.Array()[0].Str == "date" { + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } else if alarmSlotsName.Array()[0].Str == "time" { //循环 + eTime := strings.TrimSpace(alarmSlotsValue.Array()[0].Str) + eTimeT, _ := time.ParseInLocation(datetimeLayout, time.Now().Format(dateLayout) + " "+ eTime, time.Local) + fmt.Println(eTimeT) + + + if time.Now().Before(eTimeT) { + eTimeStamp = strconv.FormatInt(eTimeT.Unix(), 10) + + } else { + var errt error + eTimeT, errt = time.ParseInLocation(datetimeLayout, time.Now().Add(time.Hour * 24).Format(dateLayout) + " " + eTime, time.Local) + if errt != nil { + fmt.Println(errt.Error() + "time.Parse") + } + eTimeStamp = strconv.FormatInt(eTimeT.Unix(), 10) + } + + + alarmDBData.E_date = "1993-09-03" + alarmDBData.E_time = eTime + //return []byte(jsonStr) + } else { + jsonStr := `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } + //return []byte(jsonStr) + } else if len(alarmSlotsName.Array()) >= 2 { + + for i := 0; i < len(alarmSlotsName.Array()); i++ { + if alarmSlotsName.Array()[i].Str == "date" { + alarmDBData.E_date = alarmSlotsValue.Array()[i].Str + } else if alarmSlotsName.Array()[i].Str == "time" { + alarmDBData.E_time = alarmSlotsValue.Array()[i].Str + } else if alarmSlotsName.Array()[i].Str == "note" { + if len(affectAlarmRepeaet) == 1 { + alarmDBData.Note = affectAlarmNote[0].Str + } else { + utils.LogErrorToFile(logfileError, "alarmDoamin.new:len(affectAlarmRepeaet)>1") + //fmt.Println("alarmDoamin.new:len(affectAlarmRepeaet)>1") + } + //alarmDBData.Note = alarmSlotsValue.Array()[i].Str + } + } + + eTimeT, _ := time.ParseInLocation(datetimeLayout, alarmDBData.E_date + " " + alarmDBData.E_time, time.Local) + eTimeStamp = strconv.FormatInt(eTimeT.Unix(), 10) + fmt.Println(eTimeT) + //alarmDBData.Repeat_type = + + //jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + //return []byte(jsonStr) + } else { + jsonStr := `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } + */ + // ret != 0 时, 标识插入不成功, 不需要遍历闹钟列表, 直接返回 + if len(affectAlarm) == 0 || ret != 0 { + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } else { + for i := 0; i < len(affectAlarm); i++ { + + fmt.Println("[debug] formatTime Location:", time.Unix(affectAlarm[i].Int(), 0).Location()) + + formatTime := time.Unix(affectAlarm[i].Int(), 0).Local() + fmt.Println("[debug] formatTime:", formatTime) + + alarmDBData.Repeat_type = int(affectAlarmRepeaet[i].Int()) + if strconv.Itoa(alarmDBData.Repeat_type) == once { + alarmDBData.E_date = formatTime.String()[:10] + } else { + alarmDBData.E_date = formatTime.String()[:10] + //alarmDBData.E_date = time.Now().String()[:10] + + } + alarmDBData.Oid = strconv.FormatInt(affectIdList[i].Int(), 10) + alarmDBData.Note = affectAlarmNote[i].Str + if alarmDBData.Note != "" { + alarmDBData.Content = alarm_remind_common + alarmDBData.Note + } else { + if domain.Str == "reminder_v2" { + alarmDBData.Content = alarm_remind_raw + } + } + + alarmDBData.E_time = formatTime.String()[11:19] + fmt.Println("[debug] alarmDBData.E_time:", alarmDBData.E_time) + dao.SaveAlarmRemindData(alarmDBData) + } + } + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `, "listItems":[` + items + `]}` + //saveAlarmRemindData(alarmDBData) + return []byte(jsonStr) + } else if intent.Str == "delete" { + jsonStr := "" + if !isSessionCompleted { + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `, "listItems":[` + items + `]}` + //jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } else { + + //affectAlarm := gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectAlarmCell.#.lStart").Array() + //affectAlarmRepeaet := gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAffectAlarmCell.#.eRepeatType").Array() + /* + if len(affectAlarm) == 0 { + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } else if len(alarmSlotsName.Array()) == 1 { + //eTime := strings.TrimSpace(alarmSlotsValue.Array()[0].Str) + + for i := 0; i < len(affectAlarm); i++ { + formatTime := time.Unix(affectAlarm[i].Int(), 0) + alarmDBData.E_date = "1993-09-03" + alarmDBData.E_time = formatTime.String()[11:19] + alarmDBData.Repeat_type = int(affectAlarmRepeaet[i].Int()) + deleteAlarmRemindData(alarmDBData) + } + } else if len(alarmSlotsName.Array()) >= 2 { + for i := 0; i < len(affectAlarm); i++ { + formatTime := time.Unix(affectAlarm[i].Int(), 0) + alarmDBData.E_date = formatTime.String()[:10] + alarmDBData.E_time = formatTime.String()[11:19] + alarmDBData.Repeat_type = int(affectAlarmRepeaet[i].Int()) + deleteAlarmRemindData(alarmDBData) + } + } + */ + if len(affectAlarm) == 0 { + // 清空闹钟 + dao.DeleteAllAlarmRemindData(mac) + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } else { + for i := 0; i < len(affectAlarm); i++ { + formatTime := time.Unix(affectAlarm[i].Int(), 0) + alarmDBData.Repeat_type = int(affectAlarmRepeaet[i].Int()) + if strconv.Itoa(alarmDBData.Repeat_type) == once { + alarmDBData.E_date = formatTime.String()[:10] + alarmDBData.E_date = formatTime.String()[:10] + + } else { + } + alarmDBData.Oid = strconv.FormatInt(affectIdList[i].Int(), 10) + alarmDBData.E_time = formatTime.String()[11:19] + dao.DeleteAlarmRemindData(alarmDBData) + } + } + + //startAlarmList := gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAlarmCell.#.lStart").Array() + //repeatTypeList := gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAlarmCell.#.eRepeatType").Array() + jsonStr = `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `, "listItems":[` + items + `]}` + return []byte(jsonStr) + } + + } else if intent.Str == "check" { + jsonStr := "" + //startAlarmList := gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAlarmCell.#.lStart").Array() + //repeatTypeList := gjson.GetBytes(jsonData, "payload.data.json.stCalendarData.vAlarmCell.#.eRepeatType").Array() + dao.DeleteOverdueAlarmRemindData(mac) + responseTextStr := responseText.String() + // responseTextStr = "你一共有29个闹钟:第1个是今天下午5点07分的闹钟,第2个是今天下午5点08分的闹钟,第3个是今天下午5点10分的闹钟,第4个是今天下午5点11分的闹钟,第5个是今天下午5点12分的闹钟,第6个是今天下午5点13分的闹钟,第7个是今天下午5点14分的闹钟,第8个是今天下午5点16分的闹钟,第9个是今天下午5点17分的闹钟,第10个是今天下午5点18分的闹钟,第11个是今天下午5点19分的闹钟,第12个是今天下午5点20分的闹钟,第13个是今天下午5点21分的闹钟,第14个是今天下午5点23分的闹钟,第15个是今天下午5点24分的闹钟,第16个是今天下午5点26分的闹钟,第17个是今天下午5点27分的闹钟,第18个是今天下午5点29分的闹钟,第19个是今天下午5点30分的闹钟,第20个是今天下午5点32分的闹钟,第21个是今天下午5点33分的闹钟,第22个是今天下午5点34分的闹钟,第23个是今天下午5点35分的闹钟,第24个是今天下午5点36分的闹钟,第25个是今天下午5点38分的闹钟,第26个是今天下午5点41分的闹钟,第27个是今天下午5点42分的闹钟,第28个是明天下午2点整的闹钟,第29个是明天下午3点整的闹钟。" + + textArr := strings.Split(responseTextStr, ",") + idx := 0 + splitLength := len([]byte(",")) + // 经过循环idx 必然大于回复语的字节数 + for i := 0; i < len(textArr); i++ { + // 限制800字节 + tempL := len([]byte(textArr[i])) + if idx+tempL > 800 { + break + } + idx = idx + splitLength + idx = idx + tempL + } + textRaw := responseText.Raw + if idx < len([]byte(responseTextStr)) { + var tipsText string + if domain.Str == "alarm" { + tipsText = "。你设置的闹钟太多啦,我有点查不过来了。" + } else { + tipsText = "。你设置的提醒太多啦,我有点查不过来了。" + } + textByte := append([]byte(responseTextStr)[:idx-splitLength], []byte(tipsText)...) + textRaw = strconv.Quote(string(textByte)) + } + + if len(startAlarmList) == 0 { + // 清空闹钟 + dao.DeleteAllAlarmRemindData(mac) + jsonStr = `{"header":` + header.Raw + `, "response_text":` + textRaw + `, "listItems":[]}` + return []byte(jsonStr) + } else { + jsonStr = `{"header":` + header.Raw + `, "response_text":` + textRaw + `, "listItems":[` + items + `]}` + return []byte(jsonStr) + } + + } else { + jsonStr := `{"header":` + header.Raw + `, "response_text":` + responseText.Raw + `}` + return []byte(jsonStr) + } + +} + +func customChatDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + code := gjson.GetBytes(jsonData, "header.semantic.code").String() + + if code == "0" { + + resultContent := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent").String() + // chat回复需修改 + return replyWithChat(resultContent, gjson.GetBytes(jsonData, "header.semantic.domain").Str) + // 无法进行验证, 建议domain和intent改成chat + // return replyWithHeader(header.Raw, resultContent) + /* + jsonStr := `{ + "header": { + "semantic": { + "code": 0, + "domain": "chat", + "intent": "chat", + "msg": "", + "session_complete": true, + "skill_id": "221364_` + gjson.GetBytes(jsonData, "header.semantic.domain").Str + `" + } + }, + "response_text": "` + resultContent + `" + }` + return []byte(jsonStr) + */ + } else { + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + reply_when_tencent_empty + `"}` + return []byte(jsonStr) + } +} + +// 不进行register +func otherDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + // domain := gjson.GetBytes(jsonData, "header.semantic.domain").String() + // header := gjson.GetBytes(jsonData, "header") + resultText := reply_when_tencent_empty + //jsonStr := `{"header":` + header.Raw + `,"response_text":"`+ resultText + `"}` + //return []byte(jsonStr) + domain := gjson.GetBytes(jsonData, "header.semantic.domain") + // chat回复需修改 + return replyWithChat(resultText, domain.Str) + // 无法进行验证, 建议domain和intent改成chat + // return replyWithHeader(header.Raw, resultText) + /* + jsonStr := `{ + "header": { + "semantic": { + "code": 0, + "domain": "`+chatDomainStr+`", + "intent": "`+chatDomainStr+`", + "msg": "", + "session_complete": true, + "skill_id": "221364_other_` + domain.Str + `" + } + }, + "response_text": "` + resultText + `" + }` + return []byte(jsonStr) + */ + +} + +// 腾讯协议转换 globalctrl +func globalctrlDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + query := params.Query + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + intent := gjson.GetBytes(jsonData, "header.semantic.intent").String() + // 判断意图进行协议转换 + switch intent { + case "pause": + return transformGreeProtocolReply(query, "PlayControl", "control_pause", nil) + case "resume": + return transformGreeProtocolReply(query, "PlayControl", "control_resume", nil) + case "stop": + return transformGreeProtocolReply(query, "PlayControl", "control_stop", nil) + case "turn_down": + degree := gjson.GetBytes(jsonData, `header.semantic.slots.#[name="number"].value`) + if degree.Exists() { + semanticParams := make(map[string]interface{}) + semanticParams["degree"] = model.ParamsStr{Origin: degree.String(), Norm: degree.String(), Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_reduceVol", &semanticParams) + } + return transformGreeProtocolReply(query, "UniversalControl", "control_reduceVol", nil) + case "turn_up": + degree := gjson.GetBytes(jsonData, `header.semantic.slots.#[name="number"].value`) + if degree.Exists() { + semanticParams := make(map[string]interface{}) + semanticParams["degree"] = model.ParamsStr{Origin: degree.String(), Norm: degree.String(), Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_riseVol", &semanticParams) + } + return transformGreeProtocolReply(query, "UniversalControl", "control_riseVol", nil) + case "turn_up_max": + return transformGreeProtocolReply(query, "UniversalControl", "control_riseVolMax", nil) + case "turn_down_min": + return transformGreeProtocolReply(query, "UniversalControl", "control_reduceVolMin", nil) + case "turn_volume_to": + degree := gjson.GetBytes(jsonData, `header.semantic.slots.#[name="number"].value`) + if degree.Exists() { + semanticParams := make(map[string]interface{}) + semanticParams["degree"] = model.ParamsStr{Origin: degree.String(), Norm: degree.String(), Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_setVol", &semanticParams) + } + volumeto := gjson.GetBytes(jsonData, `header.semantic.slots.#[name="volumeto"].value`) + if volumeto.Exists() { + // 音量必须调到百分之二十 {"name":"volumeto","value":"20/100"} + // 处理分数 + if match, _ := regexp.MatchString("[0-9]+/[0-9]+", volumeto.String()); match { + numberList := strings.Split(volumeto.String(), "/") + if len(numberList) < 2 { + + return replyWithChat(error_reply, "doudi") + } + if match, _ := regexp.MatchString("^[0]+$", numberList[1]); !match { // 非零 + a, err := strconv.ParseFloat(numberList[0], 64) // 被除数 + if err != nil { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"jsonData": jsonData}}).Errorf("globalctrlDomain error. %s", err.Error()) + + return replyWithChat(error_reply, "doudi") + + } + b, err := strconv.ParseFloat(numberList[1], 64) // 除数 + if err != nil { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"jsonData": jsonData}}).Errorf("globalctrlDomain error. %s", err.Error()) + + return replyWithChat(error_reply, "doudi") + } + + semanticParams := make(map[string]interface{}) + semanticParams["degree"] = model.ParamsStr{Origin: strconv.Itoa(int(a / b * 100)), Norm: strconv.Itoa(int(a / b * 100)), Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_setVol", &semanticParams) + } else { // 除数为零 + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"jsonData": jsonData}}).Error("除数为零.") + + return replyWithChat(error_reply, "doudi") + } + + } + + // 处理其他类型数字 + semanticParams := make(map[string]interface{}) + semanticParams["degree"] = model.ParamsStr{Origin: volumeto.String(), Norm: volumeto.String(), Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_setVol", &semanticParams) + } + semanticParams := make(map[string]interface{}) + semanticParams["degree"] = model.ParamsStr{Origin: "50", Norm: "50", Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_setVol", &semanticParams) + case "turn_mid": + semanticParams := make(map[string]interface{}) + semanticParams["degree"] = model.ParamsStr{Origin: "50", Norm: "50", Code: 0} + return transformGreeProtocolReply(query, "UniversalControl", "control_setVol", &semanticParams) + case "next": + return transformGreeProtocolReply(query, "UniversalControl", "control_next", nil) + case "previous": + return transformGreeProtocolReply(query, "UniversalControl", "control_previous", nil) + // case "yes": + // return transformGreeProtocolReply(query, "SystemControl", "control_confirm", nil) + // case "no": + // return transformGreeProtocolReply(query, "SystemControl", "control_cancel", nil) + // resultText := gjson.GetBytes(jsonData, "payload.response_text") + // jsonStr := `{"header":` + header.Raw + `,"response_text":"` + resultText.Raw + `"}` + // return []byte(jsonStr) + case "mute": + return transformGreeProtocolReply(query, "SystemControl", "control_volumeOff", nil) + case "unmute": + return transformGreeProtocolReply(query, "SystemControl", "control_volumeOn", nil) + default: + resultText := gjson.GetBytes(jsonData, "payload.response_text") + jsonStr := `{"header":` + header.Raw + `,"response_text":"` + resultText.Raw + `"}` + return []byte(jsonStr) + } + +} + +// invention_qa_pairs +func inventionQaPairsDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + // 处于逻辑与ap保持一致 + responseTextStr := gjson.GetBytes(jsonData, "payload.response_text").Str + textContentStr := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent").Str + var resultTextStr string + if responseTextStr != "" { + resultTextStr = responseTextStr + } else if textContentStr != "" { + resultTextStr = textContentStr + } else { + resultTextStr = reply_when_geography_empty + } + return replyWithChat(resultTextStr, "invention_qa_pairs") +} + +// 植物问答 plants_kbqa +func plantsKbqaDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + + header := gjson.GetBytes(jsonData, "header") + payload := gjson.GetBytes(jsonData, "payload") + if !header.Exists() || !payload.Exists() { + //fmt.Println("json data header/payload dose not exists!") + items := `{"code":501,"errorType":"result header/payload dose not exists!"}` + return []byte(items) + } + responseTextStr := gjson.GetBytes(jsonData, "payload.response_text").Str + textContentStr := gjson.GetBytes(jsonData, "payload.data.json.listItems.0.textContent").Str + var resultTextStr string + if responseTextStr != "" { + resultTextStr = responseTextStr + } else if textContentStr != "" { + resultTextStr = textContentStr + } else { + resultTextStr = reply_when_geography_empty + } + return replyWithChat(resultTextStr, "plants_kbqa") +} + +// 屏蔽处理 +func shieldedDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + domainStr := gjson.GetBytes(jsonData, "header.semantic.domain").String() + intentStr := gjson.GetBytes(jsonData, "header.semantic.intent").String() + // 暂不支持此功能 + resultTextStr := shielded_reply + return replyWithChat(resultTextStr, domainStr+"."+intentStr) + +} + +// help +func helpDomain(params *model.DomainParams) []byte { + jsonData := params.JsonData + domainStr := gjson.GetBytes(jsonData, "header.semantic.domain").String() + intentStr := gjson.GetBytes(jsonData, "header.semantic.intent").String() + // 暂不支持此功能 + resultTextStr := "我可以控制空调开机、播放音乐、查询时间天气、调节温度,设置模式,例如您可以对我说,空调开机。" + return replyWithChat(resultTextStr, domainStr+"."+intentStr) +} diff --git a/service/tencentNlu/domainWs.go b/service/tencentNlu/domainWs.go new file mode 100644 index 0000000..fedef6a --- /dev/null +++ b/service/tencentNlu/domainWs.go @@ -0,0 +1,971 @@ +package tencentNlu + +import ( + "encoding/json" + "errors" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "strings" + + "github.com/tidwall/gjson" +) + +func baseParseWs(params *model.DomainParamsWs) (*model.ResponseBody, error) { + // 解析code domain intent slots 等 + var res model.ResponseBody + if !params.TencentNlpResp.CheckHeader() || !params.TencentNlpResp.CheckNlu() || !params.TencentNlpResp.CheckDm() || !params.TencentNlpResp.CheckSkill() { + // 响应体内容缺少 + return nil, errors.New("TencentNlpResp check error.") + } + code := params.TencentNlpResp.GetCode() + msg := params.TencentNlpResp.GetMessage() + domain := params.TencentNlpResp.GetDomain() + intent := params.TencentNlpResp.GetIntent() + // complete := params.TencentNlpResp.GetSessionComplete() // 当前会话是否结束, wss 不再下发该字段 + slots := params.TencentNlpResp.GetSlots() // 词槽 + text := params.TencentNlpResp.GetText() // 回复语 + sessionStatus := params.TencentNlpResp.GetSessionStatus() + + var resultComplete bool + if sessionStatus == 0 || sessionStatus == 3 { + resultComplete = true + } else { + resultComplete = false + } + + res.Header.Semantic.Code = code + res.Header.Semantic.Domain = domain + res.Header.Semantic.Intent = intent + res.Header.Semantic.Msg = msg + res.Header.Semantic.SessionComplete = resultComplete + res.Header.Semantic.Slots = make([]map[string]interface{}, 0) + res.Header.Semantic.Command = params.TencentNlpResp.GetCommand() // Command 透传 + + for _, slot := range slots { + tempSlot := make(map[string]interface{}, len(slot)) + for k, v := range slot { + key := strings.ToLower(k) + tempSlot[key] = v + } + res.Header.Semantic.Slots = append(res.Header.Semantic.Slots, tempSlot) + } + res.ResponseText = text + res.AsrRecongize = params.Query + return &res, nil +} + +func MarshalWs(params *model.DomainParamsWs, res *model.ResponseBody) []byte { + resByte, err := json.Marshal(res) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Errorf("Marshal error. %v", err) + return replyWithChat(error_reply, "doudi") + } + return resByte +} + +// tencent weather domain 新接口, 解析新的技能协议 +func weatherDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("weatherDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + resultComplete := res.Header.Semantic.SessionComplete + + var text string + var selfData string + var textContent string // 回复语 + + var listItems []model.ListItem + if params.TencentNlpResp.CheckWidgetData() { + listItems = params.TencentNlpResp.GetListItems() + } + if len(listItems) > 0 { + selfData = listItems[0].SelfData + textContent = listItems[0].TextContent + weatherIndex := gjson.GetBytes([]byte(selfData), "vecCityWeatherInfo.0.stDobbyCurrentWeather.sDWeaIndex").String() + + tips := "" + if weatherIndex == "3" || weatherIndex == "4" || weatherIndex == "5" || weatherIndex == "6" { + tips = weatherReplyMessage[getRandom(len(weatherReplyMessage))] + } + + if resultComplete == true { + text = textContent + tips + } else { + text = textContent + } + } + if text != "" { + res.ResponseText = text + } + res.ListItems = make([]map[string]interface{}, 0) + + // 增加带屏设备的输出 + + // var selfDataMap map[string]interface{} + // err = json.Unmarshal([]byte(selfData), &selfDataMap) + // if err != nil { + // global.Logger.WithFields(logger.Fields{ + // "requestId": params.RequestId, + // }).Error("weatherDomainV2 Unmarshal error.") + // return replyWithChat(error_reply, "doudi") + // } + + res.ListItems = append(res.ListItems, map[string]interface{}{ + // "selfData": selfDataMap, + "textContent": textContent, + }) + return MarshalWs(params, res) +} + +// chat +func chatDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("chatDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return MarshalWs(params, res) +} + +// translate 翻译 +func translateDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("translateDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + if !params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("translateDomainWs check error, WidgetData is not exist.") + return replyWithChat(error_reply, "doudi") + } + + slots := params.TencentNlpResp.GetSlots() + for i := 0; i < len(slots); i++ { + if key, ok := slots[i]["Name"]; ok && key == "language" { + if value, ok := slots[i]["Value"]; ok && !(value == "英语" || value == "日语" || value == "韩语") { + res.ResponseText = "当前仅支持英语、日语、韩语翻译。" + return MarshalWs(params, res) + } + } + } + res.ListItems = make([]map[string]interface{}, 0) + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "selfData": listItems[i].SelfData, + "textContent": listItems[i].TextContent, + }) + } + res.ResponseText = listItems[0].TextContent + } + return MarshalWs(params, res) +} + +// global_ctrl 全局控制 +func globalCtrlDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("globalCtrlDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ResponseText = params.TencentNlpResp.GetText() + return MarshalWs(params, res) +} + +// media_ctrl 媒体控制 +func mediaCtrlDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("mediaCtrlDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ResponseText = params.TencentNlpResp.GetText() + return MarshalWs(params, res) +} + +func alarmDevFilter(params *model.DomainParamsWs) bool { + if params.Mid == "10f05" && params.MidType == "87654321" { + return true + } else if params.Mid == "10f05" && params.MidType == "7e000024" && params.AppKey == "a8814080829e11eda5c8e38bb1008e50" { + return true + } + return false +} + +// Alarm 闹钟 Reminder_v2 提醒 +func alarmDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("alarmDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + if !alarmDevFilter(params) { + return MarshalWs(params, res) + } + + command := params.TencentNlpResp.GetCommand() + cmdName := command.Name + + switch cmdName { + case "Command://Tencent.Alarm.Create", "Command://Tencent.Alarm.Open", + "Command://Tencent.Alarm.Close", "Command://Tencent.Alarm.Check", + "Command://Tencent.Alarm.Delete", "Command://Tencent.Alarm.Modify", + "Command://Tencent.GlobalCtrl.TurnPage", "Command://Tencent.GlobalCtrl.SelectPage", + "Command://Tencent.Reminder.Create", "Command://Tencent.Reminder.Check", + "Command://Tencent.Reminder.GrantPermissions", "Command://Tencent.Reminder.DeleteById", + "Command://Tencent.Reminder.Delete", "Command://Tencent.Reminder.Modify", + "Command://Tencent.Semantic.Specific": + tencentNlpSkill := TencentNlpSkill{} + reqBody, err := tencentNlpSkill.GetCommandReq(params.Mac, params.HomeId, params.RequestId, params.TencentNlpResp) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("tencentNlpSkill.GetReq error.") + return replyWithChat(error_reply, "doudi") + } + resp, err := tencentNlpSkill.Req(params, reqBody) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Errorf("tencentNlpSkill.Req error. %v", err) + return replyWithChat(error_reply, "doudi") + } + if !CheckStatusCode(resp) { + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{ + "tencentNlpSkillRespBody": resp, + // "query": data.Query, + }, + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Info("tencentNlpSkill.Req code error.") + } + + responseText := resp.GetResponse().GetText() + + res.ResponseText = responseText + return MarshalWs(params, res) + + } + + res.ResponseText = params.TencentNlpResp.GetText() + return MarshalWs(params, res) +} + +// music 音乐 + +// science 科学查询 +func scienceDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("scienceDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + if !params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("scienceDomainWs check error, WidgetData is not exist.") + return replyWithChat(error_reply, "doudi") + } + + intent := params.TencentNlpResp.GetIntent() + if intent == "calculator" { + listItems := params.TencentNlpResp.GetListItems() + calResult := gjson.GetBytes([]byte(listItems[0].SelfData), "sResult").String() + if calResult == "" { + res.ResponseText = params.TencentNlpResp.GetText() + } else { + res.ResponseText = "等于" + calResult + } + } else { + res.ResponseText = params.TencentNlpResp.GetText() + } + return MarshalWs(params, res) +} + +// chengyu 成语 +func chengyuDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("chengyuDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + if !params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("chengyuDomainWs check error, WidgetData is not exist.") + return replyWithChat(error_reply, "doudi") + } + + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + res.ResponseText = listItems[0].TextContent + } + return MarshalWs(params, res) +} + +// baike 百科 +func baikeDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("scienceDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ListItems = make([]map[string]interface{}, 0) + + responseText := params.TencentNlpResp.GetText() + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "textContent": listItems[i].TextContent, + "selfData": listItems[i].SelfData, + "title": listItems[i].Title, + "mediaId": listItems[i].MediaId, + }) + } + } + } + res.ResponseText = responseText + return MarshalWs(params, res) +} + +// holiday +func holidayDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("holidayDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + var resultContent string + resultContent = params.TencentNlpResp.GetText() + var listItems []model.ListItem + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems = params.TencentNlpResp.GetListItems() + + } + if len(listItems) > 0 { + resultContent = listItems[0].TextContent + } + res.ListItems = make([]map[string]interface{}, 0) + res.ResponseText = resultContent + + return MarshalWs(params, res) +} + +// news +func newsDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("newsDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + intent := params.TencentNlpResp.GetIntent() + switch intent { + case "play", "playmore", "search", "": + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + res.ListItems = make([]map[string]interface{}, 0, len(listItems)) + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "title": listItems[i].Title, + "newsFrom": gjson.Get(listItems[i].SelfData, "newsFrom").String(), + "newsType": gjson.Get(listItems[i].SelfData, "type").String(), + // "content": listItems[i].TextContent, + }) + } + res.ResponseText = "为你找到以下新闻:" + } + } + return MarshalWs(params, res) + default: + // 其他intent + // global.Logger.WithFields(logger.Fields{ + // "requestId": params.RequestId, + // }).Error("newsDomainWs unknow intent.") + return MarshalWs(params, res) + } +} + +// ancientpoem +func ancientpoemDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("ancientpoemDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + // if !params.TencentNlpResp.CheckControlInfo() { + // // 响应体内容缺少 + // global.Logger.WithFields(logger.Fields{ + // "requestId": params.RequestId, + // }).Error("ancientpoemDomainV2 check error, ControlInfo is not exist.") + // return replyWithChat(error_reply, "doudi") + // } + // resType := params.TencentNlpResp.GetType() + res.ListItems = make([]map[string]interface{}, 0) + + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + var title string + if listItems[i].Title == "" { + title = gjson.Get(listItems[i].SelfData, "title").String() + } else { + title = listItems[i].Title + } + res.ListItems = append(res.ListItems, map[string]interface{}{ + // "type": resType, + "url": listItems[i].Audio.Stream.Url, + "title": title, + "content": listItems[i].TextContent, + "author": gjson.Get(listItems[i].SelfData, "author").String(), + "dynasty": gjson.Get(listItems[i].SelfData, "dynasty").String(), + "mediaId": listItems[i].MediaId, + }) + } + } + } + + // 因 流式语音服务业务逻辑问题, 需要将textContent拼接进Text中返回 + intent := res.Header.Semantic.Intent + switch intent { + case "search_ancientpoem_meaning", "search_ancientpoem_appreciation": + // 查询古诗含义, 查询古诗鉴赏 + // 拼接textContent 和 Text + var textContent string + if len(res.ListItems) >= 1 { + if temp, ok := res.ListItems[0]["content"]; ok { + textContent = temp.(string) + } + } + res.ResponseText = res.ResponseText + ":" + textContent + } + return MarshalWs(params, res) +} + +// fmDomain +func fmDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("fmDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + text := params.TencentNlpResp.GetText() + res.ResponseText = text + var liveUrlFlag bool = false + + res.ListItems = make([]map[string]interface{}, 0) + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + if gjson.Get(listItems[i].SelfData, "eShowType").Int() == 1 { + // 过滤直播类型的链接 + if params.Mid == "10f05" && params.MidType == "7e000024" && params.AppKey == "a8814080829e11eda5c8e38bb1008e50" { + // 固定机型进行此类处理 + liveUrlFlag = true + continue + } + } + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "title": listItems[i].Title, + "content": listItems[i].TextContent, + "mediaId": listItems[i].MediaId, + }) + } + } + } + + if liveUrlFlag && len(res.ListItems) == 0 { + res.ResponseText = "小格没有找到相关的资源哦" + } + + // intent := res.Header.Semantic.Intent + // switch intent { + // case "next3": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_NEXT, nil) + // case "prev": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_PREVIOUS, nil) + // // 禅道 #71 + // case "pause": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_PAUSE, nil) + // case "exit": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_EXIT, nil) + // case "stop": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_STOP, nil) + // case "palymore": + // res.Header.Semantic.Intent = "play" + // return Marshal(params, res) + // } + + return MarshalWs(params, res) +} + +// sport +func sportsDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("sportsDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + text := params.TencentNlpResp.GetText() + + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + text = listItems[0].TextContent + } + } + res.ResponseText = text + return MarshalWs(params, res) +} + +func jokeDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("jokeDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + res.ListItems = make([]map[string]interface{}, 0) + + text := params.TencentNlpResp.GetText() + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "content": listItems[i].TextContent, + }) + } + } + } + if text == "" { + text = "好的" + } + res.ResponseText = text + return MarshalWs(params, res) +} + +func astroDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("astroDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + text := params.TencentNlpResp.GetText() + res.ListItems = make([]map[string]interface{}, 0) + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + text = listItems[0].TextContent + } + } + res.ResponseText = text + return MarshalWs(params, res) +} + +func stockDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("stockDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + text := params.TencentNlpResp.GetText() + res.ListItems = make([]map[string]interface{}, 0) + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + text = listItems[0].TextContent + } + } + res.ResponseText = text + return MarshalWs(params, res) +} + +func defaultDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("defaultDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return MarshalWs(params, res) +} + +func musicDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("musicDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + res.ListItems = make([]map[string]interface{}, 0) + + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "singer": gjson.Get(listItems[i].SelfData, "singer").String(), + "song": gjson.Get(listItems[i].SelfData, "song").String(), + "mediaId": listItems[i].MediaId, + "songId": gjson.Get(listItems[i].SelfData, "songId").String(), + }) + } + } + } + + return MarshalWs(params, res) +} + +// volumectrl3 +func volumeCtrl3DomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("volumeCtrl3DomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return MarshalWs(params, res) +} + +// screen_control +func screenCtrlDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("screenCtrlDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return MarshalWs(params, res) +} + +// world_records_qa_pairs 世界之最 +func worldRecordsQaPairsDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("worldRecordsQaPairsDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ResponseText = params.TencentNlpResp.GetText() + return MarshalWs(params, res) +} + +// llm +func llmDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("llmDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return MarshalWs(params, res) +} + +// sound +func soundDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("soundDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + res.ListItems = make([]map[string]interface{}, 0) + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "title": listItems[i].Title, + "content": listItems[i].TextContent, + "mediaId": listItems[i].MediaId, + }) + } + } + } + + return MarshalWs(params, res) +} + +// geography_kbqa +func geographyKbqaDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("geographyKbqaDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + return MarshalWs(params, res) +} + +// general_question_answering +func generalAuestionAnsweringDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("generalAuestionAnsweringDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + return MarshalWs(params, res) +} + +// htwhys_qa_pairs +func htwhysQaPairsDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("htwhysQaPairsDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + return MarshalWs(params, res) +} + +// invention_qa_pairs +func inventionQaPairsDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("inventionQaPairsDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + return MarshalWs(params, res) +} + +// 通用的解析 +func universalDomainWs(params *model.DomainParamsWs) []byte { + res, err := baseParseWs(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Error("universalDomainWs baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + return MarshalWs(params, res) +} diff --git a/service/tencentNlu/domainv2.go b/service/tencentNlu/domainv2.go new file mode 100644 index 0000000..d201cba --- /dev/null +++ b/service/tencentNlu/domainv2.go @@ -0,0 +1,721 @@ +package tencentNlu + +import ( + "encoding/json" + "errors" + "fmt" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "strings" + + "github.com/tidwall/gjson" +) + +func baseParse(params *model.DomainParamsV2) (*model.ResponseBody, error) { + // 解析code domain intent slots 等 + var res model.ResponseBody + if !params.TencentNlpResp.CheckHeader() || !params.TencentNlpResp.CheckNlu() || !params.TencentNlpResp.CheckDm() || !params.TencentNlpResp.CheckSkill() { + // 响应体内容缺少 + return nil, errors.New("TencentNlpResp check error.") + } + code := params.TencentNlpResp.GetCode() + msg := params.TencentNlpResp.GetMessage() + domain := params.TencentNlpResp.GetDomain() + intent := params.TencentNlpResp.GetIntent() + complete := params.TencentNlpResp.GetSessionComplete() // 当前会话是否结束 + slots := params.TencentNlpResp.GetSlots() // 词槽 + text := params.TencentNlpResp.GetText() // 回复语 + + var resultComplete bool + if complete == 1 { + resultComplete = true + } else { + resultComplete = false + } + + res.Header.Semantic.Code = code + res.Header.Semantic.Domain = domain + res.Header.Semantic.Intent = intent + res.Header.Semantic.Msg = msg + res.Header.Semantic.SessionComplete = resultComplete + res.Header.Semantic.Slots = make([]map[string]interface{}, 0) + res.Header.Semantic.Command = params.TencentNlpResp.GetCommand() // Command 透传 + + for _, slot := range slots { + tempSlot := make(map[string]interface{}, len(slot)) + for k, v := range slot { + key := strings.ToLower(k) + tempSlot[key] = v + } + res.Header.Semantic.Slots = append(res.Header.Semantic.Slots, tempSlot) + } + res.ResponseText = text + res.AsrRecongize = params.Query + return &res, nil +} + +func Marshal(params *model.DomainParamsV2, res *model.ResponseBody) []byte { + resByte, err := json.Marshal(res) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Errorf("Marshal error. %v", err) + return replyWithChat(error_reply, "doudi") + } + return resByte +} + +// tencent weather domain 新接口, 解析新的技能协议 +func weatherDomainV2(params *model.DomainParamsV2) []byte { + fmt.Println(params.TencentNlpResp) + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("weatherDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + resultComplete := res.Header.Semantic.SessionComplete + + var text string + var selfData string + var textContent string // 回复语 + + var listItems []model.ListItem + if params.TencentNlpResp.CheckWidgetData() { + listItems = params.TencentNlpResp.GetListItems() + } + if len(listItems) > 0 { + selfData = listItems[0].SelfData + textContent = listItems[0].TextContent + weatherIndex := gjson.GetBytes([]byte(selfData), "vecCityWeatherInfo.0.stDobbyCurrentWeather.sDWeaIndex").String() + + tips := "" + if weatherIndex == "3" || weatherIndex == "4" || weatherIndex == "5" || weatherIndex == "6" { + tips = weatherReplyMessage[getRandom(len(weatherReplyMessage))] + } + + if resultComplete == true { + text = textContent + tips + } else { + text = textContent + } + } + if text != "" { + res.ResponseText = text + } + res.ListItems = make([]map[string]interface{}, 0) + + // 增加带屏设备的输出 + + // var selfDataMap map[string]interface{} + // err = json.Unmarshal([]byte(selfData), &selfDataMap) + // if err != nil { + // global.Logger.WithFields(logger.Fields{ + // "requestId": params.RequestId, + // }).Error("weatherDomainV2 Unmarshal error.") + // return replyWithChat(error_reply, "doudi") + // } + + res.ListItems = append(res.ListItems, map[string]interface{}{ + // "selfData": selfDataMap, + "textContent": textContent, + }) + return Marshal(params, res) +} + +// chat +func chatDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("chatDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return Marshal(params, res) +} + +// translate 翻译 +func translateDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("translateDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + if !params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("translateDomainV2 check error, WidgetData is not exist.") + return replyWithChat(error_reply, "doudi") + } + + slots := params.TencentNlpResp.GetSlots() + for i := 0; i < len(slots); i++ { + if key, ok := slots[i]["Name"]; ok && key == "language" { + if value, ok := slots[i]["Value"]; ok && !(value == "英语" || value == "日语" || value == "韩语") { + res.ResponseText = "当前仅支持英语、日语、韩语翻译。" + return Marshal(params, res) + } + } + } + res.ListItems = make([]map[string]interface{}, 0) + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "selfData": listItems[i].SelfData, + "textContent": listItems[i].TextContent, + }) + } + res.ResponseText = listItems[0].TextContent + } + return Marshal(params, res) +} + +// global_ctrl 全局控制 +func globalCtrlDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("globalCtrlDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ResponseText = params.TencentNlpResp.GetText() + return Marshal(params, res) +} + +// media_ctrl 媒体控制 +func mediaCtrlDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("mediaCtrlDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ResponseText = params.TencentNlpResp.GetText() + return Marshal(params, res) +} + +// Alarm 闹钟 Reminder_v2 提醒 +func alarmDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("alarmDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ResponseText = params.TencentNlpResp.GetText() + return Marshal(params, res) +} + +// music 音乐 + +// science 科学查询 +func scienceDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("scienceDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + if !params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("scienceDomainV2 check error, WidgetData is not exist.") + return replyWithChat(error_reply, "doudi") + } + + intent := params.TencentNlpResp.GetIntent() + if intent == "calculator" { + listItems := params.TencentNlpResp.GetListItems() + calResult := gjson.GetBytes([]byte(listItems[0].SelfData), "sResult").String() + if calResult == "" { + res.ResponseText = params.TencentNlpResp.GetText() + } else { + res.ResponseText = "等于" + calResult + } + } else { + res.ResponseText = params.TencentNlpResp.GetText() + } + return Marshal(params, res) +} + +// chengyu 成语 +func chengyuDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("chengyuDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + if !params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("chengyuDomainV2 check error, WidgetData is not exist.") + return replyWithChat(error_reply, "doudi") + } + + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + res.ResponseText = listItems[0].TextContent + } + return Marshal(params, res) +} + +// baike 百科 +func baikeDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("scienceDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ListItems = make([]map[string]interface{}, 0) + + responseText := params.TencentNlpResp.GetText() + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "textContent": listItems[i].TextContent, + "selfData": listItems[i].SelfData, + "title": listItems[i].Title, + "mediaId": listItems[i].MediaId, + }) + } + } + } + res.ResponseText = responseText + return Marshal(params, res) +} + +// holiday +func holidayDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("holidayDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + var resultContent string + resultContent = params.TencentNlpResp.GetText() + var listItems []model.ListItem + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems = params.TencentNlpResp.GetListItems() + + } + if len(listItems) > 0 { + resultContent = listItems[0].TextContent + } + res.ListItems = make([]map[string]interface{}, 0) + res.ResponseText = resultContent + + return Marshal(params, res) +} + +// news +func newsDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("newsDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + intent := params.TencentNlpResp.GetIntent() + switch intent { + case "play", "playmore", "search", "": + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + res.ListItems = make([]map[string]interface{}, 0, len(listItems)) + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "title": listItems[i].Title, + "newsFrom": gjson.Get(listItems[i].SelfData, "newsFrom").String(), + "type": gjson.Get(listItems[i].SelfData, "type").String(), + // "content": listItems[i].TextContent, + }) + } + res.ResponseText = "为你找到以下新闻:" + } + } + return Marshal(params, res) + default: + // 其他intent + // global.Logger.WithFields(logger.Fields{ + // "requestId": params.RequestId, + // }).Error("newsDomainV2 unknow intent.") + return Marshal(params, res) + } +} + +// ancientpoem +func ancientpoemDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("ancientpoemDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + // if !params.TencentNlpResp.CheckControlInfo() { + // // 响应体内容缺少 + // global.Logger.WithFields(logger.Fields{ + // "requestId": params.RequestId, + // }).Error("ancientpoemDomainV2 check error, ControlInfo is not exist.") + // return replyWithChat(error_reply, "doudi") + // } + // resType := params.TencentNlpResp.GetType() + res.ListItems = make([]map[string]interface{}, 0) + + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + // "type": resType, + "url": listItems[i].Audio.Stream.Url, + "title": listItems[i].Title, + "content": listItems[i].TextContent, + "author": gjson.Get(listItems[i].SelfData, "author").String(), + "dynasty": gjson.Get(listItems[i].SelfData, "dynasty").String(), + "mediaId": listItems[i].MediaId, + }) + } + } + } + // 因 流式语音服务业务逻辑问题, 需要将textContent拼接进Text中返回 + intent := res.Header.Semantic.Intent + switch intent { + case "search_ancientpoem_meaning", "search_ancientpoem_appreciation": + // 查询古诗含义, 查询古诗鉴赏 + // 拼接textContent 和 Text + var textContent string + if len(res.ListItems) >= 1 { + if temp, ok := res.ListItems[0]["content"]; ok { + textContent = temp.(string) + } + } + res.ResponseText = res.ResponseText + ":" + textContent + } + return Marshal(params, res) +} + +// fmDomain +func fmDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("fmDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + text := params.TencentNlpResp.GetText() + res.ResponseText = text + + res.ListItems = make([]map[string]interface{}, 0) + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "title": listItems[i].Title, + "content": listItems[i].TextContent, + "mediaId": listItems[i].MediaId, + }) + } + } + } + + // intent := res.Header.Semantic.Intent + // switch intent { + // case "next3": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_NEXT, nil) + // case "prev": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_PREVIOUS, nil) + // // 禅道 #71 + // case "pause": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_PAUSE, nil) + // case "exit": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_EXIT, nil) + // case "stop": + // return transformGreeProtocolReply(params.Query, global.DOMAIN_PLAYCONTROL, global.INTENT_CONTROL_STOP, nil) + // case "palymore": + // res.Header.Semantic.Intent = "play" + // return Marshal(params, res) + // } + + return Marshal(params, res) +} + +// sport +func sportsDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("sportsDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + text := params.TencentNlpResp.GetText() + + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + text = listItems[0].TextContent + } + } + res.ResponseText = text + return Marshal(params, res) +} + +func jokeDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("jokeDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + res.ListItems = make([]map[string]interface{}, 0) + + text := params.TencentNlpResp.GetText() + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "content": listItems[i].TextContent, + }) + } + } + } + res.ResponseText = text + return Marshal(params, res) +} + +func astroDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("astroDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + text := params.TencentNlpResp.GetText() + res.ListItems = make([]map[string]interface{}, 0) + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + text = listItems[0].TextContent + } + } + res.ResponseText = text + return Marshal(params, res) +} + +func stockDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("stockDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + text := params.TencentNlpResp.GetText() + res.ListItems = make([]map[string]interface{}, 0) + if params.TencentNlpResp.CheckWidgetData() { + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + text = listItems[0].TextContent + } + } + res.ResponseText = text + return Marshal(params, res) +} + +func defaultDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("defaultDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return Marshal(params, res) +} + +func musicDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("musicDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + res.ListItems = make([]map[string]interface{}, 0) + + if params.TencentNlpResp.CheckWidgetData() { + // 响应体内容缺少 + listItems := params.TencentNlpResp.GetListItems() + if len(listItems) > 0 { + for i := 0; i < len(listItems); i++ { + res.ListItems = append(res.ListItems, map[string]interface{}{ + "url": listItems[i].Audio.Stream.Url, + "singer": gjson.Get(listItems[i].SelfData, "singer").String(), + "song": gjson.Get(listItems[i].SelfData, "song").String(), + "mediaId": listItems[i].MediaId, + "songId": gjson.Get(listItems[i].SelfData, "songId").String(), + }) + } + } + } + + return Marshal(params, res) +} + +// volumectrl3 +func volumeCtrl3DomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("volumeCtrl3Domain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return Marshal(params, res) +} + +// screen_control +func screenCtrlDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("screenCtrlDomain baseParse error.") + return replyWithChat(error_reply, "doudi") + } + return Marshal(params, res) +} + +// world_records_qa_pairs 世界之最 +func worldRecordsQaPairsDomainV2(params *model.DomainParamsV2) []byte { + res, err := baseParse(params) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + }).Error("worldRecordsQaPairsDomainV2 baseParse error.") + return replyWithChat(error_reply, "doudi") + } + + res.ResponseText = params.TencentNlpResp.GetText() + return Marshal(params, res) +} diff --git a/service/tencentNlu/register.go b/service/tencentNlu/register.go new file mode 100644 index 0000000..aa7131c --- /dev/null +++ b/service/tencentNlu/register.go @@ -0,0 +1,76 @@ +package tencentNlu + +import ( + "speech-nlu-parse/model" + "sync" +) + +type DomainFunc func(*model.DomainParams) []byte + +var ( + handlers = make(map[string]DomainFunc) + handlersRWMutex sync.RWMutex +) + +// 注册 +func DomainRegister(key string, value DomainFunc) { + handlersRWMutex.Lock() + defer handlersRWMutex.Unlock() + handlers[key] = value + return +} + +// 获取handler +func getHandler(key string) (handler DomainFunc, ok bool) { + handler, ok = handlers[key] + return +} + +// 注册所有domain +func register() { + // DomainRegister() + DomainRegister(MUSIC, musicDomain) + DomainRegister(NEWS, newsDomain) + DomainRegister(WEATHER, weatherDomain) + DomainRegister(ANCIENTPOEM, poemDomain) + DomainRegister(FM, fmDomain) + DomainRegister(SPORTS, sportsDomain) + DomainRegister(JOKE, jokeDomain) + DomainRegister(ASTRO, astroDomain) + DomainRegister(HOLIDAY, holidayDomain) + DomainRegister(STOCK, stockDomain) + DomainRegister(TRANSLATE, translateDomain) + DomainRegister(SOUND, soundDomain) + DomainRegister(ALMANAC, almanacDomain) + DomainRegister(FINANCE, financeDomain) + DomainRegister(FOOD, cityinfoDomain) + DomainRegister(GENERALQA, generalQADomain) + DomainRegister(COMMONQA, commonQADomain) + DomainRegister(BAIKE, baikeDomain) + DomainRegister(CHENGYU, chengyuDomain) + DomainRegister(SCIENCE, scienceDomain) + DomainRegister(RECIPE, recipeDomain) + DomainRegister(HISTORY, historyDomain) + DomainRegister(CHAT, chatDomain) + DomainRegister(GEOGRAPHY, geographyDomain) + DomainRegister(ALARM, alarmDomain) + DomainRegister(REMINDERV2, alarmDomain) + DomainRegister(XIAOLIAO, customChatDomain) + DomainRegister(CITYINFO, cityinfoDomain) + DomainRegister(WORLDRECORDS, cityinfoDomain) + DomainRegister(HTWHYS, cityinfoDomain) + DomainRegister(DISEASE, cityinfoDomain) + DomainRegister(GARBAGECLASS, cityinfoDomain) + DomainRegister(YIQINGWENDA, cityinfoDomain) + DomainRegister(GLOBALCTRL, globalctrlDomain) + DomainRegister(INVENTIONQAPAIRS, inventionQaPairsDomain) + DomainRegister(PLANTS_KBQA, plantsKbqaDomain) + DomainRegister(HELP, helpDomain) + DomainRegister(GLETKT_XLCJ_1245258905417052160, customChatDomain) + DomainRegister(CESHI_1149914105856290816, customChatDomain) + DomainRegister(GELIYOUPINGKONGTIAO_1289106967398617088, customChatDomain) + DomainRegister(JHDPBXZSWD_1364089899207012352, customChatDomain) + DomainRegister(LXTEST_1697504067777118921, customChatDomain) + DomainRegister(LXTEST_1697504245166677379, customChatDomain) + DomainRegister(LCHAT_1736631343458063755, customChatDomain) +} diff --git a/service/tencentNlu/registerWs.go b/service/tencentNlu/registerWs.go new file mode 100644 index 0000000..bdef9e3 --- /dev/null +++ b/service/tencentNlu/registerWs.go @@ -0,0 +1,110 @@ +package tencentNlu + +import "speech-nlu-parse/model" + +type DomainFuncWs func(*model.DomainParamsWs) []byte + +var handlersWs = make(map[string]DomainFuncWs) + +func DomainRegisterWs(key string, value DomainFuncWs) { + handlersWs[key] = value +} + +func getHandlerWs(key string) (handler DomainFuncWs, ok bool) { + handler, ok = handlersWs[key] + return +} + +func registerWs() { + DomainRegisterWs(WEATHER, weatherDomainWs) + DomainRegisterWs(WEATHER_YUE, weatherDomainWs) + + DomainRegisterWs(CHAT, chatDomainWs) + DomainRegisterWs(HOLIDAY, holidayDomainWs) + DomainRegisterWs(HOLIDAY_YUE, holidayDomainWs) + + DomainRegisterWs(NEWS, newsDomainWs) + DomainRegisterWs(NEWS_YUE, newsDomainWs) + + DomainRegisterWs(ANCIENTPOEM, ancientpoemDomainWs) + DomainRegisterWs(ANCIENT_POEM_YUE, ancientpoemDomainWs) + + DomainRegisterWs(SPORTS, sportsDomainWs) + DomainRegisterWs(SPORTS_YUE, sportsDomainWs) + + DomainRegisterWs(JOKE, jokeDomainWs) + DomainRegisterWs(JOKE_YUE, jokeDomainWs) + + DomainRegisterWs(ASTRO, astroDomainWs) + DomainRegisterWs(ASTRO_YUE, astroDomainWs) + + DomainRegisterWs(STOCK, stockDomainWs) + DomainRegisterWs(STOCK_YUE, stockDomainWs) + + DomainRegisterWs(TRANSLATE, translateDomainWs) + DomainRegisterWs(TRANSLATE_YUE, translateDomainWs) + + DomainRegisterWs(ALARM, alarmDomainWs) + DomainRegisterWs(ALARM_YUE, alarmDomainWs) + + DomainRegisterWs(SCIENCE, scienceDomainWs) + DomainRegisterWs(SCIENCE_YUE, scienceDomainWs) + + DomainRegisterWs(CHENGYU, chengyuDomainWs) + DomainRegisterWs(CHENGYU_YUE, chengyuDomainWs) + + DomainRegisterWs(REMINDERV2, alarmDomainWs) + DomainRegisterWs(REMINDER_V2_YUE, alarmDomainWs) + + DomainRegisterWs(GLOBALCTRL3, globalCtrlDomainWs) + DomainRegisterWs(GLOBALCTRL3_YUE, globalCtrlDomainWs) + + DomainRegisterWs(MEDIACTRL, mediaCtrlDomainWs) + DomainRegisterWs(MEDIACTRL3_YUE, mediaCtrlDomainWs) + + DomainRegisterWs(BAIKE, baikeDomainWs) + + DomainRegisterWs(FM, fmDomainWs) + DomainRegisterWs(FM_YUE, fmDomainWs) + + DomainRegisterWs(DEFAULT, defaultDomainWs) + DomainRegisterWs(MUSIC, musicDomainWs) + DomainRegisterWs(MUSIC_YUE, musicDomainWs) + + DomainRegisterWs(VOLUMECTRL3, volumeCtrl3DomainWs) + DomainRegisterWs(VOLUMECTRL3_YUE, volumeCtrl3DomainWs) + + DomainRegisterWs(SCREENCONTROL, screenCtrlDomainWs) + DomainRegisterWs(WORLDRECORDSQAPAIRS, worldRecordsQaPairsDomainWs) + DomainRegisterWs(LLM, llmDomainWs) // 腾讯大语言模型bot + DomainRegisterWs(SOUND, soundDomainWs) + DomainRegisterWs(SOUND_YUE, soundDomainWs) + + DomainRegisterWs(GEOGRAPHYKBQA, geographyKbqaDomainWs) + DomainRegisterWs(GENERALQUESTIONANSWERING, generalAuestionAnsweringDomainWs) + DomainRegisterWs(HTWHYS_QA_PAIRS, htwhysQaPairsDomainWs) + DomainRegisterWs(INVENTION_QA_PAIRS, inventionQaPairsDomainWs) + DomainRegisterWs(GEOGRAPHY, universalDomainWs) + // DomainRegisterWs(FINANCE, universalDomainWs) + DomainRegisterWs(HELP, universalDomainWs) + DomainRegisterWs(HELP_YUE, universalDomainWs) + + DomainRegisterWs(ALMANAC, universalDomainWs) + DomainRegisterWs(CITYINFO, universalDomainWs) + DomainRegisterWs(HISTORY, universalDomainWs) + DomainRegisterWs(RECIPE, universalDomainWs) + DomainRegisterWs(DISEASE, universalDomainWs) + DomainRegisterWs(GARBAGECLASS, universalDomainWs) + DomainRegisterWs(ASTRONOMY_KBQA, universalDomainWs) + DomainRegisterWs(COMMON_QA_QA_PAIRS, universalDomainWs) + DomainRegisterWs(XIAOLIAO, universalDomainWs) + DomainRegisterWs(MCHAT, universalDomainWs) + DomainRegisterWs(GLETKT_XLCJ_1245258905417052160, universalDomainWs) + DomainRegisterWs(CESHI_1149914105856290816, universalDomainWs) + DomainRegisterWs(GELIYOUPINGKONGTIAO_1289106967398617088, universalDomainWs) + DomainRegisterWs(JHDPBXZSWD_1364089899207012352, universalDomainWs) + DomainRegisterWs(LXTEST_1697504067777118921, universalDomainWs) + DomainRegisterWs(LXTEST_1697504245166677379, universalDomainWs) + DomainRegisterWs(LCHAT_1736631343458063755, universalDomainWs) + +} diff --git a/service/tencentNlu/registerv2.go b/service/tencentNlu/registerv2.go new file mode 100644 index 0000000..27f0a2f --- /dev/null +++ b/service/tencentNlu/registerv2.go @@ -0,0 +1,44 @@ +package tencentNlu + +import "speech-nlu-parse/model" + +type DomainFuncV2 func(*model.DomainParamsV2) []byte + +var handlersV2 = make(map[string]DomainFuncV2) + +func DomainRegisterV2(key string, value DomainFuncV2) { + handlersV2[key] = value +} + +func getHandlerV2(key string) (handler DomainFuncV2, ok bool) { + handler, ok = handlersV2[key] + return +} + +func registerV2() { + DomainRegisterV2(WEATHER, weatherDomainV2) + DomainRegisterV2(CHAT, chatDomainV2) + DomainRegisterV2(MCHAT, chatDomainV2) // mchat + DomainRegisterV2(HOLIDAY, holidayDomainV2) + DomainRegisterV2(NEWS, newsDomainV2) + DomainRegisterV2(ANCIENTPOEM, ancientpoemDomainV2) + DomainRegisterV2(SPORTS, sportsDomainV2) + DomainRegisterV2(JOKE, jokeDomainV2) + DomainRegisterV2(ASTRO, astroDomainV2) + DomainRegisterV2(STOCK, stockDomainV2) + DomainRegisterV2(TRANSLATE, translateDomainV2) + DomainRegisterV2(ALARM, alarmDomainV2) + DomainRegisterV2(SCIENCE, scienceDomainV2) + DomainRegisterV2(CHENGYU, chengyuDomainV2) + DomainRegisterV2(REMINDERV2, alarmDomainV2) + DomainRegisterV2(GLOBALCTRL3, globalCtrlDomainV2) + DomainRegisterV2(MEDIACTRL, mediaCtrlDomainV2) + DomainRegisterV2(BAIKE, baikeDomainV2) + DomainRegisterV2(FM, fmDomainV2) + DomainRegisterV2(DEFAULT, defaultDomainV2) + DomainRegisterV2(MUSIC, musicDomainV2) + DomainRegisterV2(VOLUMECTRL3, volumeCtrl3DomainV2) + DomainRegisterV2(SCREENCONTROL, screenCtrlDomainV2) + DomainRegisterV2(WORLDRECORDSQAPAIRS, worldRecordsQaPairsDomainV2) + +} diff --git a/service/tencentNlu/reply.go b/service/tencentNlu/reply.go new file mode 100644 index 0000000..72c9486 --- /dev/null +++ b/service/tencentNlu/reply.go @@ -0,0 +1,117 @@ +package tencentNlu + +import ( + "encoding/json" + "speech-nlu-parse/model" +) + +var ( + reply_when_tencent_empty = "我还不够聪明,没有找到你想要的内容" + reply_when_geography_empty = "抱歉,没找到你想要的" + alarm_remind_raw = "到提醒时间了" + reply_when_recourse_limited = "很抱歉,暂时还没有相关资源" + shielded_reply = "抱歉,暂不支持该功能,我还在努力学习中" + error_reply = "抱歉,没找到你想要的" // 错误兜底回复 + frequency_request_reply = "抱歉,没找到你想要的" // TODO: 请求过于频繁的回复话术 + expired_reply = "QQ音乐账号绑定已过期,请前往格力+手机应用重新绑定。" // 授权过期回复语 + not_using_reply = "您的设备尚未绑定QQ音乐账号,请前往格力+手机应用绑定激活。" // 未授权回复语 +) + +// 兜底话术 +var replyMessage = []string{"你的问题太难了,我没法回答", "人类的语言真是太复杂了,我听不懂", "这个要求有点高,我现在还不会。", "很抱歉,没有找到你想要的内容", + "抱歉,暂不支持该功能,我还在努力学习中", "抱歉,我还不够聪明,没有找到你想要的内容"} + +var musicReplyMessage = []string{ + "好的", + "注意听", + "马上为您播放", + "请欣赏", +} + +var weatherReplyMessage = []string{ + "出门记得带伞哦", + "记得带伞", + "别忘记带伞", +} + +var recipeReply = []string{"菜品具体的做法推荐您去网上查看哦", "很难只通过只言片语就将一道好菜描述清楚哦,推荐您去网上查看对应菜谱", "具体的做法建议您去相关的菜谱网站上查看哦", "这道菜的做法难以通过三言两语描述清楚,您最好去相关的菜谱网站查看哦"} + +// 讲格力NLU返回的播报话术拼接腾讯的chat格式返回 +func getGreeNluChatReply(responseText, domain, query string) []byte { + replyData := `{ + "header": { + "semantic": { + "code": 0, + "domain": "` + chatDomainStr + `", + "intent": "` + "chat" + `", + "msg": "gree_mix_tencent", + "session_complete": true, + "skill_id": "` + domain + `" + } + }, + "response_text": "` + responseText + `", + "asr_recongize": "` + query + `" + }` //updated25 + return []byte(replyData) +} + +// 未知技能用chat格式兜底 +func replyWithChat(response_text, domain string) []byte { + jsonStr := `{"header":{"semantic":{"code":0,"domain":"` + chatDomainStr + `","intent":"chat","msg":"","session_complete":true,"skill_id":"` + domain + `"}},"response_text":"` + response_text + `"}` + return []byte(jsonStr) +} + +func replyWithChatV2(response_text, domain, intent string) []byte { + jsonStr := `{"header":{"semantic":{"code":0,"domain":"` + domain + `","intent":"` + intent + `","msg":"","session_complete":true,"skill_id":"` + domain + `"}},"response_text":"` + response_text + `"}` + return []byte(jsonStr) +} + +func replyWithHeader(heraderRaw string, responseText string) []byte { + jsonStr := `{"header":` + heraderRaw + `,"response_text":"` + responseText + `"}` + return []byte(jsonStr) +} + +func reply(response_text, domain, intent string) []byte { + jsonStr := `{ + "header": { + "semantic": { + "code": 0, + "domain": "` + domain + `", + "intent": "` + intent + `", + "msg": "", + "session_complete": true, + "skill_id": "` + domain + `" + } + }, + "response_text": "` + response_text + `" + }` + return []byte(jsonStr) +} + +// 测试音频 +func getTencentSongReply(url, content, query string) []byte { + songJsonStr := `{"header":{"semantic":{"code":0,"domain":"fm","intent":"play","msg":"","session_complete":true,"skill_id":"990835382587363328"}},"response_text":"` + content + `","asr_recongize":"` + query + `","listItems":[{"url":"` + url + `","singer":"测试音频","song":"测试音频"}]}` + return []byte(songJsonStr) +} + +// 腾讯协议转格力协议reply +func transformGreeProtocolReply(query, service, action string, params *map[string]interface{}) []byte { + // "time": { "orgin": "2021-04-14 00:00:00", "norm": "2021-04-14 00:00:00", "code": 0 } + greeNluProtocol := model.GreeNluProtocol{} + + semantic := make(map[string]interface{}) + semantic["service"] = service + semantic["action"] = action + if params != nil { + semantic["params"] = params + } + + semantic["outputContext"] = model.OutputContextStr{Service: "TENCENT-NLU"} + greeNluProtocol.Semantic = &semantic + greeNluProtocol.Query = query + + resultData := make(map[string]interface{}) + greeNluProtocol.Result.ResultData = &resultData + jsonStr, _ := json.Marshal(greeNluProtocol) + return jsonStr +} diff --git a/service/tencentNlu/semantic.go b/service/tencentNlu/semantic.go new file mode 100644 index 0000000..8a4b786 --- /dev/null +++ b/service/tencentNlu/semantic.go @@ -0,0 +1,216 @@ +package tencentNlu + +import ( + "encoding/json" + "io/ioutil" + "net/http" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "strings" + "time" +) + +// 压力测试标志 +var isTest = false + +// 腾讯NLU +func GetTencentNLUData(data *model.SemanticReq, bot *model.DingDangBot) ([]byte, *model.TokenSearchResponse, error) { + // 获取botkey 和 botsecret + var botKey, botSecret string + botKey = bot.Key + botSecret = bot.Secret + url := global.TencentSetting.DingDangNluUrl + // errLogFile := errorLogfile + time.Now().Format("200601") + + // auth, dsn, appkey, accessToken, err := GetAuthorization(data.MacWifi, data.RequestId) + // if err != nil { + // auth = "" + // dsn = "" + // global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"data.MacWifi": data.MacWifi}, "requestId": data.RequestId}).Error("GetTencentNLUData: GetAuthorization error" + err.Error()) + + // } + + var auth, dsn string + + // 获取授权信息 + tokenSearchResponse, err := GetAuthorizationByGRPC(data.MacWifi, data.RequestId, data.Mid, data.Vender) + if err != nil { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"data.MacWifi": data.MacWifi}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": data.RequestId}).Error("GetTencentNLUData: GetAuthorizationByGRPC error." + err.Error()) + } else { + if tokenSearchResponse.Status.Code == 200 { + // 200: 成功; 405: 设备未激活 + // if tokenSearchResponse.Data.Status != 0 { // 未分配 的情况下无AppKey AccessToken + // if tokenSearchResponse.Data.AppKey != "" && tokenSearchResponse.Data.AccessToken != "" { + // botKey = tokenSearchResponse.Data.AppKey + // botSecret = tokenSearchResponse.Data.AccessToken + // } + // } + // Status == 0 未分配 的情况下也存在AppKey AccessToken + if tokenSearchResponse.Data.AppKey != "" && tokenSearchResponse.Data.AccessToken != "" { + botKey = tokenSearchResponse.Data.AppKey + botSecret = tokenSearchResponse.Data.AccessToken + } else { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"tokenSearchResponse": tokenSearchResponse}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": data.RequestId}).Error("GetTencentNLUData: appkey accessToken is not exist.") + } + if tokenSearchResponse.Data.Status == 2 { // 已授权,使用中 + auth = tokenSearchResponse.Data.Authorization + dsn = tokenSearchResponse.Data.Dsn + } + if tokenSearchResponse.Data.Dsn != "" { + dsn = tokenSearchResponse.Data.Dsn + } + } else if tokenSearchResponse.Status.Code == 405 { // 未分配 + // + } else { // 错误码 + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"tokenSearchResponse": tokenSearchResponse}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": data.RequestId}).Error("GetTencentNLUData: GetAuthorizationByGRPC error." + tokenSearchResponse.Status.Msg) + } + } + + // 2022年9月7日11:45:45 特例 进行排查 + // tokenSearchResponse.Data.Status = 2 + // botKey = "8d3b6076-3bb4-4c26-89c3-011447996044" + // botSecret = "31b62495be9b4ff389ee952a4c4bd2cf" + // auth = "BACKEND-ENCRYPT:1000,NywxMTA2MDk4MzczLDc4M0ZGODcyQkJBREMwQTE1OTAyNTNBRjRCRTU5QjU3LEI2ODFDQzMzNzM4QjAyQUNEMUU0RjhFQzYyNjUwODdELDhkM2I2MDc2LTNiYjQtNGMyNi04OWMzLTAxMTQ0Nzk5NjA0NDozMWI2MjQ5NWJlOWI0ZmYzODllZTk1MmE0YzRiZDJjZiw4ZDNiNjA3Ni0zYmI0LTRjMjYtODljMy0wMTE0NDc5OTYwNDRfY2ZhNzFiYzkxNzQxNGEwNWMwMDI5OTBmNmU1MjA4MzEsNDI3ZGZlZWEwMDhmZDQ5Yg==" + // dsn = "8d3b6076-3bb4-4c26-89c3-011447996044_cfa71bc917414a05c002990f6e520831" + + // if appkey != "" && accessToken != "" { + // botKey = appkey + // botSecret = accessToken + // } + + var richReq model.RicAnswer + var jsonStr string + if isTest == true { + //logfile = "semantic_logfile_" + time.Now().Format("200601") + jsonStr = `{ + "header": + { + "guid": "` + data.TestID + `", + "qua": "QV=3&PL=ADR&PR=chvoice&VE=7.6&VN=3350&PP=com.geli.mtt&DE=SPEAKER&SP=3", + "user": { + "user_id": "test" + }, + "ip": "` + data.Ip + `" + }, + "payload": + { + "query":"` + data.Query + `" + } + }` + //fmt.Println(jsonStr) + } else { + // TODO: 将MacVoice改成MacWifi + secretMac := ComputeHmac256(data.MacVoice, global.TencentSetting.TencentSha256Secret) //对mac做sha256加密处理后发送到腾讯NLU + //fmt.Println(secretMac) + orgins := botKey + ":" + botSecret + ":" + secretMac + //fmt.Println(orgins) + secretGuid := ComputerMd5(orgins) + //fmt.Println(secretGuid) + //logfile = "/roobo/logs/gree.service/unisound/semantic_logfile_" + time.Now().Format("200601") + if dsn != "" { + secretGuid = "" + } + richReq.Header.Guid = secretGuid + richReq.Header.Device.SerialNum = dsn + richReq.Header.User.Auth = auth + // 参考tapd 81496972 bug, DE字段的使用 + richReq.Header.Qua = "QV=3&PL=ADR&PR=chvoice&VE=7.6&VN=3350&PP=com.geli.mtt&DE=SPEAKER&SP=3" + // wireless_speaker 无屏设备 + // richReq.Header.Qua = "QV=3&PL=ADR&PR=chvoice&VE=7.6&VN=3350&PP=com.geli.mtt&DE=wireless_speaker&SP=3" + richReq.Header.Ip = data.Ip + // 经纬度 + richReq.Header.Lbs = data.Lbs + richReq.Payload.Query = data.Query + + rb, err := json.Marshal(&richReq) + if err != nil { + //logme.LogtoFile("json marshal error:" + err.Error(), logrus.InfoLevel, "jm-richanswer") + // utils.LogErrorToFile(errLogFile, "json.Marshal error:"+err.Error()) + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"richReq": richReq}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": data.RequestId}).Error("GetTencentNLUData: json.Marshal error" + err.Error()) + return nil, nil, err + } + + jsonStr = string(rb) + + //fmt.Println(jsonStr) + } + // var logReqResp utils.LogData + // reqTime := time.Now() + // logReqResp.RequestData = utils.RemoveSpaceAndLineBreaks(jsonStr) + // logFileName := tencentLogFile + time.Now().Format("20060102") + credentialDate := time.Now().Format("20060102T150405Z") + //fmt.Println(jsonStr) + //fmt.Println(credentialDate) + signingContent := jsonStr + credentialDate + signature := ComputeHmac256(signingContent, botSecret) + authorizationHeader := "TVS-HMAC-SHA256-BASIC" + " " + "CredentialKey=" + botKey + ", " + "Datetime=" + credentialDate + ", " + "Signature=" + signature + + req, err := http.NewRequest("POST", url, strings.NewReader(jsonStr)) + if nil != err { + // log.Println("GetSemanticData: create new request hander error") + // log.Println(err) + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"jsonStr": jsonStr}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": data.RequestId}).Error("GetTencentNLUData: create new request hander error. " + err.Error()) + + } + req.Close = true //解决POST EOF 问题 + req.Header.Set("Content-Type", "application/json;charset=utf-8") + req.Header.Add("Authorization", authorizationHeader) + client := &http.Client{} + client.Timeout = time.Second * 2 + + // 请求log + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": jsonStr}, + "url": url, + "mac": data.MacWifi, + "mid": data.Mid, + "vender": data.Vender, + "requestId": data.RequestId, + }).Info("tencent-nlu-http-post request.") + startTime := time.Now() + resp, err := client.Do(req) + // costTime := time.Now().Sub(reqTime) + // logReqResp.CostTime = fmt.Sprint(costTime) + if nil != err { + // utils.StoreToLogfile(logFileName, logReqResp) + //log.Println("GetSemanticData: Get TencentNLU data error") + //log.Println(err) + // return nil, auth, errors.New(err.Error() + " costTime:" + logReqResp.CostTime) + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"jsonStr": jsonStr}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": data.RequestId}).Error("GetTencentNLUData: Get TencentNLU data error. " + err.Error()) + + // return nil, nil, errors.New(err.Error() + " costTime:") + return nil, nil, err + + } + + defer resp.Body.Close() + + content, err := ioutil.ReadAll(resp.Body) + if nil != err { + // log.Println("GetSemanticData: Read response data body error") + // log.Println(err) + global.Logger.WithFields(logger.Fields{"mac": data.MacWifi, "requestId": data.RequestId}).Error("GetTencentNLUData: Read response data body error." + err.Error()) + return nil, nil, err + } + cost := time.Now().Sub(startTime).Milliseconds() + // 返回log + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"responseBody": string(content)}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": data.RequestId}).Info("tencent-nlu-http-post response.") + // 只记录关键信息 + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"sessionId": string(resp.Header.Get("sessionid")), "appkey": data.Appkey}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "cost": cost, "requestId": data.RequestId}).Info("tencent-nlu-http-post response main info.") + + //fmt.Println("content1:", string(content)) + // logfile + //resTime := time.Now() + //costTime := resTime.Sub(reqTime) + // logReqResp.CostTime = fmt.Sprint(costTime) + // logReqResp.ResponseData = utils.RemoveSpaceAndLineBreaks(string(content)) + + //recordsop.SaveTentSemantic(logReqResp) + //fmt.Println("content2:", string(content)) + + // utils.StoreToLogfile(logFileName, logReqResp) + // log.Println("GetSemanticData: return data", string(content)) + //fmt.Println("content3: ", string(content)) + return content, tokenSearchResponse, nil +} diff --git a/service/tencentNlu/tencent.go b/service/tencentNlu/tencent.go new file mode 100644 index 0000000..058429c --- /dev/null +++ b/service/tencentNlu/tencent.go @@ -0,0 +1,239 @@ +package tencentNlu + +import ( + "net" + "speech-nlu-parse/dao" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/errCode" + "speech-nlu-parse/pkg/logger" + + _ "github.com/go-sql-driver/mysql" + "github.com/tidwall/gjson" +) + +func init() { + // 注册 + register() + registerV2() + registerWs() +} + +// 解析腾讯资源 +func ParseTencentJson(jsonData []byte, mac string, tokenSearchResponse *model.TokenSearchResponse, query, mid string) []byte { + //fmt.Println(string(jsonData)) + domain := gjson.GetBytes(jsonData, "header.semantic.domain") + //isOtherDomain := false + //items := "" + var jsonByte []byte + reply_when_tencent_empty = replyMessage[getRandom(len(replyMessage))] + // 音乐 + // 新闻 + // 天气 + // 唐诗 + // 故事 + // 体育 + // 笑话 + // 星座 + // 节日 + // 股市 + // 翻译 + // 黄历 + // 财经 + // 食物 + // 一般问答 + // 百科 + // 成语 + // 科学 + // 菜谱 + // 历史 + // 聊天 + // 地理 + // 其他 + + domainStr := domain.String() + params := &model.DomainParams{JsonData: jsonData, TokenSearchResponse: tokenSearchResponse, Mac: mac, Domain: domainStr, Mid: mid, Query: query} + + // fmt.Println(global.GetLimitedSetting("6400").ShieldedDomainList) + // 根据mid屏蔽部分domain, 并返回 + if IsContain(domainStr, global.GetLimitedSetting(mid).ShieldedDomainList) { + jsonByte = shieldedDomain(params) + return jsonByte + } + + // 校验jsonData + if !KeyValueCheck(jsonData) { + // 异常时进行兜底 + return replyWithChat(error_reply, "doudi") + } + + if value, ok := getHandler(domainStr); ok { + jsonByte = value(params) + } else { + // 其他domain进行兜底 + jsonByte = otherDomain(params) + } + + return jsonByte +} + +// 增加兜底 zww 2018-11-23 +func newModuleTest(jsonData []byte, query string) []byte { + header := gjson.GetBytes(jsonData, "header") + response_text := gjson.GetBytes(jsonData, "response_text") + listItems := gjson.GetBytes(jsonData, "listItems") + outputContextService := gjson.GetBytes(jsonData, "semantic.outputContext.service") + jsonStr := "" + if outputContextService.Exists() && outputContextService.Str == "TENCENT-NLU" { + // 进行的协议转换, 直接返回 + return jsonData + } else if !header.Exists() { + //fmt.Println("json data header/payload dose not exists!") + // items := `{"code":501,"errorType":"result header dose not exists!"}` + return replyWithChat(error_reply, "doudi") + // return []byte(items) + } else if len(listItems.Array()) > 0 { + jsonStr = `{"header":` + header.Raw + `,"response_text":` + response_text.Raw + `,"asr_recongize":"` + + query + `","listItems":` + listItems.Raw + `}` + return []byte(jsonStr) + //} else if response_text.Str == "" && len(listItems.Array()) == 0 { + } else if response_text.Str == "" { + if len(listItems.Array()) == 0 && gjson.GetBytes(jsonData, "header.semantic.domain").String() != "news" { + jsonStr = `{"header":` + header.Raw + `,"response_text":"` + reply_when_tencent_empty + `","asr_recongize":"` + query + `"}` + + } else { + // response_text 为空字符串时回复不应该为"不支持此功能", 已修改 + // jsonStr = `{"header":` + header.Raw + `,"response_text":"` + reply_when_tencent_empty + `","asr_recongize":"` + query + `"}` + jsonStr = `{"header":` + header.Raw + `,"response_text":"` + response_text.String() + `","asr_recongize":"` + query + `"}` + + } + + return []byte(jsonStr) + } else if listItems.Exists() && len(listItems.Array()) == 0 { + jsonStr = `{"header":` + header.Raw + `,"response_text":` + response_text.Raw + `,"asr_recongize":"` + + query + `","listItems":[]}` + return []byte(jsonStr) + } else if response_text.Str == reply_when_tencent_empty { + //utils.LogErrorToFile(logfileError, tencent_response_error + " errorquery:" + query) + jsonStr = `{"header":` + header.Raw + `,"response_text":` + response_text.Raw + `,"asr_recongize":"` + query + `"}` + return []byte(jsonStr) + } else { + jsonStr = `{"header":` + header.Raw + `,"response_text":` + response_text.Raw + `,"asr_recongize":"` + query + `"}` + return []byte(jsonStr) + } +} + +func TencentNlu(reqStruct *model.SemanticReq) (string, *errCode.Error) { + if reqStruct == nil { + return string(replyWithChat(error_reply, "doudi")), errCode.RequestFormatError + } + + // 结果 + var channelStr string + + //ts := time.Now() + err, content, url := dao.GetTestContent(reqStruct.MacWifi, reqStruct.Query) + //tc := time.Since(ts) + //fmt.Println(time.Now().String()[:19], err, reqStruct.MacWifi, reqStruct.Query, tc) + if err == nil { + channelStr = string(getTencentSongReply(url, content, reqStruct.Query)) + } else { + if reqStruct.Query == "声道测试" || reqStruct.Query == "音响音质测试" || reqStruct.Query == "音箱音质测试" { + // channelStr = string(getTencentSongReply("", reqStruct.Query)) + // err, content, url := dao.GetAnyTestContent(reqStruct.MacWifi, reqStruct.Query) + url = global.OthersSetting.SoundTestUrl + content = "" + channelStr = string(getTencentSongReply(url, content, reqStruct.Query)) + + } else if reqStruct.Query == "重定向测试" { + url = "http://nlu.gree.com/temp/music" + content = "" + channelStr = string(getTencentSongReply(url, content, reqStruct.Query)) + + } else if reqStruct.Query == "编号七零六八一" && reqStruct.MacWifi == "f4911e594443" { + channelStr = string(getGreeNluChatReply("好的,计时五分钟马上开始,五,四,三,二,一", "countdown", reqStruct.Query)) + } else { + // 判断mid和MidType, 请求新接口 + var dingDangBot *model.DingDangBot + var ok bool + // 通过 mid 和 midType 去查找bot + dingDangBot, ok = global.DingDangBot.Get(reqStruct.Mid, reqStruct.Vender) + if ok { + // if dingDangBot.UrlType == 1 { // 采用新接口 + // //GetTNluDataAndParse() + // tencentNluV2 := TencentNluV2{ + // SemanticReq: reqStruct, + // } + // // tencentV2 + // // TODO: 新方案接口都采用流式接口, 不会有流量到该接口 + // return string(tencentNluV2.GetTNluDataAndParse(reqStruct, dingDangBot)), errCode.Success + // } + } else { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{ + "reqStruct": reqStruct, + }, "requestId": reqStruct.RequestId, "mac": reqStruct.MacWifi, "mid": reqStruct.Mid, "vender": reqStruct.Vender}).Warnf("global.DingDangBot.Get error. mid vender is not exist.") + + // 未找到对应的bot, 采用默认的bot + dingDangBot = &model.DingDangBot{ + Key: "8d3b6076-3bb4-4c26-89c3-011447996044", + Secret: "31b62495be9b4ff389ee952a4c4bd2cf", + } + } + // 旧版tencent, 语音空调 + tencentRespByteData, tokenSearchResponse, err := GetTencentNLUData(reqStruct, dingDangBot) + //tencent_test + // fmt.Println("tencentRespByteData") + // fmt.Println(string(tencentRespByteData)) + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"tencentRespStrData": string(tencentRespByteData)}, + "requestId": reqStruct.RequestId, + "mac": reqStruct.MacWifi, + "mid": reqStruct.Mid, + "vender": reqStruct.Vender, + }).Debug("GetTencentNLUData.") + if nil != err { + if netErr, ok := err.(net.Error); ok && netErr.Timeout() { // 请求腾讯叮当超时 + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"reqStruct": reqStruct}, + "requestId": reqStruct.RequestId, + "mac": reqStruct.MacWifi, + "mid": reqStruct.Mid, + "vender": reqStruct.Vender, + }).Warn("request tencent nlu timeout. " + err.Error()) + return string(replyWithChat(error_reply, "tencent_timeout")), errCode.DingdangInterfaceTimeout + } + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"reqStruct": reqStruct}, + "requestId": reqStruct.RequestId, + "mac": reqStruct.MacWifi, + "mid": reqStruct.Mid, + "vender": reqStruct.Vender, + }).Error("Get Tencent API data error." + err.Error()) + // return `{"code":501,"errorType":"source api data error, check it and try again!"}` + return string(replyWithChat(error_reply, "doudi")), errCode.InternalServiceError + } else if string(tencentRespByteData) == "Frequency Beyond Limit" { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"reqStruct": reqStruct}, + "requestId": reqStruct.RequestId, + "mac": reqStruct.MacWifi, + "mid": reqStruct.Mid, + "vender": reqStruct.Vender, + }).Info("HandleService: Too many request." + err.Error()) + // return `{"code":501,"errorType":"source api error, check it and try again!"}` + return string(replyWithChat(frequency_request_reply, "doudi")), errCode.DingdangInterfaceRequestFrequency + } + + semanticRespByteData := ParseTencentJson(tencentRespByteData, reqStruct.MacWifi, tokenSearchResponse, reqStruct.OriginQuery, reqStruct.Mid) + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"semanticRespStrData": string(semanticRespByteData)}, + "requestId": reqStruct.RequestId, + "mac": reqStruct.MacWifi, + "mid": reqStruct.Mid, + "vender": reqStruct.Vender, + }).Debug("ParseTencentJson.") + + semanticRespByteData = newModuleTest(semanticRespByteData, reqStruct.OriginQuery) + //domain := gjson.GetBytes(semanticRespByteData, "header.semantic.domain") + channelStr = string(semanticRespByteData) + + } + } + + return channelStr, errCode.Success +} diff --git a/service/tencentNlu/tencentNlpSkill.go b/service/tencentNlu/tencentNlpSkill.go new file mode 100644 index 0000000..5fc7d28 --- /dev/null +++ b/service/tencentNlu/tencentNlpSkill.go @@ -0,0 +1,136 @@ +package tencentNlu + +import ( + "context" + "errors" + "fmt" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "speech-nlu-parse/pkg/proto" + "time" + + "google.golang.org/grpc" +) + +type TencentNlpSkill struct { +} + +func (this *TencentNlpSkill) GetCommandReq(mac, homeId string, requestId string, resp *model.TencentNlpWsResp) (*proto.TencentNlpSkillRequest, error) { + + if !resp.CheckSkill() { + return nil, errors.New("GetReq resp Skill is not exist.") + } + + var name string + var param map[string]string + cmd := resp.GetCommand() + name = cmd.Name + param = cmd.Param + + var textList []*proto.TextItem + textList = make([]*proto.TextItem, 0) + for i := 0; i < len(cmd.TextList); i++ { + textList = append(textList, &proto.TextItem{ + Status: cmd.TextList[i].Status, + Text: cmd.TextList[i].Text, + PlaceholderList: cmd.TextList[i].PlaceholderList, + }) + } + + req := proto.TencentNlpSkillRequest{ + AppInfo: &proto.TencentNlpSkillRequest_AppInfo{ + RequestId: requestId, + }, + DevInfo: &proto.TencentNlpSkillRequest_DevInfo{ + Mac: mac, + }, + Command: &proto.Command{ + Name: name, + Param: param, + TextList: textList, + }, + UserInfo: &proto.TencentNlpSkillRequest_UserInfo{ + Hid: homeId, + }, + } + + return &req, nil +} + +func (this *TencentNlpSkill) GetNativeReq(mac, homeId string, requestId string, resp *model.TencentNlpWsResp) (*proto.TencentNlpSkillRequest, error) { + + if !resp.CheckNative() { + return nil, errors.New("GetNativeReq resp Native is not exist.") + } + + var name string + var param map[string]string + native := resp.GetNativate() + name = native.Name + param = native.Param + + req := proto.TencentNlpSkillRequest{ + AppInfo: &proto.TencentNlpSkillRequest_AppInfo{ + RequestId: requestId, + }, + DevInfo: &proto.TencentNlpSkillRequest_DevInfo{ + Mac: mac, + }, + Command: &proto.Command{ + Name: name, + Param: param, + }, + UserInfo: &proto.TencentNlpSkillRequest_UserInfo{ + // Uid: , + Hid: homeId, + }, + } + + return &req, nil +} + +func (this *TencentNlpSkill) Req(params *model.DomainParamsWs, req *proto.TencentNlpSkillRequest) (*proto.TencentNlpSkillResponse, error) { + requestId := params.RequestId + mac := params.Mac + mid := params.Mid + vender := params.MidType + sessionId := params.SessionId + serviceInfo, err := global.ConsulObj.GetService("alarm_remind", "") + if err != nil { + return nil, err + } + conn, err := grpc.Dial(fmt.Sprintf("%s:%d", serviceInfo.GetAddress(), serviceInfo.GetPort()), grpc.WithInsecure(), grpc.WithNoProxy()) + if err != nil { + return nil, err + } + defer conn.Close() + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{ + "tencentNlpSkillRequest": req, + }, + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNlpSkill request.") + c := proto.NewTencentNlpSkillClient(conn) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*2) + defer cancel() + rep, err := c.Process(ctx, req) + if err != nil { + return nil, err + } + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{ + "tencentNlpSkillRequest": rep, + }, + "requestId": requestId, + "mac": mac, + "mid": mid, + "vender": vender, + "sessionId": sessionId, + }).Info("TencentNlpSkill response.") + return rep, nil +} diff --git a/service/tencentNlu/tencentWs.go b/service/tencentNlu/tencentWs.go new file mode 100644 index 0000000..516583d --- /dev/null +++ b/service/tencentNlu/tencentWs.go @@ -0,0 +1,458 @@ +package tencentNlu + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "speech-nlu-parse/pkg/proto" + "time" + + "github.com/gorilla/websocket" +) + +// 腾讯 nlp websocket + +type TencentNlpWs struct { + NlpWsConn *websocket.Conn + AppKey string + AccessToken string + Auth string + Dsn string + Qua string + HomeId string +} + +func (this *TencentNlpWs) GetTencentDialogHandler(appkey, accessToken, tRequestId, ip, auth, dsn string) (*websocket.Conn, error) { + wsUrl := fmt.Sprintf("%s/dialog", global.TencentGwSetting.Gw.GwWs) + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"wsUrl": wsUrl}, + // "requestId": requestId, + }).Info("GetTencentDialogHandler wsUrl.") + // wsUrl = "wss://gwgray.tvs.qq.com/v2/ws/dialog" + dialogUrl, err := url.Parse(wsUrl) + if err != nil { + // log + global.Logger.WithFields(logger.Fields{ + // "requestId": this.semanticeReq.Re questId, + }).Errorf("GetTencentDialogHandler error. %v", err) + return nil, err + } + timeStamp := time.Now().Unix() + signature := HmacSha256AndBase64(fmt.Sprintf("appkey=%s&requestid=%s×tamp=%d", appkey, tRequestId, timeStamp), accessToken) + v := url.Values{} + v.Add("appkey", appkey) + v.Add("requestid", tRequestId) + v.Add("signature", signature) + v.Add("timestamp", fmt.Sprintf("%d", timeStamp)) + dialogUrl.RawQuery = v.Encode() + + d := websocket.Dialer{ + HandshakeTimeout: 30 * time.Second, + } + header := http.Header{} + header.Add("Content-Type", "application/json;charset=utf-8") + header.Add("X-Forwarded-For", ip) + header.Add("Authorization", fmt.Sprintf("Bearer %s", auth)) + header.Add("DSN", dsn) + + conn, _, err := d.Dial(dialogUrl.String(), header) + if err != nil { + global.Logger.WithFields(logger.Fields{ + // "requestId": this.semanticeReq.RequestId, + }).Errorf("GetTencentDialogHandler Dial error. %v", err) + return nil, err + } + return conn, nil +} + +func (this *TencentNlpWs) Send(data interface{}) error { + this.NlpWsConn.WriteJSON(data) + return nil +} + +func (this *TencentNlpWs) Recv() ([]byte, error) { + _, msg, err := this.NlpWsConn.ReadMessage() + return msg, err +} + +func TansTencentNlpWsReq(appkey, dsn, qua, auth string, semanticReq *model.SemanticReq) *model.TencentNlpWs { + reqBody := model.TencentNlpWs{} + reqBody.Header.RequestID = semanticReq.TRequestId + reqBody.Header.DSN = dsn + reqBody.Header.QUA = qua + reqBody.Header.AppKey = appkey + var location *model.Location + if semanticReq.Lbs != nil { + location = &model.Location{ + Longitude: float32(semanticReq.Lbs.Longitude), + Latitude: float32(semanticReq.Lbs.Latitude), + } + // 仅使用city字段 + if semanticReq.AddressInfo != nil { + location.City = semanticReq.AddressInfo.City + } + } + reqBody.Header.Location = location + reqBody.Payload.CommType = semanticReq.CommType + + var sdkExtend *model.SDKExtend + if semanticReq.SDKExtend != nil { + sdkExtend = &model.SDKExtend{ + CarDOA: semanticReq.SDKExtend.CarDOA, + LastRspType: semanticReq.SDKExtend.LastRspType, + LastRspResult: semanticReq.SDKExtend.LastRspResult, + LastSessionStatus: semanticReq.SDKExtend.LastSessionStatus, + LastCompleteCmdResult: semanticReq.SDKExtend.LastCompleteCmdResult, + } + reqBody.Payload.SDKExtend = sdkExtend + } + + requestType := semanticReq.RequestType + reqBody.Payload.RequestType = requestType + // 解析responseType + switch requestType { + case "semantic.text": + // 请求的 RequestType 标识需为 semantic.text + // Common + reqBody.Payload.Common.GUID = "" // 传dsn就不传guid + reqBody.Payload.Common.QUA = qua + reqBody.Payload.Common.AppeKey = appkey + reqBody.Payload.Common.DSN = dsn + reqBody.Payload.Common.CharacterID = semanticReq.CharacterID + + reqBody.Payload.Semantic.Query = semanticReq.Query + reqBody.Payload.Semantic.Language = semanticReq.Language + case "semantic.specific": + // 请求的 RequestType 标识需为 semantic.specific + reqBody.Payload.Semantic.Event = semanticReq.Event + case "native.api.data": + // Native API响应是由客户端发起的请求,通过请求向云端返回Native API数据,对应向云端的请求中 + // RequestType 需指定为 native.api.data 。 + reqBody.Payload.Common.GUID = "" // 传dsn就不传guid + reqBody.Payload.Common.QUA = qua + reqBody.Payload.Common.AppeKey = appkey + reqBody.Payload.Common.DSN = dsn + reqBody.Payload.Common.CharacterID = semanticReq.CharacterID + + // Native + var native *model.Native + if semanticReq.Nativate != nil { + native = &model.Native{ + Name: semanticReq.Nativate.Name, + SeqID: semanticReq.Nativate.SeqID, + Code: semanticReq.Nativate.Code, + Message: semanticReq.Nativate.Message, + DataVersion: semanticReq.Nativate.DataVersion, + // Data 由云端和客户端一起定 + } + } + reqBody.Payload.Native = native + default: + // 未知 requestType + global.Logger.Errorf("error TansTencentNlpWsReq unknown requestType %v", requestType) + } + + return &reqBody +} + +func (this *TencentNlpWs) ParseTNluData(jsonData []byte, mid, midType, requestId, sessionId, mac string) []byte { + tencentNlpWsResp := model.TencentNlpWsResp{} + err := json.Unmarshal(jsonData, &tencentNlpWsResp) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData Unmarshal error.") + return replyWithChat(error_reply, "doudi") + } + if !tencentNlpWsResp.CheckHeader() { + // Header不存在 + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData response Header is not exist.") + return replyWithChat(error_reply, "doudi") + } + code := tencentNlpWsResp.GetCode() + // 解析 + if code != 0 { + // 状态码异常 打印log + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData response code error.") + return replyWithChat(error_reply, "doudi") + } + // 解析 ResponseType native.api.request、semantic.close + if !tencentNlpWsResp.CheckPayload() { + // Payload不存在 + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData response Payload is not exist.") + return replyWithChat(error_reply, "doudi") + } + responseType := tencentNlpWsResp.GetResponseType() + if responseType == "native.api.request" || responseType == "asr.stream.data" { + if !tencentNlpWsResp.CheckData() { + // Data不存在 + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData response Data is not exist.") + return replyWithChat(error_reply, "doudi") + } + // 解析 + params := &model.DomainParamsWs{ + TencentNlpResp: &tencentNlpWsResp, + // TokenSearchResponse: this.tokenSearchResponse, + Mid: mid, + Mac: mac, + MidType: midType, + Query: "", + RequestId: requestId, + SessionId: sessionId, + HomeId: this.HomeId, + AppKey: this.AppKey, + } + return this.ParseNativeApiRequest(params) + } + + // 对domain进行划分 + domainStr := tencentNlpWsResp.GetDomain() + if domainStr == "" { + // domain不存在, 打印log + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData domain is not exist.") + return replyWithChat(error_reply, "doudi") + } + if !tencentNlpWsResp.CheckSemantic() { + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData semantic is not exist.") + } + var jsonByte []byte + reply_when_tencent_empty = replyMessage[getRandom(len(replyMessage))] + query := tencentNlpWsResp.GetQuery() + params := &model.DomainParamsWs{ + TencentNlpResp: &tencentNlpWsResp, + // TokenSearchResponse: this.tokenSearchResponse, + Query: query, + Mid: mid, + Mac: mac, + MidType: midType, + RequestId: requestId, + TencentNlpWs: this, + SessionId: sessionId, + HomeId: this.HomeId, + AppKey: this.AppKey, + } + if IsContain(domainStr, global.GetLimitedSetting(mid).ShieldedDomainList) { + jsonByte = ShieldedDomainWs(params) + return jsonByte + } + if value, ok := getHandlerWs(domainStr); ok { + jsonByte = value(params) + } else { + // 其他domain进行兜底 + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "requestId": requestId, + }).Error("ParseTNluData domain handler is not exist.") + jsonByte = OtherDomainWs(params) + } + return jsonByte +} + +// 屏蔽处理 +func ShieldedDomainWs(params *model.DomainParamsWs) []byte { + domainStr := params.TencentNlpResp.Payload.Data.Semantic.Results[0].Nlu.Domain + intentStr := params.TencentNlpResp.Payload.Data.Semantic.Results[0].Nlu.Intent + // 暂不支持此功能 + resultTextStr := shielded_reply + return replyWithChat(resultTextStr, domainStr+"."+intentStr) + +} + +// 不进行register +func OtherDomainWs(params *model.DomainParamsWs) []byte { + if !params.TencentNlpResp.CheckDm() || !params.TencentNlpResp.CheckNlu() { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + }).Error("OtherDomainWs Dm is not exist.") + return replyWithChat(error_reply, "doudi") + } + + text := params.TencentNlpResp.GetText() + domain := params.TencentNlpResp.GetDomain() + intent := params.TencentNlpResp.GetIntent() + var resultText string + if text != "" { + resultText = text + return replyWithChatV2(resultText, domain, intent) + + } else { + resultText = reply_when_tencent_empty + return replyWithChat(resultText, domain) + } +} + +func (this *TencentNlpWs) GetTencentWsReq(name, seqId string, resp *proto.TencentNlpSkillResponse) (*model.TencentNlpWs, error) { + var req *model.TencentNlpWs + req = &model.TencentNlpWs{} + req.Header.AppKey = this.AppKey + req.Header.DSN = this.Dsn + req.Header.QUA = this.Qua + req.Payload.RequestType = "native.api.data" + var native *model.Native + native = &model.Native{ + Name: name, + SeqID: seqId, + Code: 0, + Message: "", + DataVersion: "2.0", // 理论上由技能服务返回 + } + native.Data.DataArr = make([]map[string]string, 0) + result := resp.GetResult() + for i := 0; i < len(result); i++ { + // result[i].TypeUrl, 后续考虑一下标识 + var jsonData map[string]string + err := json.Unmarshal(result[i].Value, &jsonData) + if err != nil { + return nil, err + } + native.Data.DataArr = append(native.Data.DataArr, jsonData) + } + req.Payload.Native = native + return req, nil +} + +func (this *TencentNlpWs) WsSend(body *model.TencentNlpWs) { + this.Send(body) +} + +func (this *TencentNlpWs) ParseNativeApiRequest(params *model.DomainParamsWs) []byte { + var res model.ResponseBody + if !params.TencentNlpResp.CheckHeader() || !params.TencentNlpResp.CheckNative() { + // 响应体内容缺少 + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + }).Error("ParseNativeApiRequest error Header or CheckNative not exist.") + return replyWithChat(error_reply, "doudi") + } + native := params.TencentNlpResp.GetNativate() + if IsNativateClondHandle(params) { + nativeName := native.Name + switch nativeName { + case "Native://Tencent.Alarm.SearchAlarm", "Native://Tencent.Reminder.CollectPermissionInfo", + "Native://Tencent.Reminder.SearchNote": + tencentNlpSkill := TencentNlpSkill{} + nativeReq, err := tencentNlpSkill.GetNativeReq(params.Mac, params.HomeId, params.RequestId, params.TencentNlpResp) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + }).Errorf("tencentNlpSkill.GetNativeReq error. %v", err) + return replyWithChat(error_reply, "doudi") + } + resp, err := tencentNlpSkill.Req(params, nativeReq) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + }).Errorf("tencentNlpSkill.Req error. %v", err) + return replyWithChat(error_reply, "doudi") + } + if !CheckStatusCode(resp) { + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{ + "tencentNlpSkillRespBody": resp, + // "query": data.Query, + }, + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Info("tencentNlpSkill.Req code error.") + return replyWithChat(error_reply, "doudi") + } + wsReqBody, err := this.GetTencentWsReq(native.Name, native.SeqID, resp) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + }).Errorf("this.GetTencentWsReq error. %v", err) + return replyWithChat(error_reply, "doudi") + } + this.WsSend(wsReqBody) + tRequestBody, _ := json.Marshal(wsReqBody) + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{ + "tencentNluParseStreamBody": string(tRequestBody), + // "query": data.Query, + }, + "requestId": params.RequestId, + "mac": params.Mac, + "mid": params.Mid, + "vender": params.MidType, + "sessionId": params.SessionId, + }).Info("TencentNluParseStream tencentNluWs.Send.") + // 查询并返回 + // this.Send() + return []byte("") + } + } + + code := params.TencentNlpResp.GetCode() + msg := params.TencentNlpResp.GetMessage() + + res.Header.Semantic.Code = code + res.Header.Semantic.Msg = msg + payloadData := &model.PayloadData{} + payloadData.Class = params.TencentNlpResp.GetClass() + payloadData.Native = model.PayloadDataNative{ + Name: native.Name, + SeqID: native.SeqID, + Timeout: native.Timeout, + Param: native.Param, + } + res.Header.Semantic.Data = payloadData + + resByte, err := json.Marshal(res) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "requestId": params.RequestId, + }).Errorf("Marshal error. %v", err) + return replyWithChat(error_reply, "doudi") + } + return resByte +} + +// 根据机型和appkey判断 +func IsNativateClondHandle(params *model.DomainParamsWs) bool { + var flag bool + flag = false + if params.Mid == "10f05" && params.MidType == "7e000024" && params.AppKey == "a8814080829e11eda5c8e38bb1008e50" { + flag = true + } else if params.Mid == "10f05" { + if params.MidType == "87654321" { + flag = true + } + } + return flag +} + +func CheckStatusCode(resp *proto.TencentNlpSkillResponse) bool { + if resp == nil { + return false + } + if resp.GetStatus().GetCode() != 0 { + return false + } + return true +} diff --git a/service/tencentNlu/tencentv2.go b/service/tencentNlu/tencentv2.go new file mode 100644 index 0000000..8c61fd7 --- /dev/null +++ b/service/tencentNlu/tencentv2.go @@ -0,0 +1,256 @@ +package tencentNlu + +import ( + "bytes" + "crypto/hmac" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "speech-nlu-parse/global" + "speech-nlu-parse/model" + "speech-nlu-parse/pkg/logger" + "time" +) + +type TencentNluV2 struct { + SemanticReq *model.SemanticReq + // tokenSearchResponse *model.TokenSearchResponse +} + +// 腾讯新接口 +func (this *TencentNluV2) GetTNluDataAndParse(data *model.SemanticReq, bot *model.DingDangBot) []byte { + content, err := this.GetTencentNluDataV2(data, bot) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "mac": data.MacWifi, + "mid": data.Mid, + "vender": data.Vender, + "requestId": this.SemanticReq.RequestId, + }).Error("GetTencentNluDataV2 error.") + return replyWithChat(error_reply, "doudi") + } + // 解析原始的 + return this.ParseTNluData(content, data) +} + +func (this *TencentNluV2) ParseTNluData(jsonData []byte, data *model.SemanticReq) []byte { + tencentNlpResp := model.TencentNlpResp{} + err := json.Unmarshal(jsonData, &tencentNlpResp) + if err != nil { + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "mac": data.MacWifi, + "mid": data.Mid, + "vender": data.Vender, + "requestId": this.SemanticReq.RequestId, + }).Error("ParseTNluData Unmarshal error.") + return replyWithChat(error_reply, "doudi") + } + if !tencentNlpResp.CheckHeader() { + // Header不存在 + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "mac": data.MacWifi, + "mid": data.Mid, + "vender": data.Vender, + "requestId": this.SemanticReq.RequestId, + }).Error("ParseTNluData response code error.") + return replyWithChat(error_reply, "doudi") + } + + code := tencentNlpResp.GetCode() + // 解析 + if code != 0 { + // 状态码异常 打印log + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"requestBody": string(jsonData)}, + "mac": data.MacWifi, + "mid": data.Mid, + "vender": data.Vender, + "requestId": this.SemanticReq.RequestId, + }).Error("ParseTNluData response code error.") + return replyWithChat(error_reply, "doudi") + } + + domainStr := tencentNlpResp.GetDomain() + + if domainStr == "" { + // domain不存在, 打印log + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"requestBody": string(jsonData)}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": this.SemanticReq.RequestId}).Error("ParseTNluData domain is not exist.") + return replyWithChat(error_reply, "doudi") + } + + var jsonByte []byte + reply_when_tencent_empty = replyMessage[getRandom(len(replyMessage))] + params := &model.DomainParamsV2{ + TencentNlpResp: &tencentNlpResp, + // TokenSearchResponse: this.tokenSearchResponse, + Mac: this.SemanticReq.MacWifi, + Domain: domainStr, + Mid: this.SemanticReq.Mid, + Query: this.SemanticReq.Query, + RequestId: this.SemanticReq.RequestId, + } + + // fmt.Println(global.GetLimitedSetting("6400").ShieldedDomainList) + // 根据mid屏蔽部分domain, 并返回 + if IsContain(domainStr, global.GetLimitedSetting(this.SemanticReq.Mid).ShieldedDomainList) { + jsonByte = ShieldedDomainV2(params) + return jsonByte + } + + if value, ok := getHandlerV2(domainStr); ok { + jsonByte = value(params) + } else { + // 其他domain进行兜底 + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"requestBody": string(jsonData)}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": this.SemanticReq.RequestId}).Error("ParseTNluData domain handler is not exist.") + jsonByte = OtherDomainV2(params) + } + + return jsonByte +} + +func (this *TencentNluV2) GetTencentNluDataV2(data *model.SemanticReq, bot *model.DingDangBot) ([]byte, error) { + // 获取botkey 和 botsecret + var botKey, botSecret string + var auth, dsn string + // var guid string + var qua string = "QV=3&PL=ADR&PR=chvoice&VE=7.6&VN=3350&PP=com.geli.mtt&DE=SPEAKER&SP=3" // 默认 + + botKey = bot.Key // 默认 + botSecret = bot.Secret // 默认 + + // 存在鉴权信息 + if data.Appkey != "" && data.AccessToken != "" { + botKey = data.Appkey + botSecret = data.AccessToken + } + if data.Qua != "" { + qua = data.Qua + } + if data.Auth != "" && data.Dsn != "" { + auth = data.Auth + dsn = data.Dsn + } else { + // 不存在鉴权信息则从dmsdk查询, 直接報錯 + return []byte(""), errors.New("auth or dsn is not exist.") + } + + // fmt.Println("exist:", data.Exist) + // fmt.Println("appkey:", botKey) + // fmt.Println("accessToken:", botSecret) + // fmt.Println("qua:", qua) + // fmt.Println("auth:", auth) + // fmt.Println("dsn:", dsn) + // fmt.Println("guid:", guid) + + // this.tokenSearchResponse = tokenSearchResponse + + timeStamp := time.Now().Unix() + // url := "https://gwgray.tvs.qq.com/v2/ai/nlp" + url := fmt.Sprintf("%s%s", global.TencentGwSetting.Gw.GwHost, "/ai/nlp") + + reqBody := model.TencentNlp{} + reqBody.Header.DSN = dsn + reqBody.Header.QUA = qua + // reqBody.Header.Authorization = auth + // reqBody.Header.GUID = guid + // reqBody.Header.IP = data.Ip + + var location *model.Location + if data.Lbs != nil { + location = &model.Location{ + Longitude: float32(data.Lbs.Longitude), + Latitude: float32(data.Lbs.Latitude), + } + } + reqBody.Header.Location = location + + reqBody.Payload.Semantic.Query = data.Query + + rb, err := json.Marshal(&reqBody) + if err != nil { + // TODO: 错误返回 + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"jsonStr": string(rb)}, + "requestId": data.RequestId, + "mac": data.MacWifi, + "mid": data.Mid, + "vender": data.Vender, + }).Error("GetTencentNLUDataV2: Marshal error. " + err.Error()) + return []byte(""), err + } + req, err := http.NewRequest(http.MethodPost, url, bytes.NewBuffer(rb)) + query := req.URL.Query() + query.Add("appkey", botKey) + query.Add("requestid", data.TRequestId) // 增加腾讯requestId + query.Add("signature", HmacSha256AndBase64(fmt.Sprintf("appkey=%s&requestid=%s×tamp=%d", botKey, data.TRequestId, timeStamp), botSecret)) + query.Add("timestamp", fmt.Sprintf("%d", timeStamp)) + req.URL.RawQuery = query.Encode() + req.Header.Set("Content-Type", "application/json;charset=utf-8") + req.Header.Set("X-Forwarded-For", data.Ip) + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", auth)) + + global.Logger.WithFields(logger.Fields{ + "url": url, + "data": map[string]interface{}{"requestBody": string(rb)}, + "requestId": data.RequestId, + "mac": data.MacWifi, + "mid": data.Mid, + "vender": data.Vender, + }).Info("tencent-nlu-v2-http-post request.") + client := &http.Client{} + + resp, err := client.Do(req) + if nil != err { + global.Logger.WithFields(logger.Fields{"data": map[string]interface{}{"jsonStr": string(rb)}, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender, "requestId": data.RequestId}).Error("GetTencentNLUDataV2: Get TencentNLU data error. " + err.Error()) + return []byte(""), err + + } + defer resp.Body.Close() + content, err := ioutil.ReadAll(resp.Body) + if nil != err { + global.Logger.WithFields(logger.Fields{"requestId": data.RequestId, "mac": data.MacWifi, "mid": data.Mid, "vender": data.Vender}).Error("GetTencentNLUData: Read response data body error." + err.Error()) + return []byte(""), err + } + global.Logger.WithFields(logger.Fields{ + "data": map[string]interface{}{"responseBody": string(content)}, + "requestId": data.RequestId, + "mac": data.MacWifi, + "mid": data.Mid, + "vender": data.Vender, + "sessionId": string(resp.Header.Get("sessionid")), + }).Info("tencent-nlu-v2-http-post response.") + + return content, nil +} + +func HmacSha256AndBase64(message string, secret string) string { + h := hmac.New(sha256.New, []byte(secret)) + h.Write([]byte(message)) + return base64.StdEncoding.EncodeToString(h.Sum(nil)) +} + +// 屏蔽处理 +func ShieldedDomainV2(params *model.DomainParamsV2) []byte { + domainStr := params.TencentNlpResp.Payload.Semantic.Results[0].Nlu.Domain + intentStr := params.TencentNlpResp.Payload.Semantic.Results[0].Nlu.Intent + // 暂不支持此功能 + resultTextStr := shielded_reply + return replyWithChat(resultTextStr, domainStr+"."+intentStr) + +} + +// 不进行register +func OtherDomainV2(params *model.DomainParamsV2) []byte { + + resultText := reply_when_tencent_empty + domain := params.TencentNlpResp.GetDomain() + // chat回复需修改 + return replyWithChat(resultText, domain) + +} diff --git a/service/tencentNlu/utils.go b/service/tencentNlu/utils.go new file mode 100644 index 0000000..39c8092 --- /dev/null +++ b/service/tencentNlu/utils.go @@ -0,0 +1,40 @@ +package tencentNlu + +import ( + "crypto/hmac" + "crypto/md5" + "crypto/sha256" + "fmt" + "io" + "math/rand" + "time" +) + +//用appkey、appSceret和HMAC-SHA256(mac, secremacSHA256SecrettKey)三个字符串拼接,以":"作为分隔符,再做md5生成guid +func ComputerMd5(orginStr string) string { + data := []byte(orginStr) + hash := md5.Sum(data) + md5Str := fmt.Sprintf("%x", hash) + return md5Str +} + +func ComputeHmac256(message string, secret string) string { + h := hmac.New(sha256.New, []byte(secret)) + io.WriteString(h, message) + return fmt.Sprintf("%x", h.Sum(nil)) +} + +func getRandom(count int) int { + r := rand.New(rand.NewSource(time.Now().UnixNano())) + return r.Intn(count) +} + +// 是否包含 +func IsContain(source string, targetList []string) bool { + for i := 0; i < len(targetList); i++ { + if source == targetList[i] { + return true + } + } + return false +} -- GitLab