|
|
@ -1,10 +1,10 @@
|
|
|
|
package com.ruoyi.zhiyuanzhe.utils;
|
|
|
|
package com.ruoyi.zhiyuanzhe.utils;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
import org.apache.commons.text.StringEscapeUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
@ -29,8 +29,12 @@ public class PushDataUtil {
|
|
|
|
String key = IdUtil.simpleUUID();
|
|
|
|
String key = IdUtil.simpleUUID();
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
|
param.put("key", key);
|
|
|
|
param.put("key", key);
|
|
|
|
param.put("elementjsonstr", StringEscapeUtils.escapeJson(elementjsonstr));
|
|
|
|
param.put("elementjsonstr", elementjsonstr);
|
|
|
|
String result = HttpUtil.post(pushUrl, param);
|
|
|
|
String body = JSONUtil.toJsonStr(param);
|
|
|
|
|
|
|
|
String result = HttpRequest.post(pushUrl)
|
|
|
|
|
|
|
|
.body(body)
|
|
|
|
|
|
|
|
.execute()
|
|
|
|
|
|
|
|
.body();
|
|
|
|
Map map = JSONObject.parseObject(result, Map.class);
|
|
|
|
Map map = JSONObject.parseObject(result, Map.class);
|
|
|
|
System.err.println(map);
|
|
|
|
System.err.println(map);
|
|
|
|
Object code = map.get("code");
|
|
|
|
Object code = map.get("code");
|
|
|
|