刘洪青 | 4720585 | 2020-08-14 13:39:30 +0800 | [diff] [blame] | 1 | -- 10.1.init-message.sql |
| 2 | |
| 3 | |
| 4 | /* |
| 5 | 将 paas.example.com 替换为 paas.学校域名.edu.cn |
| 6 | */ |
| 7 | |
| 8 | -- 以下脚本为可选操作 |
| 9 | |
| 10 | /* |
| 11 | * 若部署了流程平台、门户的产品 |
| 12 | * 可初始化云平台下的相关菜单数据 |
| 13 | */ |
| 14 | |
| 15 | use admin_center; |
| 16 | |
| 17 | -- message |
| 18 | -- 如果部署,流程平台,请处理 |
| 19 | |
| 20 | |
| 21 | insert into TB_MGT_ROLE (ID, DELETED, CODE, NAME, MEMO, STATUS) |
| 22 | values ('80', 0, 'message-admin', '消息平台管理员', '', '1'); |
| 23 | insert into TB_MGT_ROLE (ID, DELETED, CODE, NAME, MEMO, STATUS) |
| 24 | values ('81', 0, 'message-opt', '消息平台操作员', '', '1'); |
| 25 | |
| 26 | commit; |
| 27 | |
| 28 | |
| 29 | /* |
| 30 | 消息服务 message-backstage |
| 31 | 名称 路由 图标 |
| 32 | 消息网关管理 /message-backstage/msgGateWay su-icon-xiaoxiwangguan |
| 33 | 短信模板管理 /message-backstage/SMSTemplateManage su-icon-mobanguanli |
| 34 | 消息类别管理 /message-backstage/msgTypes su-icon-xiaoxileibie |
| 35 | 消息任务监控 /message-backstage/msgTaskMonitor su-icon-renwujiankong |
| 36 | 消息日志审计 /message-backstage/msgLogAudit su-icon-details |
| 37 | 应用管理 /message-backstage/msgSoftManage su-icon-sort |
| 38 | 敏感词管理 /message-backstage/SensitiveWords su-icon-lock-w |
| 39 | 设置 /message-backstage/msgSendCondition su-icon-print |
| 40 | */ |
| 41 | |
| 42 | update TB_MGT_PERMISSION |
| 43 | set LFT = LFT+18 |
| 44 | where LFT>=92 |
| 45 | ; |
| 46 | |
| 47 | update TB_MGT_PERMISSION |
| 48 | set RGT = RGT+18 |
| 49 | where RGT>=92 |
| 50 | ; |
| 51 | |
| 52 | |
| 53 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 54 | values ('80000', 0, 'message-backstage', '消息服务', '1', '2', '', '/', '1', '1', 80000, 1, 92, 109); |
| 55 | |
| 56 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 57 | values ('80100', 0, 'formflow', '消息网关管理', '1', '2', 'su-icon-xiaoxiwangguan', '/message-backstage/msgGateWay', '1', '80000', 80100, 2, 93, 94); |
| 58 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 59 | values ('80200', 0, 'workbench', '短信模板管理', '1', '2', 'su-icon-mobanguanli', '/message-backstage/SMSTemplateManage', '1', '80000', 80200, 2, 95, 96); |
| 60 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 61 | values ('80300', 0, 'instanceManage', '消息类别管理', '1', '2', 'su-icon-xiaoxileibie', '/message-backstage/msgTypes', '1', '80000', 80300, 2, 97, 98); |
| 62 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 63 | values ('80400', 0, 'agent', '消息任务监控', '1', '2', 'su-icon-renwujiankong', '/message-backstage/msgTaskMonitor', '1', '80000', 80400, 2, 99, 100); |
| 64 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 65 | values ('80500', 0, 'agent', '消息日志审计', '1', '2', 'su-icon-details', '/message-backstage/msgLogAudit', '1', '80000', 80500, 2, 101, 102); |
| 66 | |
| 67 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 68 | values ('80600', 0, 'agent', '应用管理', '1', '2', 'su-icon-sort', '/message-backstage/msgSoftManage', '1', '80000', 80600, 2, 103, 104); |
| 69 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 70 | values ('80700', 0, 'agent', '敏感词管理', '1', '2', 'su-icon-lock-w', '/message-backstage/SensitiveWords', '1', '80000', 80700, 2, 105, 106); |
| 71 | insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT) |
| 72 | values ('80800', 0, 'agent', '设置', '1', '2', 'su-icon-print', '/message-backstage/msgSendCondition', '1', '80000', 80800, 2, 107, 108); |
| 73 | |
| 74 | commit; |
| 75 | |
| 76 | |
| 77 | insert into TB_MGT_ROLE_PERMISSION (ID, DELETED, ROLE_ID, PERMISSION_ID) |
| 78 | |
| 79 | select CONCAT('1_', ID) as ID, 0 as DELETED, '1' as ROLE_ID, ID as PERMISSION_ID |
| 80 | from TB_MGT_PERMISSION |
| 81 | where (ID like '8____' or ID='1') |
| 82 | and CONCAT('1_', ID) not in (select ID from TB_MGT_ROLE_PERMISSION) |
| 83 | ; |
| 84 | |
| 85 | insert into TB_MGT_ROLE_PERMISSION (ID, DELETED, ROLE_ID, PERMISSION_ID) |
| 86 | |
| 87 | select CONCAT('80_', ID) as ID, 0 as DELETED, '50' as ROLE_ID, ID as PERMISSION_ID |
| 88 | from TB_MGT_PERMISSION |
| 89 | where (ID like '8____' or ID='1') |
| 90 | and CONCAT('80_', ID) not in (select ID from TB_MGT_ROLE_PERMISSION) |
| 91 | ; |
| 92 | |
| 93 | commit; |
| 94 | |
| 95 | |
| 96 | -- 更新 admin-platform 下菜单的访问域 |
| 97 | |
| 98 | update TB_MGT_PERMISSION |
| 99 | set |
| 100 | ORIGIN='http://admin-platform.paas.example.com' |
| 101 | where LFT >= 92 |
| 102 | and RGT <= 109 |
| 103 | ; |
| 104 | |
| 105 | commit; |