package com.ruoyi.web.controller.system;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestNotifyController {
	
	private static final Logger log=LoggerFactory.getLogger(TestNotifyController.class);
	@RequestMapping("/test/push")
	public String testPush(HttpServletRequest req) {
		String method = req.getMethod();
		log.info("收到推送鸟，推送方式:"+method);
		try {
			byte[] bytesMsg = IOUtils.toByteArray(req.getInputStream());
			String msg=new String(bytesMsg,"UTF-8");
			log.info("收到的推送报文:"+msg);
		} catch (Exception e) {
			log.error("解析推送报文失败鸟:"+e.getMessage(),e);
		}
		return "success";
	}
}
