diff --git a/modules/aisafety/resty.go b/modules/aisafety/resty.go index 4ca133d89..8bb1ef078 100644 --- a/modules/aisafety/resty.go +++ b/modules/aisafety/resty.go @@ -122,20 +122,23 @@ func getParams(req TaskReq) (map[string]interface{}, string) { return params, reStr } -func CreateSafetyTask(req TaskReq, json string) (string, error) { +func CreateSafetyTask(req TaskReq, jsonstr string) (string, error) { checkSetting() client := getRestyClient() //reqPara, _ := json.Marshal(body) - log.Warn("job req:", json) + log.Warn("job req:", jsonstr) params, urlQuerys := getParams(req) bodyMap := make(map[string]interface{}) reJsonMap := make(map[string]interface{}) - reJsonMap["resJson"] = json + reJsonMap["resJson"] = jsonstr bodyMap["externalEvalParam"] = reJsonMap + reqPara, _ := json.Marshal(bodyMap) + log.Warn("job req json:", string(reqPara)) + res, err := client.R(). SetHeader("Content-Type", "application/json"). SetHeader("appId", APPID).