| @@ -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). | ||||