Commit ee5e9986 authored by 赵文静's avatar 赵文静

增加换一个故事

parent 7d7afa37
Pipeline #5477 passed with stage
in 0 seconds
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
- 故事返回增加专辑字段 - 故事返回增加专辑字段
- http入口新增需要AppKey校验 - http入口新增需要AppKey校验
- 增加换一首歌 - 增加换一首歌
- 增加换个故事
## [0.0.1-beta.3] - 2025.6.19 ## [0.0.1-beta.3] - 2025.6.19
### Changed ### Changed
......
...@@ -25,7 +25,7 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db ...@@ -25,7 +25,7 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db
"ip": "14.215.222.17", "ip": "14.215.222.17",
"mac": "ece154a865eb", "mac": "ece154a865eb",
"mid": "11011", "mid": "11011",
"query":"换一首歌", "query":"换个故事",
"requestId": "123456111" "requestId": "123456111"
} }
...@@ -39,7 +39,7 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db ...@@ -39,7 +39,7 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db
"ip": "14.215.222.17", "ip": "14.215.222.17",
"mac": "ece154a865eb", "mac": "ece154a865eb",
"mid": "11011", "mid": "11011",
"query":"播放音乐", "query":"换个故事",
"requestId": "123456111" "requestId": "123456111"
} }
......
...@@ -642,6 +642,24 @@ func fmDomain(params *model.SpeechDomainParams) []byte { ...@@ -642,6 +642,24 @@ func fmDomain(params *model.SpeechDomainParams) []byte {
return replyWithChat(error_reply, "doudi") return replyWithChat(error_reply, "doudi")
} }
query := params.SpeechWsResp.Dm.Input
if params.CheckDmCommand() {
if params.SpeechWsResp.Dm.Command.Api != "" {
switch params.SpeechWsResp.Dm.Command.Api {
case "DUI.MediaController.Pause":
return transformGreeProtocolReply(query, "PlayControl", "control_pause", nil)
case "DUI.MediaController.Play":
return transformGreeProtocolReply(query, "PlayControl", "control_resume", nil)
case "DUI.MediaController.Stop":
return transformGreeProtocolReply(query, "PlayControl", "control_stop", nil)
case "DUI.MediaController.Next", "DUI.MediaController.Switch":
return transformGreeProtocolReply(query, "PlayControl", "control_next", nil)
case "DUI.MediaController.Prev":
return transformGreeProtocolReply(query, "PlayControl", "control_previous", nil)
}
}
}
res.Header.Semantic.Domain = "fm" res.Header.Semantic.Domain = "fm"
res.Header.Semantic.Intent = "play_radio" res.Header.Semantic.Intent = "play_radio"
res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent
......
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"log"
"speech-nlu-parse/dao" "speech-nlu-parse/dao"
"speech-nlu-parse/global" "speech-nlu-parse/global"
"speech-nlu-parse/model" "speech-nlu-parse/model"
...@@ -164,6 +165,8 @@ func receiveMessage(conn *websocket.Conn, done chan struct{}, dataChan chan<- [] ...@@ -164,6 +165,8 @@ func receiveMessage(conn *websocket.Conn, done chan struct{}, dataChan chan<- []
"time": fmt.Sprintf("%.3fs", time.Since(start).Seconds()), "time": fmt.Sprintf("%.3fs", time.Since(start).Seconds()),
}).Info("speech origin data") }).Info("speech origin data")
log.Println(string(message))
//思必驰nlu回复 //思必驰nlu回复
var resp model.SpeechWsResp var resp model.SpeechWsResp
if err := json.Unmarshal(message, &resp); err != nil { if err := json.Unmarshal(message, &resp); err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment