移動onenetlock先回復再業務處理邏輯
@RequestMapping(value = "/receive",method = RequestMethod.POST)
@ResponseBody
public void receive(@RequestBody String body, HttpServletResponse response){
logger.info("data receive: body String --- " +body);
try {
response.setStatus(200);
PrintWriter out = response.getWriter();
out.print("ok");
out = response.getWriter();
if (out!=null) {
out.flush();
out.close();
}
//先返回在處理邏輯
Util.BodyObj obj1 = Util.resolveBody(body, true);
logger.info("data receive: body Object--- " +obj1);
if (obj1 != null){
boolean dataRight1 = Util.checkSignature(obj1, params.oneNetToken);
if (dataRight1){
String msg = Util.decryptMsg(obj1, params.oneNetAeskey);
logger.info("data receive: content" + msg);
}else {
logger.info("data receive: signature error " );
}
}else {
logger.info("data receive: body empty error" );
}
logger.info("return ok -------------------" );
} catch (Exception e) {
logger.info("" + e);
}
}