/** add host */ @RequestMapping(value = "/host/addhost") public int checkLogin( HttpServletRequest request, @RequestParam("hostname") String hostname, @RequestParam("ip") String ip, @RequestParam("rootpass") String rootpass, @RequestParam("cores") String cores, @RequestParam("memory") String memory, @RequestParam("location") String location) { Host host = new Host(); host.setZoneId(1); host.setHostName(hostname); host.setIp(ip); host.setRootPasswd(rootpass); host.setLocation(location); host.setCores(Short.parseShort(cores)); host.setMemory(Integer.parseInt(memory)); Date curDate = new Date(System.currentTimeMillis()); // 获取当前时间 host.setLastUpdated(curDate); int hostresult = hostService.addHost(host); // host.setNote(note); // host.setUsageFlag(new Byte(usage_flag)); // host.setSshLogin(new Byte(ssh_login)); // host.setClusterId(Integer.parseInt(cluster_id)); return hostresult; }