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