generated from root/miduo_server
删除多余代码
parent
95d5f6467b
commit
acc0687da5
|
@ -91,7 +91,6 @@ public class HaoGameRechargeController {
|
|||
sbKey.append(key).append("=").append(value).append("&");
|
||||
}
|
||||
sbKey.append("secret=").append(PAYKEY);
|
||||
LOGGER.info("haoGameCallback 签验之前={}",sbKey.toString());
|
||||
String mySign = MD5Util.encrypByMd5(sbKey.toString()).toUpperCase();
|
||||
if (!mySign.equals(sign)) {
|
||||
LOGGER.info("callback==>roleUid={},sin derify fail, my sign={} sign={}", openid, mySign, sign);
|
||||
|
|
|
@ -67,66 +67,11 @@ public class JsonUtil {
|
|||
}
|
||||
|
||||
|
||||
public static HaoGameParamBean serializeToObject(String str) throws IOException, ClassNotFoundException {
|
||||
// ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(str.getBytes("UTF-8"));
|
||||
// ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
|
||||
// HaoGameParamBean object = (HaoGameParamBean) objectInputStream.readObject();
|
||||
// objectInputStream.close();
|
||||
// byteArrayInputStream.close();
|
||||
public static HaoGameParamBean serializeToObject(String str) {
|
||||
HaoGameParamBean haoGameParamBean = gson.fromJson(str, HaoGameParamBean.class);
|
||||
return haoGameParamBean;
|
||||
}
|
||||
|
||||
public SortedMap<String, String> getParameterMapYX(HttpServletRequest request) {
|
||||
SortedMap<String, String> map = new TreeMap<>();
|
||||
try {
|
||||
byte[] requestPostBytes = getRequestPostBytes(request);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Enumeration paramNames = request.getParameterNames();
|
||||
while (paramNames.hasMoreElements()) {
|
||||
String string = (String) paramNames.nextElement();
|
||||
|
||||
|
||||
|
||||
|
||||
LOGGER.info("getParameterMapYX param {}", string);
|
||||
string = string.replace("{", "");
|
||||
string = string.replace("}", "");
|
||||
string = string.replace("extra\":", "");
|
||||
String[] split = string.split(",");
|
||||
for (String s : split) {
|
||||
String[] split1 = s.split(":");
|
||||
String key = split1[0].replace("\"", "");
|
||||
String value = split1[1].replace("\"", "");
|
||||
map.put(key, value);
|
||||
LOGGER.info("getParameterMapYX =================> key={} value={}", key, value);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static byte[] getRequestPostBytes(HttpServletRequest request)
|
||||
throws IOException {
|
||||
int contentLength = request.getContentLength();
|
||||
if (contentLength < 0) {
|
||||
return null;
|
||||
}
|
||||
byte buffer[] = new byte[contentLength];
|
||||
for (int i = 0; i < contentLength; ) {
|
||||
|
||||
int readlen = request.getInputStream().read(buffer, i,
|
||||
contentLength - i);
|
||||
if (readlen == -1) {
|
||||
break;
|
||||
}
|
||||
i += readlen;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
public static String getServiceKey(String serviceName, String host, String port) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
return sb.append(serviceName).append("|")
|
||||
|
|
Loading…
Reference in New Issue