play框架异步回调怎么写,和spring有哪些不同,求大神指教

asukablood 2016-02-14 04:14:02
代码:
route配置:POST /card/business/petrolCard/notify controllers.GateBusinessPetrolCard.notify()




controller中代码:
@With(SessionSet.class)
public void notify(HttpServletRequest request, HttpServletResponse response){
JSONObject js=new JSONObject();
request.setCharacterEncoding("UTF-8");
ServletInputStream in=request.getInputStream();
BufferedReader reader=new BufferedReader(new InputStreamReader(in));
String s="";
StringBuffer stringResult=new StringBuffer();
while((s=reader.readLine())!=null){
stringResult.append(s);
}
System.out.println("---------------------充值接口notifyURL接收到的参数--------------------"+stringResult);
JSONObject jsonData=JSONObject.fromObject(stringResult);
System.out.println("---------------------充值接口notifyURL返回参数--------------------"+jsonData);
String retcode=jsonData.getString("retcode");
String errMsg=jsonData.getString("errMsg");
String orderId=jsonData.getString("orderId")==null?"0":jsonData.getString("orderId");
String inTradeOrderNo=jsonData.getString("merchOrderId");
String dstatus=jsonData.getString("dstatus");
BookOrderService bookOrderService=(BookOrderService) Spring.getBean("bookOrderService");
BookOrder bookOrder=bookOrderService.selectBookOrderByBookOrderId(Long.parseLong(orderId));
if(retcode.equals("1000")&&dstatus.equals("00")){
bookOrder.setCheckOutStatus((short)1);
bookOrderService.updateBookOrderCheckStatus(bookOrder);
}
}
...全文
152 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
asukablood 2016-02-14
  • 打赏
  • 举报
回复
我现在报错是Compilation error value notify is not a member of object controllers.GateBusinessPetrolCard In D:\paygateway_zg_zlj\conf\routes at line 227. 223GET /card/business/petrolCard/index controllers.GateBusinessPetrolCard.index() 224POST /card/business/petrolCard/check controllers.GateBusinessPetrolCard.check() 225POST /card/business/petrolCard/createBookOrder controllers.GateBusinessPetrolCard.createBookOrder() 226GET /card/business/petrolCard/down/:id controllers.GateBusinessPetrolCard.down(id: String) 227POST /card/business/petrolCard/notify controllers.GateBusinessPetrolCard.notify()

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧