generated from root/miduo_server
添加服务器
parent
a6cd7ce892
commit
19b4168157
|
|
@ -452,7 +452,16 @@ public class ServerInfoController {
|
|||
int crossValue = 0;
|
||||
for (int i = 0; i < count; i++) {
|
||||
// id和name,随id变化
|
||||
int id = cross==1?serverId + crossValue:serverId + i;
|
||||
int id;
|
||||
int names;
|
||||
if (cross == 1){
|
||||
id = serverId + crossValue;
|
||||
names = nameNum + crossValue;
|
||||
}else {
|
||||
id = serverId + i;
|
||||
names = nameNum + i;
|
||||
}
|
||||
|
||||
if (serverMap.get(String.valueOf(id)) != null){
|
||||
LOGGER.error("批量添加服务器,出现重复id:{}",id);
|
||||
continue;
|
||||
|
|
@ -463,7 +472,7 @@ public class ServerInfoController {
|
|||
|
||||
vo.set_id(id);
|
||||
vo.setServer_id(String.valueOf(id));
|
||||
String name = named.replace("%d", String.valueOf(nameNum + crossValue));
|
||||
String name = named.replace("%d", String.valueOf(names));
|
||||
vo.setName(name);
|
||||
|
||||
crossValue+=2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue