添加服务器

master
duhui 2023-03-01 10:03:52 +08:00
parent a6cd7ce892
commit 19b4168157
1 changed files with 11 additions and 2 deletions

View File

@ -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;