sxwz2.0/db/create_role_permission_table.sql
wangzhiwei 5f5c0759ce feat(notification): 实现通知功能,支持角色层级发送和课程群发
1. 修改 SysNotification 实体,新增 senderId, senderName, targetType 字段

2. 新增 SendNotificationRequest 请求DTO

3. 扩展通知类型至6种(新增用户通知、课程通知)

4. 实现角色层级权限控制,支持多级管理员通知下级

5. 支持老师群发课程通知给学生

6. 新增批量发送接口和权限配置
2026-05-15 16:57:07 +08:00

23 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 创建角色权限关联表
-- 作者: 王志维
-- 创建时间: 2026-04-30
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- 角色权限关联表
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
`permission_id` BIGINT(20) NOT NULL COMMENT '权限主键ID关联权限主表主键',
`role_id` BIGINT(20) NOT NULL COMMENT '角色主键ID关联角色主表主键',
`role_code` VARCHAR(64) NOT NULL COMMENT '角色标识码如student、teacher、school_admin',
`permission_code` VARCHAR(128) NOT NULL COMMENT '接口/按钮权限码如system:user:add',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '权限绑定关系创建时间',
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '权限绑定关系最后更新时间',
PRIMARY KEY (`permission_id`, `role_id`),
KEY `idx_role_id` (`role_id`),
KEY `idx_role_code` (`role_code`),
KEY `idx_permission_code` (`permission_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关联表';
SET FOREIGN_KEY_CHECKS = 1;