diff --git a/model/models.go b/model/models.go index e6d969ec2b64a282c01dcb45230b4ca7b59b730f..62905509c80b1325dbade642e9ecd6d10a49ef3c 100644 --- a/model/models.go +++ b/model/models.go @@ -270,7 +270,7 @@ type ResponseBody struct { } `json:"header"` ResponseText string `json:"response_text"` AsrRecongize string `json:"asr_recongize"` - ListItems []map[string]interface{} `json:"listItems"` + ListItems []map[string]interface{} `json:"listItems,omitempty"` } type SDKExtend struct { diff --git a/service/speechNlu/domain.go b/service/speechNlu/domain.go index 76c8ee3a32d11463a0e132fbdcad3b7b193be86c..0f9b2e2f50f9dd016582dbb3f3945c5608e9bfe9 100644 --- a/service/speechNlu/domain.go +++ b/service/speechNlu/domain.go @@ -51,6 +51,7 @@ func baseParse(params *model.SpeechDomainParams) (*model.ResponseBody, error) { //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 !params.SpeechWsResp.Dm.ShouldEndSession { fmt.Println("保存:", params.SpeechWsResp.SessionId) UpdateSession(params.Mac, params.SpeechWsResp.SessionId) diff --git a/service/speechNlu/speechWs.go b/service/speechNlu/speechWs.go index 96d8991ab8d0d4cccac147161d20a6fd373953a2..069606d0404d7aa0d763a5545335838d2ddff4e1 100644 --- a/service/speechNlu/speechWs.go +++ b/service/speechNlu/speechWs.go @@ -76,6 +76,10 @@ func SpeechNlpWsReq(data *model.SemanticReq, sessionId string) *SpeechWsData { req.SessionId = sessionId req.RefText = data.Query log.Printf("请求的sessionId: %s", req.SessionId) + global.Logger.WithFields(logger.Fields{ + "req": req, + "sessionId": sessionId, + }).Error("SpeechNlpWsReq") return req }