From 122e042855afd869502cc30137ce161761d49b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=99=BA=E6=9D=B0=EF=BC=88=E5=87=AF=E7=A5=9E?= =?UTF-8?q?=E4=BC=A0=E5=AA=92=EF=BC=89?= <2026659954@qq.com> Date: Sat, 7 Sep 2024 17:38:03 +0800 Subject: [PATCH 1/3] 2 --- ...12\344\274\240\345\233\276\345\272\212.md" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" diff --git "a/\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" "b/\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" new file mode 100644 index 0000000..4e3458e --- /dev/null +++ "b/\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" @@ -0,0 +1,24 @@ +## 图床及picgo插件的使用,实现自动上传到gitee。 + +1. gitee当图床 + +2. 安装配置picgo + + 1. 插件下载(配置node.js环境)![image-20240907172246587](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20240907172246587.png) + + 2. ![image-20240907173533261](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20240907173533261.png) + + 3. + + + + + +3. 配置typroa,使用picgo + + 1. 图像设置![image-20240907172937596](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20240907172937596.png) + 2. + +4. 配合截图软件snipaste + + \ No newline at end of file -- Gitee From 34989a4e4281e44efbd2b9dae9bfc32016856f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=99=BA=E6=9D=B0?= <2026659954@qq.com> Date: Sat, 7 Sep 2024 21:20:53 +0800 Subject: [PATCH 2/3] 2 --- ...44\270\212\344\274\240\345\233\276\345\272\212.md" | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git "a/\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" "b/\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" index 4e3458e..cc3818f 100644 --- "a/\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" +++ "b/\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" @@ -4,11 +4,9 @@ 2. 安装配置picgo - 1. 插件下载(配置node.js环境)![image-20240907172246587](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20240907172246587.png) + 1. 插件下载(配置node.js环境)![image-20240907211704869](https://gitee.com/dhayyds/picture/raw/master/images/202409072117017.png) - 2. ![image-20240907173533261](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20240907173533261.png) - - 3. + 2. ![image-20240907211643457](https://gitee.com/dhayyds/picture/raw/master/images/202409072116499.png) @@ -16,9 +14,8 @@ 3. 配置typroa,使用picgo - 1. 图像设置![image-20240907172937596](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20240907172937596.png) - 2. - + 1. 图像设置![image-20240907211731192](https://gitee.com/dhayyds/picture/raw/master/images/202409072117241.png) + 4. 配合截图软件snipaste \ No newline at end of file -- Gitee From 6512740d4bfc70a202659a6dd80ef576d409ac3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=99=BA=E6=9D=B0?= <2026659954@qq.com> Date: Sun, 8 Sep 2024 21:03:28 +0800 Subject: [PATCH 3/3] 3 --- .../1.png" | Bin .../2.png" | Bin .../3.png" | Bin .../4.png" | Bin .../crebas.sql" | 0 ...76\350\256\241\347\254\224\350\256\260.md" | 0 ...12\344\274\240\345\233\276\345\272\212.md" | 0 ...AC\347\232\204\350\277\220\347\224\250.md" | 217 ++++++++++++++++++ "\346\261\237\346\231\272\346\235\260/jzj.md" | 19 -- 9 files changed, 217 insertions(+), 19 deletions(-) rename "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/1.png" => "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/1.png" (100%) rename "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/2.png" => "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/2.png" (100%) rename "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/3.png" => "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/3.png" (100%) rename "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/4.png" => "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/4.png" (100%) rename "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/crebas.sql" => "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/crebas.sql" (100%) rename "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" => "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" (100%) rename "\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" => "\346\261\237\346\231\272\346\235\260/02 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" (100%) create mode 100644 "\346\261\237\346\231\272\346\235\260/03 RBAC\347\232\204\350\277\220\347\224\250/RBAC\347\232\204\350\277\220\347\224\250.md" delete mode 100644 "\346\261\237\346\231\272\346\235\260/jzj.md" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/1.png" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/1.png" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/1.png" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/1.png" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/2.png" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/2.png" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/2.png" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/2.png" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/3.png" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/3.png" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/3.png" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/3.png" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/4.png" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/4.png" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/4.png" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/4.png" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/crebas.sql" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/crebas.sql" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/crebas.sql" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/crebas.sql" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" diff --git "a/\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" "b/\346\261\237\346\231\272\346\235\260/02 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/20240927 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" rename to "\346\261\237\346\231\272\346\235\260/02 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" diff --git "a/\346\261\237\346\231\272\346\235\260/03 RBAC\347\232\204\350\277\220\347\224\250/RBAC\347\232\204\350\277\220\347\224\250.md" "b/\346\261\237\346\231\272\346\235\260/03 RBAC\347\232\204\350\277\220\347\224\250/RBAC\347\232\204\350\277\220\347\224\250.md" new file mode 100644 index 0000000..0664945 --- /dev/null +++ "b/\346\261\237\346\231\272\346\235\260/03 RBAC\347\232\204\350\277\220\347\224\250/RBAC\347\232\204\350\277\220\347\224\250.md" @@ -0,0 +1,217 @@ +# RBAC的运用 + +## 概念 + +Role-Based Access Control,中文意思是:基于角色(Role)的访问控制。这是一种广泛应用于计算机系统和网络安全领域的访问控制模型 + +通过将 **权限** 分配给 **角色** 分配给 **用户** 来实现对系统资源的访问控制。 + +1. **角色(Role)**:角色是指在系统中具有一组相关权限的抽象概念,代表了用户在特定上下文中的身份或职能,例如管理员、普通用户等。 +2. 权限(Permission):权限是指对系统资源进行操作的许可,如读取、写入、修改等。权限可以被分配给角色。 +3. **用户(User)**:用户是指系统的实际使用者,每个用户可以被分配一个或多个角色。 +4. 分配(Assignment):分配是指将角色与用户关联起来,以赋予用户相应的权限 + +总结就是将权限分配给角色,在将角色分配给用户,使不同的用户拥有不同的权限 + +## 作业要求 + +![image-20240908201935294](https://gitee.com/dhayyds/picture/raw/master/images/202409082019498.png) + +## 作业展示 + +### CDM + +![image-20240908201715177](https://gitee.com/dhayyds/picture/raw/master/images/202409082017432.png) + +### LDM + +![image-20240908201542437](https://gitee.com/dhayyds/picture/raw/master/images/202409082015789.png) + +### PDM + +![image-20240908201753108](https://gitee.com/dhayyds/picture/raw/master/images/202409082017345.png) + +### 生成的sql + +```sql +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2024/9/8 20:10:35 */ +/*==============================================================*/ + + +drop table if exists banzhuren; + +drop table if exists caozuo; + +drop table if exists chengji; + +drop table if exists class; + +drop table if exists juese; + +drop table if exists student; + +drop table if exists teacher; + +drop table if exists teachs; + +drop table if exists xinxi; + +/*==============================================================*/ +/* Table: banzhuren */ +/*==============================================================*/ +create table banzhuren +( + bid int not null, + tno int, + jleixing varchar(5), + primary key (bid) +); + +/*==============================================================*/ +/* Table: caozuo */ +/*==============================================================*/ +create table caozuo +( + czid int not null, + czname varchar(5), + primary key (czid) +); + +/*==============================================================*/ +/* Table: chengji */ +/*==============================================================*/ +create table chengji +( + cname varchar(5) not null, + sno int, + cc int, + primary key (cname) +); + +/*==============================================================*/ +/* Table: class */ +/*==============================================================*/ +create table class +( + clid int not null, + bid int, + primary key (clid) +); + +/*==============================================================*/ +/* Table: juese */ +/*==============================================================*/ +create table juese +( + jleixing varchar(5) not null, + czid int, + primary key (jleixing) +); + +/*==============================================================*/ +/* Table: student */ +/*==============================================================*/ +create table student +( + sno int not null, + name varchar(5), + jleixing varchar(5), + primary key (sno) +); + +/*==============================================================*/ +/* Table: teacher */ +/*==============================================================*/ +create table teacher +( + tno int not null, + name varchar(5), + jleixing varchar(5), + primary key (tno) +); + +/*==============================================================*/ +/* Table: teachs */ +/*==============================================================*/ +create table teachs +( + tno int not null, + clid int not null, + primary key (tno, clid) +); + +/*==============================================================*/ +/* Table: xinxi */ +/*==============================================================*/ +create table xinxi +( + name varchar(5) not null, + age int, + sex varchar(2), + tongyongcaozuo varchar(20), + primary key (name) +); + +alter table banzhuren add constraint FK_Relationship_12 foreign key (tno) + references teacher (tno) on delete restrict on update restrict; + +alter table banzhuren add constraint FK_Relationship_13 foreign key (jleixing) + references juese (jleixing) on delete restrict on update restrict; + +alter table chengji add constraint FK_Relationship_5 foreign key (sno) + references student (sno) on delete restrict on update restrict; + +alter table class add constraint FK_Relationship_18 foreign key (bid) + references banzhuren (bid) on delete restrict on update restrict; + +alter table juese add constraint FK_Relationship_14 foreign key (czid) + references caozuo (czid) on delete restrict on update restrict; + +alter table student add constraint FK_Relationship_15 foreign key (name) + references xinxi (name) on delete restrict on update restrict; + +alter table student add constraint FK_Relationship_9 foreign key (jleixing) + references juese (jleixing) on delete restrict on update restrict; + +alter table teacher add constraint FK_Relationship_10 foreign key (jleixing) + references juese (jleixing) on delete restrict on update restrict; + +alter table teacher add constraint FK_Relationship_16 foreign key (name) + references xinxi (name) on delete restrict on update restrict; + +alter table teachs add constraint FK_Relationship_17 foreign key (clid) + references class (clid) on delete restrict on update restrict; + +alter table teachs add constraint FK_Relationship_8 foreign key (tno) + references teacher (tno) on delete restrict on update restrict; + + +``` + +### 添加测试数据sql + +![image-20240908205658804](https://gitee.com/dhayyds/picture/raw/master/images/202409082056929.png) + +![image-20240908205719148](https://gitee.com/dhayyds/picture/raw/master/images/202409082057280.png) + +```sql +INSERT into juese VALUES('学生'),('老师'),('班主任') + +INSERT INTO caozuo VALUES(1,'学生','学生数据查询'),(2,'老师','添加成绩'),(3,'老师','修改成绩'),(4,'老师','查看成绩'),(5,'班主任','本班学生信息管理'),(6,'班主任','本班考试信息管理') + +INSERT into xinxi VALUES('老丘',18,'男','个人信息'),('老范',18,'男','个人信息'),('老胡',18,'男','个人信息') + +INSERT into teacher VALUES(1,'老丘','老师'),(2,'老范','老师'),(3,'老胡','老师') + +``` + +### 查询 + +![image-20240908205546669](https://gitee.com/dhayyds/picture/raw/master/images/202409082055885.png) + +```sql +SELECT name,czname FROM caozuo c INNER JOIN teacher t on c.jleixing=t.jleixing WHERE name='老丘' +``` + diff --git "a/\346\261\237\346\231\272\346\235\260/jzj.md" "b/\346\261\237\346\231\272\346\235\260/jzj.md" deleted file mode 100644 index 288dbfe..0000000 --- "a/\346\261\237\346\231\272\346\235\260/jzj.md" +++ /dev/null @@ -1,19 +0,0 @@ -# 数据库高级应用 - -## 1. 数据库设计基础 - 1. 表与表的关系 - 2. ER图 - 3. 数据库的三式范式 - 4. 设计数据库的软件 -## 2. 数据库设计基础进阶 - 1. RBAC与SKU -## 3. 数据库高阶语法 - 1. 自连接,左连接,右连接,外连接 - 2. 视图 - 3. 单行函数 - 4. 存储过程 - 5. 分支结构、循环结构 :if while for - 6. 窗口函数 - 7. 触发器 - 8. 索引 - 9. 事务 \ No newline at end of file -- Gitee