You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.6 KiB
48 lines
1.6 KiB
package com.hfkj.controller.notify;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.hfkj.service.taobao.TaoBaoService;
|
|
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.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.PrintWriter;
|
|
|
|
@Controller
|
|
@RequestMapping(value = "/taoBaoNotify")
|
|
@Api(value = "淘宝业务通知")
|
|
public class TaoBaoNotify {
|
|
|
|
private static Logger log = LoggerFactory.getLogger(TaoBaoService.class);
|
|
|
|
@RequestMapping(value = "/notify", method = RequestMethod.POST)
|
|
@ApiOperation(value = "回调")
|
|
@ResponseBody
|
|
public void notify(@RequestBody String reqBodyStr, HttpServletResponse response) {
|
|
try {
|
|
|
|
JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class);
|
|
|
|
log.info("============淘宝回调任务Start=============");
|
|
log.info("淘宝-回调参数: " + dataObject);
|
|
log.info("============淘宝回调任务End=============");
|
|
|
|
|
|
response.setCharacterEncoding("UTF-8");
|
|
response.setContentType("text/html;charset=utf-8");
|
|
PrintWriter writer= response.getWriter();
|
|
writer.write("SUCCESS");
|
|
|
|
|
|
} catch (Exception e) {
|
|
log.error("WechatPayController --> wechatNotify() error!", e);
|
|
}
|
|
}
|
|
}
|
|
|