diff --git a/src/main/java/com/jmfy/controller/HaoGameRechargeController.java b/src/main/java/com/jmfy/controller/HaoGameRechargeController.java index c8bcadd..b288827 100644 --- a/src/main/java/com/jmfy/controller/HaoGameRechargeController.java +++ b/src/main/java/com/jmfy/controller/HaoGameRechargeController.java @@ -13,6 +13,7 @@ import com.jmfy.util.MD5Util; import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -37,26 +38,28 @@ public class HaoGameRechargeController { private static final Logger LOGGER = LoggerFactory.getLogger(HaoGameRechargeController.class); @RequestMapping(value = "/haoGameCallback") - public String haoGameCallback(HttpServletRequest request) throws Exception { + public String haoGameCallback(HttpServletRequest request, @RequestBody String body) throws Exception { - try { - BufferedReader reader = request.getReader(); - StringBuilder sb = new StringBuilder(); - String str; - while ((str = reader.readLine()) != null) { - sb.append(str); - LOGGER.info("haoGameCallback getOuttradeno={} ",str); - } - String body = sb.toString(); - if (body.isEmpty()) { - LOGGER.info("haoGameCallback body.isEmpty="); - } + LOGGER.info("haoGameCallback body.length={} body={}", body.length(), body); - HaoGameParamBean haoGameParamBean = JsonUtil.serializeToObject(body); - LOGGER.info("haoGameCallback getOuttradeno={} getOpenid={} getSign={}",haoGameParamBean.getOuttradeno(), haoGameParamBean.getOpenid(), haoGameParamBean.getSign()); - } catch (Exception e) { - e.printStackTrace(); - } +// try { +// BufferedReader reader = request.getReader(); +// StringBuilder sb = new StringBuilder(); +// String str; +// while ((str = reader.readLine()) != null) { +// sb.append(str); +// LOGGER.info("haoGameCallback getOuttradeno={} ",str); +// } +// String body = sb.toString(); +// if (body.isEmpty()) { +// LOGGER.info("haoGameCallback body.isEmpty="); +// } +// +// HaoGameParamBean haoGameParamBean = JsonUtil.serializeToObject(body); +// LOGGER.info("haoGameCallback getOuttradeno={} getOpenid={} getSign={}",haoGameParamBean.getOuttradeno(), haoGameParamBean.getOpenid(), haoGameParamBean.getSign()); +// } catch (Exception e) { +// e.printStackTrace(); +// }