master
duhui 2021-11-19 14:42:13 +08:00
parent 651373e828
commit be0965c4b2
1 changed files with 8 additions and 1 deletions

View File

@ -330,11 +330,17 @@ public class ServerInfoController {
return "serverNumberInfo";
}
/**
*
* @param serverInfo
* @return
* @throws Exception
*/
@RequestMapping(value = "/addServer", method = {RequestMethod.POST, RequestMethod.GET})
public @ResponseBody int addServer(@RequestBody ServerInfo serverInfo) throws Exception {
Map<String, ServerInfo> serverMap = serverInfoDao.getAllServerMap();
int count = serverInfo.getCount();
// 批量添加,参数需要做特殊处理
if (count > 0){
// 需要修改的参数
int serverId = Integer.parseInt(serverInfo.getServer_id());
@ -359,6 +365,7 @@ public class ServerInfoController {
serverInfo.setCoreName("core"+(coreNum+i));
serverInfoDao.addServerInfo(serverInfo);
}
// 单独添加
}else {
ServerInfo info = serverMap.get(serverInfo.getServer_id());
if (info != null){