package com.cweb.controller.pay; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.security.*; import java.util.Base64; import java.util.HashMap; import java.util.Map; import java.util.SortedMap; @Controller @RequestMapping(value = "/tuanyou") @Api(value = "团油回调") public class TuanYouController { private static Logger log = LoggerFactory.getLogger(TuanYouController.class); @RequestMapping(value = "/orderPaymentNotify", method = RequestMethod.POST) @ApiOperation(value = "订单支付回调") public void orderPaymentNotify(HttpServletRequest request, HttpServletResponse response) { try { } catch (Exception e) { log.error("WechatPayController --> wechatNotify() error!", e); } } @RequestMapping(value = "/orderRefundNotify", method = RequestMethod.POST) @ApiOperation(value = "订单退款回调") @ResponseBody public void orderRefundNotify(@RequestBody String reqBodyStr,HttpServletRequest request, HttpServletResponse response) { try { System.out.println(reqBodyStr); response.setCharacterEncoding("UTF-8"); response.setContentType("text/html;charset=utf-8"); PrintWriter writer= response.getWriter(); writer.write("success"); log.error("request", request); } catch (Exception e) { log.error("WechatPayController --> wechatNotify() error!", e); } } }