@RequestMapping(value = "/getDatabaseById", method = RequestMethod.POST) @ResponseBody public Database getDatabaseInfo(@RequestParam("databaseId") int id) { Database db = databaseService.loadDatabaseById(id); // ftpModel.addAttribute("ftp",ftp); return db; }
@RequestMapping(value = "/removeDatabases", method = RequestMethod.POST) public String removeDatabaseInfo(@RequestParam("deleteIds") String ids) { String[] idArr = ids.split(","); if (idArr.length > 0) { databaseService.deleteDatabaseInfoById(idArr); } return "redirect:database"; }
@RequestMapping(value = "/doSaveDatabase", method = RequestMethod.POST) public String addNewDatabase( @RequestParam("host") String host, @RequestParam("user") String user, @RequestParam("password") String password, @RequestParam("url") String url, @RequestParam("service") String service, @RequestParam("port") String port) { Database p = new Database(); p.setUrl(url); p.setUser(user); p.setPassword(password); p.setPort(port); p.setHost(host); p.setService(service); databaseService.addDatabaseInfo(p); return "redirect:database"; }
@RequestMapping(value = "/getDatabaseList", method = RequestMethod.POST) @ResponseBody public List<Database> getDatabaseList() { List<Database> databaseList = databaseService.findDatabaseList(); return databaseList; }