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升级脚本

#增加目录字段与全路径字段
ALTER TABLE `api_info`
ADD COLUMN `full_path` VARCHAR(200) NULL AFTER `create_time`,
ADD COLUMN `directory_id` VARCHAR(45) NULL AFTER `full_path`;
ALTER TABLE `api_info_history`
ADD COLUMN `full_path` VARCHAR(200) NULL AFTER `create_time`,
ADD COLUMN `directory_id` VARCHAR(45) NULL AFTER `full_path`;
#添加新表用于目录管理
CREATE TABLE `api_directory` (
`id` varchar(45) NOT NULL,
`name` varchar(45) DEFAULT NULL,
`path` varchar(200) DEFAULT NULL,
`parent_id` varchar(20) DEFAULT NULL,
`service` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
#数据迁移命令,填充目录字段与全路径字段
insert into api_directory(id,service,name) select md5(uuid()),service,group_name from api_info group by service,group_name;
SET SQL_SAFE_UPDATES = 0;
update api_info set full_path=path where 1=1;
update api_info t1 set directory_id = (select id from api_directory t2 where t1.group_name = t2.name) ;
update api_info_history set full_path=path where 1=1;
update api_info_history t1 set directory_id = (select id from api_directory t2 where t1.group_name = t2.name) ;
#移除组名字段 ---注意前面执行成功再执行删除
ALTER TABLE `api_info`
DROP COLUMN `group_name`;
ALTER TABLE `api_info_history`
DROP COLUMN `group_name`;

mongodb 2.3.6升级脚本

db.api_info.aggregate([ { $group: {"_id": { "groupName" : "$groupName","service":"$service"} } } ]).forEach(function(item){
db.api_directory.insert({"name":item._id.groupName,"service":item._id.service});
})
db.getCollection('api_info').find({}).forEach(function(item){
db.api_directory.find({name:item.groupName,service:item.service}).forEach(function(item2){
item.directoryId = item2._id.str;
item.fullPath = item.path;
db.api_info.save(item);
})
})
Copy link
Outline