Add 'acs/' from commit '83816781f8c26a15e081a5746c83a3c9ea56fb90'

git-subtree-dir: acs
git-subtree-mainline: b86787e9d6
git-subtree-split: 83816781f8
This commit is contained in:
周俊杰
2024-06-05 17:14:41 +08:00
1824 changed files with 187996 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package org.nl;
import org.springframework.boot.test.context.SpringBootTest;
/**
* @Author: lyd
* @Description: 单元测试
* @Date: 2023/5/15
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class ApplicationTest {
}

View File

@@ -0,0 +1,36 @@
package org.nl.ext;
/**
* @Author: lyd
* @Description:
* @Date: 2023/9/18
*/
public class StorageManager {
private int requestCount = 0;
public String allocateStorage() {
requestCount++;
if (requestCount >= 1 && requestCount <= 5) {
return "上货位";
} else if (requestCount >= 6 && requestCount <= 10) {
return "下货位";
} else {
// 如果请求次数大于10循环上下
requestCount = 1;
return "上货位";
}
}
public static void main(String[] args) {
StorageManager manager = new StorageManager();
// 模拟外部系统的请求
for (int i = 1; i <= 23; i++) {
new Thread(() -> {
String storage = manager.allocateStorage();
System.out.println("" + Thread.currentThread().getName() + " 次请求,分配到:" + storage);
}).start();
}
}
}

View File

@@ -0,0 +1,13 @@
package org.nl.point;
import org.springframework.boot.test.context.SpringBootTest;
/**
* @Author: lyd
* @Description: 创建点位
* @Date: 2023/6/15
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class PointCreate {
}