From 42091f61f931fb319fff7604e9f8e7d7f5396bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=96=87=E9=9D=99?= <1319697849@qq.com> Date: Thu, 26 Jun 2025 17:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8E=86=E5=8F=B2=E4=B8=8A?= =?UTF-8?q?=E7=9A=84=E4=BB=8A=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ c2c.http | 14 +++++++------- service/speechNlu/domain.go | 8 ++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a753fab..94c609d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # 更新日志 +## [0.0.1-beta.4] - 2025.6.26 +### Changed +- 修改历史上的今天,修改限制判断 + ## [0.0.1-beta.4] - 2025.6.24 ### Changed - 增加音乐专辑字段 diff --git a/c2c.http b/c2c.http index 2c4bba1..805ac38 100644 --- a/c2c.http +++ b/c2c.http @@ -10,7 +10,7 @@ Content-Type: application/json }, "nluRet": { "asr_recongize": "", - "text": "换一首歌" + "text": "几点了几点了几点了" } }, "version": "v0" @@ -24,8 +24,8 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db { "ip": "14.215.222.17", "mac": "ece154a865eb", - "mid": "11011", - "query":"换个故事", + "mid": "10f05", + "query":"历史上的今天", "requestId": "123456111" } @@ -38,8 +38,8 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db { "ip": "14.215.222.17", "mac": "ece154a865eb", - "mid": "11011", - "query":"换个故事", + "mid": "10f05", + "query":"历史上的今天", "requestId": "123456111" } @@ -60,7 +60,7 @@ Content-Type: application/json "trafficParameter": "mode=childxxx;macWifi=28b77c218ed1;mid=10f05;vender=7e000025;macVoice=testyuntiancloud;ver=3.0;scenario=smarthome;filterName=nlu;req_nlu_length=1;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu2;version=0.5;filterUrl=https://testnlu.gree.com:443/semantic/unisoundc2c/querys;" }, "nluRet": { - "text": "哈萨克斯坦的全称" + "text": "几点了伦敦" }, "postProc": {} } @@ -101,7 +101,7 @@ Content-Type: application/json "trafficParameter": "mode=childxx;macWifi=ece154a73d38;mid=11011;macVoice=testyuntiancloud;ver=3.0;scenario=smarthome;filterName=nlu;req_nlu_length=1;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu2;version=0.5;filterUrl=https://testnlu.gree.com:443/semantic/unisoundc2c/querys;" }, "nluRet": { - "text": "换一首歌" + "text": "播放治愈" }, "postProc": {} } diff --git a/service/speechNlu/domain.go b/service/speechNlu/domain.go index 8f579b3..1d42153 100644 --- a/service/speechNlu/domain.go +++ b/service/speechNlu/domain.go @@ -127,7 +127,7 @@ func calendarDomain(params *model.SpeechDomainParams) []byte { var l int //var resStrb string - if len(sliceData) < global.GetLimitedSetting(params.Mid).HistoryNum { + if len(sliceData) < global.GetLimitedSetting(params.Mid).HistoryNum || global.GetLimitedSetting(params.Mid).HistoryNum < 0 { l = len(sliceData) } else { // 使用限制的条数 l = global.GetLimitedSetting(params.Mid).HistoryNum @@ -824,9 +824,7 @@ func musicDomain(params *model.SpeechDomainParams) []byte { } query := params.SpeechWsResp.Dm.Input - if !params.CheckDmCommand() { - return replyWithChat(error_reply, "doudi") - } else { + if params.CheckDmCommand() { if params.SpeechWsResp.Dm.Command.Api != "" { switch params.SpeechWsResp.Dm.Command.Api { case "DUI.MediaController.Pause": @@ -839,6 +837,8 @@ func musicDomain(params *model.SpeechDomainParams) []byte { return transformGreeProtocolReply(query, "PlayControl", "control_next", nil) case "DUI.MediaController.Prev": return transformGreeProtocolReply(query, "PlayControl", "control_previous", nil) + case "DUI.MediaController.SetPlayMode": + return transformGreeProtocolReply(query, "PlayControl", "control_previous", nil) } } } -- GitLab