提交 9b05216b 编写于 作者: Crimson's avatar Crimson

usr代码添加回调rest信息

上级 c293d0c8
......@@ -114,35 +114,32 @@ public class IMService {
}
public IM hD(String im_id, IM im) {
im = this.client.get(im_id);
if ("30".equals(im.getImwfstate())) {
// PS
PS ps = new PS();
ps.setPSId(im.getIMId());
ps = psService.get(ps.getPSId());
if (ps != null) {
ps.setImstate("30");
// PS
PS ps = new PS();
ps.setPSId(im.getIMId());
ps = psService.get(ps.getPSId());
if (ps != null) {
ps.setImstate("30");
// psService.update(ps.getPSId(), ps);
}
if (im.getRest() != null) {
JSONArray callbackdata = JSONObject.parseArray(im.getRest());
if (callbackdata.size() > 0) {
for (int i =0; i < callbackdata.size(); i++) {
JSONObject jo = callbackdata.getJSONObject(i);
HttpMethod httpMethod = HttpMethod.valueOf(jo.getString("method"));
String url = jo.getString("url");
JSONObject params = null;
if (jo.getBoolean("containspk")) {
String replaceStr = url.substring(url.indexOf("{"), url.indexOf("}") + 1);
replaceStr = "\\" + replaceStr;
replaceStr = replaceStr.substring(0, replaceStr.length() - 1) + "\\}";
url = url.replaceAll(replaceStr, im.getIMId());
}
if (jo.getBoolean("containset")) {
params = (JSONObject) JSONObject.toJSON(ps);
}
doRestRequest(url, httpMethod, getHeader(), params);
}
if (im.getRest() != null) {
JSONArray callbackdata = JSONObject.parseArray(im.getRest());
if (callbackdata.size() > 0) {
for (int i =0; i < callbackdata.size(); i++) {
JSONObject jo = callbackdata.getJSONObject(i);
HttpMethod httpMethod = HttpMethod.valueOf(jo.getString("method"));
String url = jo.getString("url");
JSONObject params = null;
if (jo.getBoolean("containspk")) {
String replaceStr = url.substring(url.indexOf("{"), url.indexOf("}") + 1);
replaceStr = "\\" + replaceStr;
replaceStr = replaceStr.substring(0, replaceStr.length() - 1) + "\\}";
url = url.replaceAll(replaceStr, im.getIMId());
}
if (jo.getBoolean("containset")) {
params = (JSONObject) JSONObject.toJSON(ps);
}
doRestRequest(url, httpMethod, getHeader(), params);
}
}
}
......@@ -266,6 +263,10 @@ public class IMService {
// 保存业务数据
this.update(im_id, im);
if ("finish".equals(type)) {
this.hD(im_id, im);
}
data.put("rst", "1");
return data;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册