hsun 1 년 전
부모
커밋
0f9702e6eb
1개의 변경된 파일19개의 추가작업 그리고 6개의 파일을 삭제
  1. 19 6
      controllers/speech_recognition/speech_recognition.go

+ 19 - 6
controllers/speech_recognition/speech_recognition.go

@@ -27,18 +27,31 @@ type SpeechRecognitionCommonController struct {
 // @Success 200 string "操作成功"
 // @router /rec_task/callback [post]
 func (this *SpeechRecognitionCommonController) RecTaskCallback() {
+	utils.FileLog.Info("RecTaskCallback, -1")
 	// 此接口返回指定响应体
 	br := new(services.TencentRecTaskCallbackResp)
 	defer func() {
 		_ = this.JSON(br, false, false)
 	}()
 	var req services.TencentRecTaskCallback
-	utils.FileLog.Info("RecTaskCallback, body: " + string(this.Ctx.Input.RequestBody))
-	if e := json.Unmarshal(this.Ctx.Input.RequestBody, &req); e != nil {
-		br.Code = 403
-		br.Message = "参数解析失败"
-		return
-	}
+
+	utils.FileLog.Info("RecTaskCallback, 0")
+
+	code, _ := this.GetInt("code", 0)
+	req.Code = code
+	requestId, _ := this.GetInt("requestId", 0)
+	req.RequestId = uint64(requestId)
+	text := this.GetString("text")
+	req.Text = text
+	resultDetail := this.GetString("resultDetail")
+	req.ResultDetail = resultDetail
+
+	//utils.FileLog.Info("RecTaskCallback, body: " + string(this.Ctx.Input.RequestBody))
+	//if e := json.Unmarshal(this.Ctx.Input.RequestBody, &req); e != nil {
+	//	br.Code = 403
+	//	br.Message = "参数解析失败"
+	//	return
+	//}
 	utils.FileLog.Info("RecTaskCallback, 1")
 
 	// TODO:处理回调结果