测试log

master
jiahuiwen 2021-10-26 17:54:45 +08:00
parent e6ea389c7b
commit 69701121ab
2 changed files with 15 additions and 6 deletions

View File

@ -36,7 +36,7 @@ public class HaoGameRechargeController {
@RequestMapping(value = "/haoGameCallback")
public String haoGameCallback(HttpServletRequest request) throws Exception {
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMapOld(request);
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMapYX(request);
if (parameterMap.isEmpty()) {
LOGGER.info("data is null");
return "data is null";

View File

@ -3,6 +3,7 @@ package com.jmfy.util;
import com.google.gson.Gson;
import com.jmfy.controller.RechargeController;
import com.jmfy.redisProperties.RedisUserKey;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -13,10 +14,7 @@ import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.*;
public class JsonUtil {
@ -70,11 +68,22 @@ public class JsonUtil {
return map;
}
public HashMap<String, String> getParameterMapOld(HttpServletRequest request) {
public HashMap<String, String> getParameterMapYX(HttpServletRequest request) {
HashMap<String, String> map = new HashMap();
Enumeration paramNames = request.getParameterNames();
while (paramNames.hasMoreElements()) {
String paramName = (String) paramNames.nextElement();
JSONObject data = new JSONObject(paramName);
Set<String> strings = data.keySet();
for (String string : strings) {
LOGGER.info("getParameterMapYX =================> {} ", string);
}
// String serverID = data.getString("districtid");// 区服id
// String productID = data.getString("productId");
// String ccId = data.getString("ccId");
// String platform = data.getString("platform");
String[] paramValues = request.getParameterValues(paramName);
String paramValue = paramValues[0];
map.put(paramName, paramValue);