parent
0352ad2d63
commit
222d44bd85
|
@ -7,11 +7,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
//@EnableEurekaClient
|
|
||||||
//@EnableTransactionManagement
|
|
||||||
//@EnableFeignClients(basePackages = { "com.genersoft.iot.vmp", "org.integrain" })
|
|
||||||
//@ServletComponentScan("com.genersoft.iot.vmp")
|
|
||||||
@EnableAutoConfiguration
|
|
||||||
public class VManageBootstrap extends LogManager {
|
public class VManageBootstrap extends LogManager {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(VManageBootstrap.class, args);
|
SpringApplication.run(VManageBootstrap.class, args);
|
||||||
|
|
|
@ -70,14 +70,16 @@ public class SsrcUtil {
|
||||||
*/
|
*/
|
||||||
private static String getSN() {
|
private static String getSN() {
|
||||||
String sn = null;
|
String sn = null;
|
||||||
|
int index = 0;
|
||||||
if (notUsed.size() == 0) {
|
if (notUsed.size() == 0) {
|
||||||
throw new RuntimeException("ssrc已经用完");
|
throw new RuntimeException("ssrc已经用完");
|
||||||
} else if (notUsed.size() == 1) {
|
} else if (notUsed.size() == 1) {
|
||||||
sn = notUsed.get(0);
|
sn = notUsed.get(0);
|
||||||
} else {
|
} else {
|
||||||
sn = notUsed.get(new Random().nextInt(notUsed.size() - 1));
|
index = new Random().nextInt(notUsed.size() - 1);
|
||||||
|
sn = notUsed.get(index);
|
||||||
}
|
}
|
||||||
notUsed.remove(0);
|
notUsed.remove(index);
|
||||||
isUsed.add(sn);
|
isUsed.add(sn);
|
||||||
return sn;
|
return sn;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue