Commit 782c412e authored by 赵文静's avatar 赵文静

修改兜底

parent d957c603
......@@ -116,7 +116,7 @@ func calendarDomain(params *model.SpeechDomainParams) []byte {
"vender": params.MidType,
}).Error("params.SpeechWsResp.Dm.Widget.Extra.Result不是数组类型")
if res.ResponseText != "" {
return replyWithChat(res.ResponseText, "doudi")
return replyWithChat(res.ResponseText, "chat")
}
return replyWithChat(error_reply, "doudi")
}
......@@ -200,7 +200,7 @@ func newsDomain(params *model.SpeechDomainParams) []byte {
"vender": params.MidType,
}).Error("params.SpeechWsResp.Dm.Widget.Content不是数组类型")
if res.ResponseText != "" {
return replyWithChat(res.ResponseText, "doudi")
return replyWithChat(res.ResponseText, "chat")
}
return replyWithChat(error_reply, "doudi")
}
......@@ -254,6 +254,10 @@ func ancientpoemDomain(params *model.SpeechDomainParams) []byte {
})
res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent
return Marshal(params, res)
} else if params.SpeechWsResp.Dm.IntentName == "查询诗句" {
res.Header.Semantic.Intent = "search_ancientpoem_chains"
res.Header.Semantic.SkillId = res.Header.Semantic.Domain + "." + res.Header.Semantic.Intent
return Marshal(params, res)
}
res.ListItems = make([]map[string]interface{}, 0)
......@@ -266,6 +270,9 @@ func ancientpoemDomain(params *model.SpeechDomainParams) []byte {
"mid": params.Mid,
"vender": params.MidType,
}).Error("params.SpeechWsResp.Dm.Widget.Content不是数组类型")
if res.ResponseText != "" {
return replyWithChat(res.ResponseText, "chat")
}
return replyWithChat(error_reply, "doudi")
} else {
for _, item := range sliceData {
......@@ -337,6 +344,9 @@ func jokeDomain(params *model.SpeechDomainParams) []byte {
"mid": params.Mid,
"vender": params.MidType,
}).Error("params.SpeechWsResp.Dm.Widget.Content不是数组类型")
if res.ResponseText != "" {
return replyWithChat(res.ResponseText, "chat")
}
return replyWithChat(error_reply, "doudi")
}
......@@ -652,7 +662,7 @@ func fmDomain(params *model.SpeechDomainParams) []byte {
"vender": params.MidType,
}).Error("params.SpeechWsResp.Dm.Widget.Content不是数组类型")
if res.ResponseText != "" {
return replyWithChat(res.ResponseText, "doudi")
return replyWithChat(res.ResponseText, "chat")
}
return replyWithChat(error_reply, "doudi")
}
......@@ -667,7 +677,7 @@ func fmDomain(params *model.SpeechDomainParams) []byte {
"mid": params.Mid,
"vender": params.MidType,
}).Errorf("json.Unmarshal元素解析失败: %v", err)
return replyWithChat(error_reply, "doudi")
return replyWithChat(params.SpeechWsResp.Dm.Nlg, "doudi")
}
res.ListItems = append(res.ListItems, map[string]interface{}{
"url": con.LinkUrl,
......@@ -856,7 +866,7 @@ func sleepMusicDomain(params *model.SpeechDomainParams) []byte {
"vender": params.MidType,
}).Error("params.SpeechWsResp.Dm.Widget.Content不是数组类型")
if res.ResponseText != "" {
return replyWithChat(res.ResponseText, "doudi")
return replyWithChat(res.ResponseText, "chat")
}
return replyWithChat(error_reply, "doudi")
}
......
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