You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.2 KiB
59 lines
2.2 KiB
2 years ago
|
package com.fr.plugin.web.hander;
|
||
|
|
||
|
import com.fr.decision.fun.impl.BaseHttpHandler;
|
||
|
import com.fr.json.JSONObject;
|
||
|
import com.fr.plugin.config.YituanPri;
|
||
|
import com.fr.plugin.utils.MyUtils;
|
||
|
import com.fr.plugin.utils.YiTuanMaManager;
|
||
|
import com.fr.stable.StringUtils;
|
||
|
import com.fr.third.springframework.web.bind.annotation.RequestMethod;
|
||
|
import com.fr.web.utils.WebUtils;
|
||
|
|
||
|
import javax.servlet.http.HttpServletRequest;
|
||
|
import javax.servlet.http.HttpServletResponse;
|
||
|
|
||
|
public class SaveConfigHandler extends BaseHttpHandler {
|
||
|
@Override
|
||
|
public RequestMethod getMethod() {
|
||
|
return RequestMethod.POST;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String getPath() {
|
||
|
return "/yt/report/server/url";
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean isPublic() {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
|
||
|
String var3 = WebUtils.getHTTPRequestParameter(httpServletRequest, "reportServerUrl");
|
||
|
if (StringUtils.isNotEmpty(var3)) {
|
||
|
String var4;
|
||
|
if (var3.contains("?")) {
|
||
|
var4 = var3.substring(0, var3.indexOf("?"));
|
||
|
} else {
|
||
|
var4 = var3;
|
||
|
}
|
||
|
String appId = WebUtils.getHTTPRequestParameter(httpServletRequest, "appId");
|
||
|
String eid = WebUtils.getHTTPRequestParameter(httpServletRequest, "eid");
|
||
|
String appSecret = WebUtils.getHTTPRequestParameter(httpServletRequest, "appSecret");
|
||
|
String readKey = WebUtils.getHTTPRequestParameter(httpServletRequest, "readKey");
|
||
|
String sendUserId = WebUtils.getHTTPRequestParameter(httpServletRequest, "sendUserId");
|
||
|
YiTuanMaManager myConfig = YiTuanMaManager.getInstance();
|
||
|
myConfig.setEid(eid);
|
||
|
myConfig.setGroupId(readKey);
|
||
|
myConfig.setClientSecret(appSecret);
|
||
|
myConfig.setClientId(appId);
|
||
|
myConfig.setUrl(var4);
|
||
|
myConfig.setSendUserId(sendUserId);
|
||
|
}
|
||
|
|
||
|
JSONObject var5 = MyUtils.createSuccessResponseJSONObject();
|
||
|
WebUtils.flushSuccessMessageAutoClose(httpServletRequest, httpServletResponse, var5);
|
||
|
}
|
||
|
}
|