@RequestMapping public ModelAndView balance(HttpServletRequest request, Map<String, Object> out, String code) { ZZSms sms = (ZZSms) GatewayService.CACHE_GATEWAY.get(code); ExtResult result = new ExtResult(); if (sms != null) { result.setData(sms.balance()); } else { result.setData(0); } result.setSuccess(true); return printJson(result, out); }
@RequestMapping public ModelAndView testGateway( HttpServletRequest request, Map<String, Object> out, String mobile, String gatewayCode) { ZZSms zzSms = (ZZSms) GatewayService.CACHE_GATEWAY.get(gatewayCode); ExtResult result = new ExtResult(); do { if (zzSms == null) { break; } if (ControlThread.DEBUG) { System.out.println("send mobile:" + mobile + " ; send message:网管测试短信【test】"); } else { zzSms.send(mobile, "网管测试短信【test】"); result.setData( "=======调试状态短信发送:send mobile(发送目标):" + mobile + " ; send message(发送内容):网管测试短信【test】"); } } while (false); result.setSuccess(true); return printJson(result, out); }