From 050182a0b3f8a0b00dec70ee30d8ec951b9809ac Mon Sep 17 00:00:00 2001 From: b2baccline <23131013+b2baccline@users.noreply.github.com> Date: Fri, 16 Oct 2020 16:22:15 +0800 Subject: [PATCH] =?UTF-8?q?:pencil:=20v0.0.6=20=E6=96=87=E6=A1=A3=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=A2=9E=E9=87=8Fsql=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 34 +++++++++++++++++++++++++++++++++- README.md | 12 +++++++----- doc/update_sql/0.0.4.sql | 2 +- doc/update_sql/0.0.6.sql | 26 +++++++++++++++++++++++--- 4 files changed, 64 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16aee1e1..538ba635 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,38 @@ - OSS starter 修改使用 AWS S3 + +## [0.0.6] + +### Warning + +- 更新了 UserDetail,缓存反序列化将会出现问题,更新版本前需要清除对应缓存 +- 返回体结构修改,属性 msg 修改为 message,可能影响前端信息展示,接入系统的第三方的响应数据接收,升级前需提前沟通 + +### Added + +- feat: 新增组织机构(部门),用户与组织机构为一对一的关系 +- feat: 数据权限,利用 mybatis 拦截器对 sql 进行拦截约束,约束规则支持自定义,适用于大部分数据权限控制。 +- feat: 角色新增 scopeType,暂时支持全部,本人,本部门,本人及子部门等几种范围类型 + +### Changed + +- fix: 修复没有提供默认 profile,导致用户不指定 profile 时,全局异常处理无法正常初始化的问题 + +- refactor: lovBody 和 lovSearch 关联属性由 lovId 更改为 keyword + +- refactor: UserDetails 属性重构,抽象出用户资源(userResources)属性,默认将用户的角色和权限作为资源存入userResources,并提供 UserResourceCoordinator 用户资源协调者,方便根据业务扩展用户资源(便于数据权限管理) + +- refactor: kafka 消费者配置提供 + +- refactor: 返回体结构修改,属性 msg 修改为 message + +- refactor: xss 和 monitor auth 过滤器提供开关,并调整了配置前缀 + +- refactor: 用户角色,角色权限的关联,由 role_id 修改为使用 role_code + + + ## [0.0.5] ### Added @@ -177,4 +209,4 @@ `@MapperScan("com.hccake.ballcat.**.mapper")` `@ComponentScan("com.hccake.ballcat.admin")` - 注解上的这两个包扫描也可去掉。 + 注解上的这两个包扫描也可去掉。 \ No newline at end of file diff --git a/README.md b/README.md index bc86ae10..da5d87b1 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ | |-- ballcat-sample-monitor -- SpringBootAdmin监控server端集成示例 | `-- ballcat-sample-swagger-provider -- 无注册中心的swagger-provider提供示例 |-- ballcat-starters +| |-- ballcat-spring-boot-starter-datascope -- 数据权限控制 +| |-- ballcat-spring-boot-starter-dingtalk -- 钉钉集成工具 | |-- ballcat-spring-boot-starter-easyexcel -- 通过注解快速导出excle(easyexcel) | |-- ballcat-spring-boot-starter-job -- 定时任务集成(目前仅xxl-job) | |-- ballcat-spring-boot-starter-log -- 访问日志,操作日志,TraceId注入 @@ -75,11 +77,11 @@ | 依赖 | 版本 | 官网 | | ---------------------- | ------------- | ------------------------------------------------ | -| Spring Boot | 2.2.6.RELEASE | https://spring.io/projects/spring-boot#learn | -| Spring Security OAuth2 | 2.3.6.RELEASE | https://spring.io/projects/spring-security-oauth | -| Mybatis Plus | 3.3.1 | https://mp.baomidou.com/ | +| Spring Boot | 2.3.4.RELEASE | https://spring.io/projects/spring-boot#learn | +| Spring Security OAuth2 | 2.3.8.RELEASE | https://spring.io/projects/spring-security-oauth | +| Mybatis Plus | 3.4.0 | https://mp.baomidou.com/ | | XXL-JOB | 2.2.0 | http://www.xuxueli.com/xxl-job | -| Hutool | 5.2.5 | https://www.hutool.cn/ | +| Hutool | 5.4.1 | https://www.hutool.cn/ | - 前端 @@ -87,7 +89,7 @@ | 依赖 | 版本 | 官网 | | ------------------ | ------ | ---------------------- | | Vue | 2.6.10 | https://cn.vuejs.org/ | -| Ant Design Vue | 1.5.6 | https://www.antdv.com | +| Ant Design Vue | 1.6.5 | https://www.antdv.com | | Ant Design Vue Pro | 2.0.2 | https://pro.loacg.com/ | diff --git a/doc/update_sql/0.0.4.sql b/doc/update_sql/0.0.4.sql index b4177e52..48828351 100644 --- a/doc/update_sql/0.0.4.sql +++ b/doc/update_sql/0.0.4.sql @@ -1,5 +1,5 @@ update sys_dict set `code` = 'log_status' where `code` = 'log_type'; -update sys_dict_item set `dict_codecode` = 'log_status' where `dict_code` = 'log_type'; +update sys_dict_item set `dict_code` = 'log_status' where `dict_code` = 'log_type'; ALTER TABLE `ballcat`.`admin_access_log` ADD COLUMN `result` text NULL COMMENT '响应信息' AFTER `http_status`; diff --git a/doc/update_sql/0.0.6.sql b/doc/update_sql/0.0.6.sql index 194c04c2..b986904c 100644 --- a/doc/update_sql/0.0.6.sql +++ b/doc/update_sql/0.0.6.sql @@ -65,26 +65,46 @@ CREATE TABLE `sys_lov_search` -- 角色数据权限字段 ALTER TABLE `sys_role` ADD COLUMN `scope_type` tinyint(1) NULL COMMENT '数据权限:1全部,2本人,3本人及子部门,4本部门' AFTER `update_time`; - +-- 更新索引为唯一索引 ALTER TABLE `sys_role` DROP INDEX `uk_code_deleted`, ADD UNIQUE INDEX `uk_code_deleted` (`code`, `deleted`) USING BTREE; +-- 用户角色关联表更新 alter table sys_user_role drop primary key ; alter table sys_user_role add column `id` bigint(20) NOT NULL primary key AUTO_INCREMENT FIRST; - alter table sys_user_role add column `role_code` varchar(64) comment 'role code'; alter table sys_user_role add unique (`role_code`,`user_id`); update sys_user_role set `role_code`= (select `code` from sys_role where `id`=`role_id`) where role_code is null; alter table sys_user_role modify column `role_code` varchar(64) not null comment 'role code'; alter table sys_user_role drop `role_id`; +-- 角色权限关联表更新 alter table sys_role_permission drop primary key ; alter table sys_role_permission add column `id` bigint(20) NOT NULL primary key AUTO_INCREMENT FIRST; - alter table sys_role_permission add column `role_code` varchar(64) comment 'role code'; alter table sys_role_permission add unique (`role_code`,`permission_id`); update sys_role_permission set `role_code`= (select `code` from sys_role where `id`=`role_id`) where role_code is null; alter table sys_role_permission modify column `role_code` varchar(64) not null comment 'role code'; alter table sys_role_permission drop `role_id`; + +-- 组织架构表 +CREATE TABLE `sys_organization` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `name` varchar(50) DEFAULT NULL COMMENT '组织名称', + `parent_id` int(11) DEFAULT '0' COMMENT '父级ID', + `hierarchy` varchar(512) DEFAULT NULL COMMENT '层级信息,从根节点到当前节点的最短路径,使用-分割节点ID', + `depth` int(1) DEFAULT NULL COMMENT '当前节点深度', + `description` varchar(512) DEFAULT NULL COMMENT '描述信息', + `sort` int(1) DEFAULT '1' COMMENT '排序字段,由小到大', + `create_by` varchar(100) DEFAULT NULL COMMENT '创建者', + `update_by` varchar(100) DEFAULT NULL COMMENT '修改者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='组织架构'; + +-- 系统用户表添加组织架构关联id +ALTER TABLE `sys_user` +ADD COLUMN `organization_id` int(11) NULL DEFAULT 0 COMMENT '所属组织ID' AFTER `type`; \ No newline at end of file