Commit 293deb54 authored by 赵文静's avatar 赵文静

修改新闻

parent 2bf675ef
Pipeline #5270 passed with stage
in 0 seconds
...@@ -14,7 +14,7 @@ Content-Type: application/json ...@@ -14,7 +14,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;" "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": { "nluRet": {
"text": "明天的呢" "text": "关闭闹钟"
}, },
"postProc": {} "postProc": {}
} }
...@@ -28,12 +28,12 @@ Content-Type: application/json ...@@ -28,12 +28,12 @@ Content-Type: application/json
"reqParam": { "reqParam": {
"common": { "common": {
"remoteIP": "14.215.222.17", "remoteIP": "14.215.222.17",
"requestId": "1234568123123118111", "requestId": "1234568123123118129",
"trafficParameter": "ver=3.0;scenario=smarthome;filterName=nlu2;req_nlu_length=2;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu;mid=11011;version=0.5;macWifi=28b77c23817b1234111111;macVoice=28b77c23817b1234111111" "trafficParameter": "ver=3.0;scenario=smarthome;filterName=nlu2;req_nlu_length=2;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu;mid=11011;version=0.5;macWifi=28b77c23817b1234111111;macVoice=28b77c23817b1234111111"
}, },
"nluRet": { "nluRet": {
"asr_recongize": "", "asr_recongize": "",
"text": "明天呢" "text": "关闭提醒"
} }
}, },
"version": "v0" "version": "v0"
...@@ -55,7 +55,7 @@ Content-Type: application/json ...@@ -55,7 +55,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;" "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": { "nluRet": {
"text": "播放音乐" "text": "停止提醒"
}, },
"postProc": {} "postProc": {}
} }
......
...@@ -52,10 +52,11 @@ func baseParse(params *model.SpeechDomainParams) (*model.ResponseBody, error) { ...@@ -52,10 +52,11 @@ func baseParse(params *model.SpeechDomainParams) (*model.ResponseBody, error) {
result.ResponseText = params.SpeechWsResp.Dm.Nlg result.ResponseText = params.SpeechWsResp.Dm.Nlg
result.AsrRecongize = params.SpeechWsResp.Dm.Input result.AsrRecongize = params.SpeechWsResp.Dm.Input
//result.ListItems = make([]map[string]interface{}, 0) //result.ListItems = make([]map[string]interface{}, 0)
if !params.SpeechWsResp.Dm.ShouldEndSession { //if !params.SpeechWsResp.Dm.ShouldEndSession {
fmt.Println("保存:", params.SpeechWsResp.SessionId) // fmt.Println("保存:", params.SpeechWsResp.SessionId)
// UpdateSession(params.Mac, params.SpeechWsResp.SessionId)
//}
UpdateSession(params.Mac, params.SpeechWsResp.SessionId) UpdateSession(params.Mac, params.SpeechWsResp.SessionId)
}
return &result, nil return &result, nil
} }
...@@ -448,14 +449,6 @@ func alarmDomain(params *model.SpeechDomainParams) []byte { ...@@ -448,14 +449,6 @@ func alarmDomain(params *model.SpeechDomainParams) []byte {
"vender": params.MidType, "vender": params.MidType,
}).Errorf("json.Unmarshal error: %v", err) }).Errorf("json.Unmarshal error: %v", err)
} }
if len(extraParam.Content) > 0 {
var content map[string]interface{}
if err := json.Unmarshal(extraParam.Content, &content); err == nil {
if len(content) == 0 {
return Marshal(params, &result)
}
}
}
if object == "闹钟" { if object == "闹钟" {
result.Header.Semantic.Domain = "alarm" result.Header.Semantic.Domain = "alarm"
...@@ -465,49 +458,28 @@ func alarmDomain(params *model.SpeechDomainParams) []byte { ...@@ -465,49 +458,28 @@ func alarmDomain(params *model.SpeechDomainParams) []byte {
if api == "ai.dui.dskdm.reminder.query" { if api == "ai.dui.dskdm.reminder.query" {
result.Header.Semantic.Intent = "check" result.Header.Semantic.Intent = "check"
result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent
} else if api == "ai.dui.dskdm.reminder.insert" { } else if api == "ai.dui.dskdm.reminder.insert" {
result.Header.Semantic.Intent = "new" result.Header.Semantic.Intent = "new"
result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent
resAlarm, err := connect.AlarmGrpc(params, api, extra, object)
if err != nil {
global.Logger.WithFields(logger.Fields{
"requestId": params.RequestId,
"mac": params.Mac,
"mid": params.Mid,
"vender": params.MidType,
}).Errorf("connect.AlarmGrpc error:%v", err)
return replyWithChat(error_reply, "doudi")
}
if resAlarm.GetStatus().GetCode() == 0 {
return Marshal(params, &result)
} else {
resultTextStr := "网络不稳定,请稍后再试"
return replyWithChat(resultTextStr, "chat.chat")
}
} else if api == "ai.dui.dskdm.reminder.remove" { } else if api == "ai.dui.dskdm.reminder.remove" {
result.Header.Semantic.Intent = "delete" result.Header.Semantic.Intent = "delete"
result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent
resAlarm, err := connect.AlarmGrpc(params, api, extra, object)
if err != nil {
global.Logger.WithFields(logger.Fields{
"requestId": params.RequestId,
"mac": params.Mac,
"mid": params.Mid,
"vender": params.MidType,
}).Errorf("connect.AlarmGrpc error:%v", err)
return replyWithChat(error_reply, "doudi")
}
if resAlarm.GetStatus().GetCode() == 0 {
return Marshal(params, &result)
} else {
resultTextStr := "网络不稳定,请稍后再试"
return replyWithChat(resultTextStr, "chat.chat")
}
} else if api == "ai.dui.dskdm.reminder.shut" { } else if api == "ai.dui.dskdm.reminder.shut" {
result.Header.Semantic.Intent = "stop" result.Header.Semantic.Intent = "stop"
}
result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent
if len(extraParam.Content) > 0 {
var content map[string]interface{}
if err := json.Unmarshal(extraParam.Content, &content); err == nil {
if len(content) == 0 {
return Marshal(params, &result)
}
}
}
if api == "ai.dui.dskdm.reminder.query" {
//result.Header.Semantic.Intent = "check"
//result.Header.Semantic.SkillId = result.Header.Semantic.Domain + "." + result.Header.Semantic.Intent
} else if api == "ai.dui.dskdm.reminder.insert" || api == "ai.dui.dskdm.reminder.remove" || api == "ai.dui.dskdm.reminder.shut" {
resAlarm, err := connect.AlarmGrpc(params, api, extra, object) resAlarm, err := connect.AlarmGrpc(params, api, extra, object)
if err != nil { if err != nil {
global.Logger.WithFields(logger.Fields{ global.Logger.WithFields(logger.Fields{
...@@ -524,6 +496,7 @@ func alarmDomain(params *model.SpeechDomainParams) []byte { ...@@ -524,6 +496,7 @@ func alarmDomain(params *model.SpeechDomainParams) []byte {
resultTextStr := "网络不稳定,请稍后再试" resultTextStr := "网络不稳定,请稍后再试"
return replyWithChat(resultTextStr, "chat.chat") return replyWithChat(resultTextStr, "chat.chat")
} }
} }
// //
......
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