| | |
| | | @RequestMapping(value = "/getMessage.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | protected void doPost(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | System.out.print("result" + jsonString); |
| | | //System.out.print("result" + jsonString); |
| | | JSONObject json_test = JSONObject.fromObject(jsonString); |
| | | String result = json_test.getString("result"); |
| | | try { |
| | |
| | | @RequestMapping(value = "/yuanshiMessage.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | protected void yuanshiMessage(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | System.out.print("result" + jsonString); |
| | | //System.out.print("result" + jsonString); |
| | | JSONObject json_test = JSONObject.fromObject(jsonString); |
| | | String result = json_test.getString("result"); |
| | | try { |
| | |
| | | @RequestMapping(value = "/debugMessage.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | protected void debugMessage(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | System.out.print("result" + jsonString); |
| | | //System.out.print("result" + jsonString); |
| | | JSONObject json_test = JSONObject.fromObject(jsonString); |
| | | String result = json_test.getString("result"); |
| | | try { |
| | |
| | | @RequestMapping(value = "/zhuceMessage.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | protected void zhuceMessage(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | System.out.print("result" + jsonString); |
| | | //System.out.print("result" + jsonString); |
| | | JSONObject json_test = JSONObject.fromObject(jsonString); |
| | | String result = json_test.getString("result"); |
| | | try { |
| | |
| | | @RequestMapping(value = "/mysqlMessage.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | protected void mysqlMessage(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | System.out.print("result" + jsonString); |
| | | //System.out.print("result" + jsonString); |
| | | JSONObject json_test = JSONObject.fromObject(jsonString); |
| | | String result = json_test.getString("result"); |
| | | try { |
| | |
| | | @RequestMapping(value = "/gasMessage.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | protected void gasMessage(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | System.out.print("result" + jsonString); |
| | | //System.out.print("result" + jsonString); |
| | | JSONObject json_test = JSONObject.fromObject(jsonString); |
| | | String result = json_test.getString("result"); |
| | | try { |
| | |
| | | @RequestMapping(value = "/HEXMessage.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | protected void HEXMessage(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | System.out.print("result" + jsonString); |
| | | //System.out.print("result" + jsonString); |
| | | JSONObject json_test = JSONObject.fromObject(jsonString); |
| | | String result = json_test.getString("result"); |
| | | try { |
| | |
| | | String result = jsonResult.getString("result"); |
| | | String wifi_model = sysSettingService.getSetting().get(0).getWifi_mdel(); |
| | | List<tb_forward_data> messageTransferList = sysSettingService.getALLMessageTransfer(dataType); |
| | | System.out.print(messageTransferList); |
| | | //System.out.print(messageTransferList); |
| | | DatagramPacket packet = null; |
| | | DatagramSocket socket = new DatagramSocket(); |
| | | if (messageTransferList.size() > 0) { |
| | |
| | | try { |
| | | socket.send(packet); |
| | | Thread.sleep(100); |
| | | System.out.print("udp发送成功"); |
| | | //System.out.print("udp发送成功"); |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | |
| | | // String password = sysSettingService.getSetting().get(0).getDatapass(); |
| | | // String cmd = "cmd /c "+ mysqlDumpPath + " -uroot" + " -p" + password + " " + database + " > " |
| | | // + filePath + database + "_" + name + ".sql"; |
| | | // System.out.print(cmd); |
| | | // //System.out.print(cmd); |
| | | // |
| | | // //执行备份命令 |
| | | // try { |
| | |
| | | String database =sysSettingService.getSetting().get(0).getDataname(); |
| | | String password = sysSettingService.getSetting().get(0).getDatapass(); |
| | | String cmd ="mysqldump -h "+host+" -P "+ port+ " -uroot" + " -p" + password + " " + database; |
| | | System.out.print(cmd); |
| | | //System.out.print(cmd); |
| | | return savePath; |
| | | } |
| | | |
| | |
| | | String host = Config.getMysqlHost(); |
| | | String port = Config.getMysqlPort(); |
| | | String cmd = "mysql -h "+host+" -P "+port+ " -uroot" + " -p" + password + " " + database; |
| | | System.out.print(cmd); |
| | | //System.out.print(cmd); |
| | | boolean b2 = new DatabaseUtil().recover(cmd, recoverPath); |
| | | return String.valueOf(b2); |
| | | } else { |
| | |
| | | @RequestMapping(value = "/shiyan.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void shiyan(HttpServletRequest request) throws IOException { |
| | | String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset()); |
| | | System.out.print(jsonString); |
| | | System.out.print("执行了"); |
| | | //System.out.print(jsonString); |
| | | //System.out.print("执行了"); |
| | | } |
| | | } |