Browse Source

增加打印。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
2111f00f22
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      modules/aisafety/resty.go

+ 6
- 3
modules/aisafety/resty.go View File

@@ -122,20 +122,23 @@ func getParams(req TaskReq) (map[string]interface{}, string) {
return params, reStr return params, reStr
} }


func CreateSafetyTask(req TaskReq, json string) (string, error) {
func CreateSafetyTask(req TaskReq, jsonstr string) (string, error) {
checkSetting() checkSetting()
client := getRestyClient() client := getRestyClient()


//reqPara, _ := json.Marshal(body) //reqPara, _ := json.Marshal(body)
log.Warn("job req:", json)
log.Warn("job req:", jsonstr)


params, urlQuerys := getParams(req) params, urlQuerys := getParams(req)


bodyMap := make(map[string]interface{}) bodyMap := make(map[string]interface{})
reJsonMap := make(map[string]interface{}) reJsonMap := make(map[string]interface{})
reJsonMap["resJson"] = json
reJsonMap["resJson"] = jsonstr
bodyMap["externalEvalParam"] = reJsonMap bodyMap["externalEvalParam"] = reJsonMap


reqPara, _ := json.Marshal(bodyMap)
log.Warn("job req json:", string(reqPara))

res, err := client.R(). res, err := client.R().
SetHeader("Content-Type", "application/json"). SetHeader("Content-Type", "application/json").
SetHeader("appId", APPID). SetHeader("appId", APPID).


Loading…
Cancel
Save