add mailgun notify

master
wangning 7 years ago
parent dc1f20c838
commit 8512a9d0a9

@ -0,0 +1,40 @@
package au.com.royalpay.payment.manage.system.web;
import org.apache.commons.io.IOUtils;
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.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping(value = "/mailgun/")
public class MailCallBackController {
Logger logger = LoggerFactory.getLogger(getClass());
@RequestMapping(value = "/callback", method = RequestMethod.POST)
public void contractList(@RequestBody String content, HttpServletRequest req) {
logger.info("kira"+content);
logger.info(content);
int len = req.getContentLength();
ServletInputStream iii = null;
try {
iii = req.getInputStream();
byte[] buffer = new byte[len];
iii.read(buffer, 0, len);
logger.info("kiratest"+new String(buffer,"UTF-8"));
IOUtils.closeQuietly(iii);
} catch (IOException e) {
e.printStackTrace();
}
}
}
Loading…
Cancel
Save