generated from root/miduo_server
灵动sdk接入
parent
ab746d58b6
commit
a3eaa2d977
|
@ -47,7 +47,7 @@ public class MHTRechargeController {
|
|||
|
||||
@RequestMapping(value = "/MHTcallback")
|
||||
public String MHTcallback( HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap2(request);
|
||||
if(parameterMap.isEmpty()) {
|
||||
LOGGER.info( "data is null");
|
||||
return "FAIL";
|
||||
|
@ -64,7 +64,7 @@ public class MHTRechargeController {
|
|||
// }
|
||||
String response = "SUCCESS";
|
||||
try {
|
||||
String consumerid = parameterMap.get("consumerid");
|
||||
String consumerid = request.getParameterValues("consumerid")[0];
|
||||
String consumerName =parameterMap.get("consumername");
|
||||
String gameCurrency ="0";
|
||||
String mhtOrderAmt =parameterMap.get("mhtOrderAmt");
|
||||
|
|
|
@ -39,6 +39,18 @@ public class JsonUtil {
|
|||
public Gson getGson() {
|
||||
return gson;
|
||||
}
|
||||
public HashMap<String, String> getParameterMap2(HttpServletRequest request) throws IOException {
|
||||
HashMap<String, String> map = new HashMap();
|
||||
Enumeration paramNames = request.getParameterNames();
|
||||
while (paramNames.hasMoreElements()) {
|
||||
String paramName = (String) paramNames.nextElement();
|
||||
String[] paramValues = request.getParameterValues(paramName);
|
||||
String paramValue = paramValues[0];
|
||||
map.put(paramName, paramValue);
|
||||
LOGGER.info("parameter :"+paramName +"= {} " , paramValue);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getParameterMap(HttpServletRequest request) throws IOException {
|
||||
HashMap<String, String> map = new HashMap();
|
||||
|
|
Loading…
Reference in New Issue