R
R
Rocket-API
Search…
2.3.6.RELEASE
#功能新增或修改
1. 添加抽象方法IApiInfoCache.refreshNotify,receiveNotify,可实现分布式环境下不重启实例也能达到各实例缓存的自动刷新和mapping重载问题。基于spring cloud 配置中心刷新思想.通过页面上的"Rebuild API List" 行为触发
2.添加目录管理功能,支持不限级的自定义目录,并且允许在目录上指api统一的路径前缀
2. 修复处理因开启页面动态配置后,导致远程发布接口异常,问题在于在事务内执行了数据源的配置刷新,导致当前事务失效
3. 清理一大堆无用代码,使项目结构更紧凑
4. 数据库操作提示,表结构扫描跳过视图
升级脚本--注意备份

mysql 2.3.6升级脚本

1
#增加目录字段与全路径字段
2
ALTER TABLE `api_info`
3
ADD COLUMN `full_path` VARCHAR(200) NULL AFTER `create_time`,
4
ADD COLUMN `directory_id` VARCHAR(45) NULL AFTER `full_path`;
5
6
ALTER TABLE `api_info_history`
7
ADD COLUMN `full_path` VARCHAR(200) NULL AFTER `create_time`,
8
ADD COLUMN `directory_id` VARCHAR(45) NULL AFTER `full_path`;
9
10
#添加新表用于目录管理
11
CREATE TABLE `api_directory` (
12
`id` varchar(45) NOT NULL,
13
`name` varchar(45) DEFAULT NULL,
14
`path` varchar(200) DEFAULT NULL,
15
`parent_id` varchar(20) DEFAULT NULL,
16
`service` varchar(45) DEFAULT NULL,
17
PRIMARY KEY (`id`)
18
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
19
20
21
22
#数据迁移命令,填充目录字段与全路径字段
23
insert into api_directory(id,service,name) select md5(uuid()),service,group_name from api_info group by service,group_name;
24
25
SET SQL_SAFE_UPDATES = 0;
26
update api_info set full_path=path where 1=1;
27
update api_info t1 set directory_id = (select id from api_directory t2 where t1.group_name = t2.name) ;
28
29
update api_info_history set full_path=path where 1=1;
30
update api_info_history t1 set directory_id = (select id from api_directory t2 where t1.group_name = t2.name) ;
31
32
33
#移除组名字段 ---注意前面执行成功再执行删除
34
ALTER TABLE `api_info`
35
DROP COLUMN `group_name`;
36
37
ALTER TABLE `api_info_history`
38
DROP COLUMN `group_name`;
Copied!

mongodb 2.3.6升级脚本

1
db.api_info.aggregate([ { $group: {"_id": { "groupName" : "$groupName","service":"$service"} } } ]).forEach(function(item){
2
db.api_directory.insert({"name":item._id.groupName,"service":item._id.service});
3
})
4
5
db.getCollection('api_info').find({}).forEach(function(item){
6
db.api_directory.find({name:item.groupName,service:item.service}).forEach(function(item2){
7
item.directoryId = item2._id.str;
8
item.fullPath = item.path;
9
db.api_info.save(item);
10
})
11
12
})
Copied!
Last modified 8mo ago
Copy link
Contents