Commit 7d7afa37 authored by 赵文静's avatar 赵文静

增加换一首歌

parent e282b311
Pipeline #5474 passed with stage
in 0 seconds
......@@ -10,7 +10,7 @@ Content-Type: application/json
},
"nluRet": {
"asr_recongize": "",
"text": "合肥今天几点下雨"
"text": "换一首歌"
}
},
"version": "v0"
......@@ -39,7 +39,7 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db
"ip": "14.215.222.17",
"mac": "ece154a865eb",
"mid": "11011",
"query":"播放正版",
"query":"播放音乐",
"requestId": "123456111"
}
......
......@@ -805,6 +805,26 @@ func musicDomain(params *model.SpeechDomainParams) []byte {
database.DeleteSession(params.Mac)
}
query := params.SpeechWsResp.Dm.Input
if !params.CheckDmCommand() {
return replyWithChat(error_reply, "doudi")
} else {
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)
}
}
}
list, err := connect.MusicGrpc(params)
if err != nil {
global.Logger.WithFields(logger.Fields{
......
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