Skip to content
Merged

Dev #5823

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ image::doc/image/老寇IoT云平台业务架构图.png[架构图,align=center]
|Spring Data |2025.1.3
|Spring Cloud |2025.1.0
|Spring Cloud Alibaba |2025.1.0.0
|Spring Boot Admin |4.0.1
|Spring Boot Admin |4.0.2
|Jackson |3.1.0
|Mybatis Plus |3.5.16
|Nacos |3.1.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ KCloud-Platform-IoT(老寇IoT云平台)是一个企业级单体架构和微
| Spring Data | 2025.1.3 |
| Spring Cloud | 2025.1.0 |
| Spring Cloud Alibaba | 2025.1.0.0 |
| Spring Boot Admin | 4.0.1 |
| Spring Boot Admin | 4.0.2 |
| Jackson | 3.1.0 |
| Mybatis Plus | 3.5.16 |
| Nacos | 3.1.0 |
Expand Down
1 change: 0 additions & 1 deletion archive/docs/00.二开指南/02.指南/04.Docker安装.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ sudo apt-get update
sudo apt-get install docker-ce
```


##### 7.启动 Docker 服务

```shell
Expand Down
23 changes: 23 additions & 0 deletions archive/docs/00.二开指南/02.指南/05.Linux常用命令.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ permalink: /pages/d55f5f/

你好呀,我的老朋友!我是老寇,欢迎来到老寇IoT云平台!

### Linux命令

##### 目录和文件

```shell
Expand Down Expand Up @@ -202,4 +204,25 @@ userdel 用户名 => userdel mysql
whomi
```

### Ubuntu命令

###### 安装deb包

```shell
# 更新包索引
sudo apt-get update
# 安装deb
sudo dpkg -i 包名.deb => sudo dpkg -i test.deb
# 修复deb安装依赖问题
sudo apt --fix-broken install
```

### Arch Linux命令

###### 网络
```shell
# 重启网络
systemctl restart NetworkManager.service
```

我是老寇,我们下次再见啦!
15 changes: 15 additions & 0 deletions archive/docs/00.二开指南/02.指南/06.Docker常用命令.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ docker network disconnect 网络名称 容器名称/容器id => docker network d

# 查看容器IP地址
docker exec 容器名称/容器id --hostname -i => docker exec -it myredis --hostname -i

# 保存镜像
docker save -o 文件名.tar 镜像名称:标签 => docker save -o jdk21.tar jdk:21

# 保存多个镜像
docker save -o 文件名.tar 镜像名称1:标签 镜像名称2:标签 => docker save -o image.tar jdk:21 redis:7.0

# 保存压缩镜像
docker save 镜像名称:标签 | gzip > 文件名.tar.gz => docker save jdk:21 | gzip > jdk21.tar.gz

# 载入压缩镜像
gunzip -c 文件名.tar.gz | docker load => gunzip -c jdk21.tar.gz | docker load

# 加载镜像
docker load -i 文件名.tar => docker load -i jdk21.tar
```

##### Docker Compose
Expand Down
80 changes: 52 additions & 28 deletions doc/db/4.0.0/kcloud_platform.sql
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ CREATE UNIQUE INDEX "sys_dict_type_tenantId_idx" ON "public"."sys_dict" USING bt
COMMENT ON INDEX "public"."sys_dict_type_tenantId_idx" IS '类型_租户ID_唯一索引';

-- ----------------------------
-- -------------国际化消息------------
-- -------------国际化菜单------------
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_i18n_message";
CREATE TABLE "public"."sys_i18n_message" (
DROP TABLE IF EXISTS "public"."sys_i18n_menu";
CREATE TABLE "public"."sys_i18n_menu" (
"id" int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY,
"creator" int8 NOT NULL DEFAULT 0,
"editor" int8 NOT NULL DEFAULT 0,
Expand All @@ -193,34 +193,58 @@ CREATE TABLE "public"."sys_i18n_message" (
"tenant_id" int8 NOT NULL DEFAULT 0,
"dept_id" int8 NOT NULL DEFAULT 1,
"code" varchar(50) NOT NULL,
"zh_message" varchar(50) NOT NULL,
"en_message" varchar(50) NOT NULL
"menu" varchar(50) NOT NULL
);
COMMENT ON COLUMN "public"."sys_i18n_message"."id" IS 'ID';
COMMENT ON COLUMN "public"."sys_i18n_message"."creator" IS '创建人';
COMMENT ON COLUMN "public"."sys_i18n_message"."editor" IS '编辑人';
COMMENT ON COLUMN "public"."sys_i18n_message"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."sys_i18n_message"."update_time" IS '修改时间';
COMMENT ON COLUMN "public"."sys_i18n_message"."del_flag" IS '删除标识 0未删除 1已删除';
COMMENT ON COLUMN "public"."sys_i18n_message"."version" IS '版本号';
COMMENT ON COLUMN "public"."sys_i18n_message"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "public"."sys_i18n_message"."dept_id" IS '部门ID';
COMMENT ON COLUMN "public"."sys_i18n_message"."code" IS '编码';
COMMENT ON COLUMN "public"."sys_i18n_message"."zh_message" IS '中文';
COMMENT ON COLUMN "public"."sys_i18n_message"."en_message" IS '英文';
COMMENT ON TABLE "public"."sys_i18n_message" IS '国际化消息';

CREATE INDEX "sys_i18n_message_code_tenantId_idx" ON "public"."sys_i18n_message" USING btree (
COMMENT ON COLUMN "public"."sys_i18n_menu"."id" IS 'ID';
COMMENT ON COLUMN "public"."sys_i18n_menu"."creator" IS '创建人';
COMMENT ON COLUMN "public"."sys_i18n_menu"."editor" IS '编辑人';
COMMENT ON COLUMN "public"."sys_i18n_menu"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."sys_i18n_menu"."update_time" IS '修改时间';
COMMENT ON COLUMN "public"."sys_i18n_menu"."del_flag" IS '删除标识 0未删除 1已删除';
COMMENT ON COLUMN "public"."sys_i18n_menu"."version" IS '版本号';
COMMENT ON COLUMN "public"."sys_i18n_menu"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "public"."sys_i18n_menu"."dept_id" IS '部门ID';
COMMENT ON COLUMN "public"."sys_i18n_menu"."code" IS '编码';
COMMENT ON COLUMN "public"."sys_i18n_menu"."menu" IS '菜单';
COMMENT ON TABLE "public"."sys_i18n_menu" IS '国际化菜单';

CREATE INDEX "sys_i18n_menu_code_menu_idx" ON "public"."sys_i18n_menu" USING btree (
"code",
"tenant_id"
"menu"
);
COMMENT ON INDEX "public"."sys_i18n_message_code_tenantId_idx" IS '编码_租户ID_唯一索引';

ALTER TABLE "public"."sys_i18n_message" ADD CONSTRAINT "sys_i18n_message_pkey" PRIMARY KEY ("id");

INSERT INTO "public"."sys_i18n_message" VALUES (1, 1, 1, '2024-05-07 10:45:30', '2024-05-07 10:45:37', 0, 0, 0,0, 'sys.manage', '系统管理', 'System Management');
INSERT INTO "public"."sys_i18n_message" VALUES (2, 1, 1, '2024-05-07 10:45:30', '2024-05-07 10:45:37', 0, 0, 0,0, 'menu.manage', '菜单管理', 'Menu Management');
INSERT INTO "public"."sys_i18n_message" VALUES (4, 1, 1, '2024-05-07 10:45:30', '2024-05-07 10:45:37', 0, 0, 0,0, 'dict.manage', '字典管理', 'Dictionary Management');
COMMENT ON INDEX "public"."sys_i18n_menu_code_menu_idx" IS '编码_菜单_唯一索引';

ALTER TABLE "public"."sys_i18n_menu" ADD CONSTRAINT "sys_i18n_menu_pkey" PRIMARY KEY ("id");

INSERT INTO "public"."sys_i18n_menu" VALUES (8, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.iot.device.thingModel', '物模型');
INSERT INTO "public"."sys_i18n_menu" VALUES (10, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.iot.device.productCategory', '产品类别');
INSERT INTO "public"."sys_i18n_menu" VALUES (1, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys', '系统管理');
INSERT INTO "public"."sys_i18n_menu" VALUES (4, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.log.notice', '通知日志');
INSERT INTO "public"."sys_i18n_menu" VALUES (3, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.log.login', '登录日志');
INSERT INTO "public"."sys_i18n_menu" VALUES (2, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.log', '日志管理');
INSERT INTO "public"."sys_i18n_menu" VALUES (5, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.iot', '物联管理');
INSERT INTO "public"."sys_i18n_menu" VALUES (6, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.iot.device', '设备管理');
INSERT INTO "public"."sys_i18n_menu" VALUES (11, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.permission', '权限管理');
INSERT INTO "public"."sys_i18n_menu" VALUES (12, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.permission.menu', '菜单');
INSERT INTO "public"."sys_i18n_menu" VALUES (13, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.permission.dept', '部门');
INSERT INTO "public"."sys_i18n_menu" VALUES (14, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.permission.role', '角色');
INSERT INTO "public"."sys_i18n_menu" VALUES (15, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.permission.user', '用户');
INSERT INTO "public"."sys_i18n_menu" VALUES (9, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.iot.device.product', '产品');
INSERT INTO "public"."sys_i18n_menu" VALUES (7, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.iot.device.device', '设备');
INSERT INTO "public"."sys_i18n_menu" VALUES (16, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.tenant', '租户管理');
INSERT INTO "public"."sys_i18n_menu" VALUES (17, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.tenant.source', '数据源');
INSERT INTO "public"."sys_i18n_menu" VALUES (18, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.tenant.package', '套餐');
INSERT INTO "public"."sys_i18n_menu" VALUES (19, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.tenant.tenant', '租户');
INSERT INTO "public"."sys_i18n_menu" VALUES (20, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.base', '基础数据');
INSERT INTO "public"."sys_i18n_menu" VALUES (21, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.base.dict', '数据字典');
INSERT INTO "public"."sys_i18n_menu" VALUES (22, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.log.operate', '操作日志');
INSERT INTO "public"."sys_i18n_menu" VALUES (23, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.base.i18n', '国际化');
INSERT INTO "public"."sys_i18n_menu" VALUES (24, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.oss', '对象存储');
INSERT INTO "public"."sys_i18n_menu" VALUES (25, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.oss.config', '对象存储配置');
INSERT INTO "public"."sys_i18n_menu" VALUES (26, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.oss.log', '对象存储日志');
INSERT INTO "public"."sys_i18n_menu" VALUES (28, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.config', '系统配置');
INSERT INTO "public"."sys_i18n_menu" VALUES (29, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.config.generator', '代码生成器');
INSERT INTO "public"."sys_i18n_menu" VALUES (27, 1, 1, '2026-03-07 12:06:37', '2026-03-07 12:06:37', 0, 0, 0, 1535887940687765505, 'menu.sys.cluster', '集群管理');

-- ----------------------------
-- -------------菜单------------
Expand Down
30 changes: 15 additions & 15 deletions doc/db/4.0.0/kcloud_platform_nacos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -817,39 +817,39 @@ INSERT INTO "public"."config_info" OVERRIDING SYSTEM VALUE VALUES (20, 'admin-
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages",
"resource": "/api/v1/i18n-menus",
"limitApp": "default",
"count": 500000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/import",
"resource": "/api/v1/i18n-menus/import",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/export",
"resource": "/api/v1/i18n-menus/export",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/page",
"resource": "/api/v1/i18n-menus/page",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/{id}",
"resource": "/api/v1/i18n-menus/{id}",
"limitApp": "default",
"count": 100000,
"grade": 1,
Expand Down Expand Up @@ -1580,39 +1580,39 @@ INSERT INTO "public"."config_info" OVERRIDING SYSTEM VALUE VALUES (40, 'admin-
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages",
"resource": "/api/v1/i18n-menus",
"limitApp": "default",
"count": 500000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/import",
"resource": "/api/v1/i18n-menus/import",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/export",
"resource": "/api/v1/i18n-menus/export",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/page",
"resource": "/api/v1/i18n-menus/page",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/{id}",
"resource": "/api/v1/i18n-menus/{id}",
"limitApp": "default",
"count": 100000,
"grade": 1,
Expand Down Expand Up @@ -2239,39 +2239,39 @@ INSERT INTO "public"."config_info" OVERRIDING SYSTEM VALUE VALUES (41, 'admin-
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages",
"resource": "/api/v1/i18n-menus",
"limitApp": "default",
"count": 500000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/import",
"resource": "/api/v1/i18n-menus/import",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/export",
"resource": "/api/v1/i18n-menus/export",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/page",
"resource": "/api/v1/i18n-menus/page",
"limitApp": "default",
"count": 100000,
"grade": 1,
"strategy": 0,
"controlBehavior": 0
},
{
"resource": "/api/v1/i18n-messages/{id}",
"resource": "/api/v1/i18n-menus/{id}",
"limitApp": "default",
"count": 100000,
"grade": 1,
Expand Down
4 changes: 2 additions & 2 deletions doc/db/4.0.0/kcloud_platform数据库设计文档.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h2 style="text-align: center; line-height: 50px">kcloud_platform数据库设计
<tr>
<td class="text-center">5</td>
<td><a href="#sys_i18n_message">sys_i18n_message</a></td>
<td>国际化消息</td>
<td>国际化菜单</td>
</tr>
<tr>
<td class="text-center">7</td>
Expand Down Expand Up @@ -816,7 +816,7 @@ <h2 style="text-align: center; line-height: 50px">kcloud_platform数据库设计
<a href="#index" style="float: right; margin-top: 6px">返回目录</a>
<b>表名:sys_i18n_message</b>
</div>
<div>说明:国际化消息</div>
<div>说明:国际化菜单</div>
<div>数据列:</div>
<table cellspacing="1">
<thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

/**
* 操作类型枚举.
*
Expand Down Expand Up @@ -66,7 +69,8 @@ public Object execute(String name, String key, ProceedingJoinPoint point, CacheM
@Override
public Object execute(String name, String key, ProceedingJoinPoint point, CacheManager cacheManager) {
try {
getCache(cacheManager, name).evictIfPresent(key);
getCache(cacheManager, name).evict(key);
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(200));
return point.proceed();
Comment on lines +72 to 74

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. 200ms eviction stall 🐞 Bug ➹ Performance

OperateType.DEL now adds a fixed 200ms park after cache eviction; because DataCacheAspectj executes
synchronously around annotated endpoints, every DEL cache operation adds hard latency to normal
write requests.
Agent Prompt
### Issue description
`OperateType.DEL` introduces a fixed 200ms `parkNanos` delay after eviction. This runs inside an `@Around` advice, adding 200ms latency to every `@DataCache(... operateType = DEL)` request.

### Issue Context
`DataCacheAspectj` is synchronous and executes on the calling thread.

### Fix Focus Areas
- laokou-common/laokou-common-data-cache/src/main/java/org/laokou/common/data/cache/aspectj/OperateType.java[68-84]
- laokou-common/laokou-common-data-cache/src/main/java/org/laokou/common/data/cache/aspectj/DataCacheAspectj.java[47-53]
- laokou-service/laokou-admin/laokou-admin-adapter/src/main/java/org/laokou/admin/web/MenusController.java[79-86]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

}
catch (GlobalException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void test_doAround_delOperation_evictsCache() throws Throwable {

// Then
Assertions.assertThat(result).isEqualTo(expectedResult);
Mockito.verify(cache).evictIfPresent(cacheKey);
Mockito.verify(cache).evict(cacheKey);
Mockito.verify(point).proceed();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.Locale;

/**
* 国际化消息工具类. <a href=
* 国际化菜单工具类. <a href=
* "https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#context-functionality-messagesource">...</a>
*
* @author laokou
Expand Down
Loading
Loading