教育后台管理系统

1.mave

  maven是一个项目管理工具,主要在项目开发阶段对java项目进行依赖管理和项目创建,包括导入maven坐标将仓库中的jar包导入当前项目,通过maven命令实现项目的清理、编译、测试、报告、打包和部署的过程

  • maven仓库:本地仓库==》maven私服仓库==》maven中央仓库(http://repo2.maven.org/maven2/)==》其他公共远程仓库(apache提供的远程仓库,地址:
    http://repo.maven.apache.org/maven2/
  • maven 常用命令: clean清理,compile编译,test测试,package打包,install安装
  • maven的依赖传递:一个直接依赖,多个间接依赖,即C直接依赖B,B直接依赖A,则C依赖A
  • maven依赖冲突:当多个依赖传递时,会造成引入的依赖名重复,但版本不同
    • 解决一:使用maven提供的依赖调解原则,第一声明者优先原则和路径近者优先原则,直接依赖大于依赖传递
    • 解决二:排除依赖,使用exclusions标签将传递过来的依赖排除

     

    • 解决三:依赖锁定,直接锁定版本确定依赖的jar包,版本锁定后不考虑依赖的声明顺序或路径,以锁定版本为准(常用)
      • dependencyManagement标签中锁定依赖版本
      • dependencyManagement标签中声明需要导入的maven坐标

       

  • properties标签:方便锁定版本,进行版本修改

2. maven聚合工程(分模块进行开发)

  • 常见的拆分模式
    • 按业务模块:每个业务模块拆分成一个maven工程,如用户模块,订单模块等
    • 按层拆分:分为持久层,业务层,表现层,每个层对应一个maven工程
  • 父工程:主要存放公共代码和配置,方便统一管理和配置
  • 子工程继承:maven工程可以继承,子工程继承父工程后,可以使用在父工程中引入的依赖,消除重复代码
  • maven工程的pom.xml文件使用标签将其他工程聚合到一起进行统一操作,只需执行一次打包所有工程

3. 教育后台管理系统

  • edu_home_parent为父工程,其余工程为子工程,都继承父工程edu_home_parent
  • 子工程之间存在依赖关系ssm_domain依赖ssm_utils,ssm_dao依赖ssm_domain,ssm_service依赖ssm_dao,ssm_web依赖ssm_service
  • 课程管理模块包含了多条件查询、 图片上传、 新建&修改课程、课程状态管理 、课程内容展示、回显章节对应的课程信息、新建&修改章节信息、修改章节状态、 新建&修改课时信息等接口的编写
  • 数据表
    • 课程表
字段名称 类型
描述
id int(11) unsigned NOT NUL
AUTO_INCREMENT
PK 主键PK
course_name varchar(255) 课程名
brief varchar(255) 课程一句话简介
price double(10,2) 原价
price_tag varchar(255) 原价标签
discounts double(10,2) 优惠价
discounts_tag varchar(255) 优惠标签
course_description_mark_down longtext 描述markdown
course_description longtext 课程描述
course_img_url varchar(255) 课程列表图
is_new tinyint(1) 是否新品
is_new_des varchar(255) 广告语
last_operator_id int(11) 最后操作者
create_time datetime 创建时间
update_time datetime 更新时间'
is_del tinyint(1) 是否删除
total_duration int(11) 总时长(分钟)
course_list_img varchar(255) 课程列表展示图片
status int(2) 课程状态,0-
稿,1-上架
sort_num int(11) 课程排序,用于后
台保存草稿时用到
preview_first_field varchar(255) 课程预览第一个字
preview_second_field varchar(255) 课程预览第二个字
sales int(11) 销量
    • 章节表
字段名称 类型 约束 描述
id int(11) PK '主键ID
course_id int(11) 课程id
section_name varchar(255) 章节名
description varchar(255) '章节描述'
status int(1) 状态,0:隐藏;1:待更新;2:已发布
order_num int(11) 排序字段
is_de tinyint(1) 是否删除
update_time datetime '更新时间
create_time datetime 记录创建时间
    • 课时表
字段名称 类型 约束 描述
id int(11) PK 主键
course_id int(11) 课程id
section_id int(11) 章节id
theme varchar(255) 课时主题
duration int(11) '课时时长(分钟)
is_free tinyint(1) 是否免费
is_del tinyint(1) 是否删除
order_num int(11) 排序字段
status int(2) 课时状态,0-隐藏,1-未发布,2-已发布
update_time datetime 更新时间
create_time datetime 记录创建时间
    • 课程媒体
字段名称 类型 约束 描述
id int(11) PK '课程媒体主键ID
course_id int(11) 课程id
section_id int(11) 章节id
cover_image_url varchar(255) 封面图URL
duration varchar(50) 时长(06:02
file_edk varchar(500) 媒体资源文件对应的EDK
file_size double(10,2) 文件大小MB
file_name varchar(100) 文件名称
file_dk varchar(100) '媒体资源文件对应的DK
duration_num varchar(50) 时长,秒数
file_id varchar(50) 媒体资源文件ID
is_del tinyint(1) 是否删除,0未删除,1删除
update_time datetime 更新时间
create_time datetime 创建时间

4. 课程管理模块接口文档

4.1 查询&条件查询

参数名称参数说明in是否必须数据类型schema
courseName     false string  
status     false integer(int32)  
  • 请求示例:
{"courseName": "Vue.js 3.0 核心源码解析",
    "status": 1
}
  • 响应参数:
参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  
  • 响应示例:
{
    "success": true,
    "state": 0,
    "message": "响应成功",
    "content": {课程数据}
}

4.2 图片上传接口

参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  
  • 响应示例:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "fileName": "1597112871741.JPG",
        "filePath": "http://localhost:8080/upload/1597112871741.JPG"
    }
}

4.3 新建&修改课程接口

字段说明类型是否必需备注
id 课程id int 添加操作不用携带, 修改操作必须携带ID
courseName 课程名称 String  
brief 课程简介 String 一句话介绍课程
teacherName 讲师名称 String  
description 讲师介绍 String  
position 讲师职位 String  
previewFirstField 课程概述1 String 第一段描述 例如: 课程共15讲
previewSecondField 课程概述2 String 第二段描述 例如: 每周五更新
discounts 售卖价格 double 课程的售卖价格
price 商品原价 double 课程的原销售价
discountsTag 活动标签 String 例如: 立即抢购
courseImgUrl 课程图片url String  
courseListImg 封面图url String  
sortNum 课程排序 int  
course_description_mark_down 课程描述 String  
sales 销量 int  
  • 请求示例
//新增
{
    "courseName":"大数据云计算",
    "brief":"海量大数据课程",
    "teacherName":"维尼",
    "description":"多年企业实战经验",
    "position":"高级讲师",
    "previewFirstField":"共10讲",
    "previewSecondField":"每周四更新",
    "discounts":66.6,
    "price":88,
    "discountsTag":"先到先得",
    "courseImgUrl":"http://localhost:8080/upload/1596520226925.jpg",
    "courseListImg":"http://localhost:8080/upload/1596520226925.jpg",
    "sortNum":1,
    "courseDescriptionMarkDown":"介绍当前流行大数据技术,数据技术原理,并介绍其思想,介绍大数据技术培训课程,概要介绍。",
    "sales":100
}
//修改
{
    "id":15,
    "courseName":"全栈工程师",
    "brief":"掌握多种技能,胜任前端与后端",
    "teacherName":"药水哥",
    "description":"多年企业实战经验",
    "position":"高级讲师",
    "previewFirstField":"共10讲",
    "previewSecondField":"每周四更新",
    "discounts":66.6,
    "price":88,
    "discountsTag":"先到先得",
    "courseImgUrl":"http://localhost:8080/upload/1596520226925.jpg",
    "courseListImg":"http://localhost:8080/upload/1596520226925.jpg",
    "sortNum":1,
    "courseDescriptionMarkDown":"介绍当前流行大数据技术,数据技术原理,并介绍其思想,介绍大数据技术培训课程,概要介绍。",
    "sales":100
}
  • 响应参数:
参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  
  • 响应示例
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": null
}

4.4 根据id查询课程信息

字段说明类型是否必需备注
id 课程id int  
  • 响应结果示例

{
  "success": true,
  "state": 200,
  "message": "响应成功",
  "content": 课程信息
}

4.5 课程状态管理

参数名称参数说明in是否必须数据类型备注
id 课程id   true int  
status 课程状态   true int 最新的状态值
  • 请求示例:
http://localhost:8080/ssm-web/course/updateCourseStatus?status=1&id=15
  • 响应参数:
参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  
  • 响应示例:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "status": 1
    }
}

4.6 课程内容展示

参数名称参数说明in是否必须数据类型schema
courseId 课程id   true int  
  • 请求示例

http://localhost:8080/ssm-web/courseContent/findSectionAndLesson?courseId=7
  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": [
        {
            "id": 7,
            "courseId": 7,
            "sectionName": "开篇词 | 从小白到文案高手,手把手教你写出爆款文案",
            "description": "你好,我是兔妈!第一次见面,我用几句话简单介绍下自己",
            "createTime": null,
            "updateTime": null,
            "isDe": 0,
            "orderNum": 1,
            "status": 2,
            "lessonList": [
                {
                    "id": 9,
                    "courseId": 7,
                    "sectionId": 7,
                    "theme": "手把手教你写出爆款文案",
                    "duration": 0,
                    "isFree": 0,
                    "createTime": null,
                    "updateTime": null,
                    "isDel": 0,
                    "orderNum": 1,
                    "status": 2
                },
                {
                    "id": 8,
                    "courseId": 7,
                    "sectionId": 7,
                    "theme": "从小白到文案高手",
                    "duration": 0,
                    "isFree": 1,
                    "createTime": null,
                    "updateTime": null,
                    "isDel": 0,
                    "orderNum": 1,
                    "status": 2
                }
            ]
        },
        {
            "id": 8,
            "courseId": 7,
            "sectionName": "重点内容总结",
            "description": "重点内容总结",
            "createTime": null,
            "updateTime": null,
            "isDe": 0,
            "orderNum": 2,
            "status": 2,
            "lessonList": [
                {
                    "id": 11,
                    "courseId": 7,
                    "sectionId": 8,
                    "theme": "内容总结",
                    "duration": 0,
                    "isFree": 0,
                    "createTime": null,
                    "updateTime": null,
                    "isDel": 0,
                    "orderNum": 2,
                    "status": 2
                },
                {
                    "id": 10,
                    "courseId": 7,
                    "sectionId": 8,
                    "theme": "重点内容",
                    "duration": 0,
                    "isFree": 0,
                    "createTime": null,
                    "updateTime": null,
                    "isDel": 0,
                    "orderNum": 2,
                    "status": 2
                }
            ]
        }
    ]
}

4.7 回显章节对应的课程信息

参数名称参数说明in是否必须数据类型schema
courseId 课程id   true int  
  • 请求示例

http://localhost:8080/ssm-web/courseContent/findCourseByCourseId?courseId=15
  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "id": 19,
        "courseName": "全栈工程师",
    }
}

4.8 新建&修改章节信息

字段说明类型是否必需备注
id 章节ID int 添加操作不携带id, 修改操作必须携带ID
course_id 课程ID int  
section_name 章节名称 String  
description 章节描述 String  
order_num 章节排序 int  
  • 请求参数示例

//新增
{
    "courseId":8,
    "sectionName":"Vue脚手架",
    "description":"快速搭建Vue项目",
    "orderNum":2
}
​
//修改
{
    "id":13,
    "sectionName":"Vue路由",
    "description":"单页面应用导航",
    "orderNum":0
}
  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": null
}

4.9 修改章节状态

字段说明类型是否必需备注
id 章节ID int  
status 章节状态 int 状态,0:隐藏;1:待更新;2:已发布
  • 请求示例

http://localhost:8080/ssm-web/courseContent/updateSectionStatus?id=7&status=1
  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "status": 1
    }
}

4.10 新建或修改课时信息

字段说明类型是否必需备注
id 课时ID int 添加操作不携带id, 修改操作必须携带ID
courseId 课程ID int  
sectionId 章节ID int  
theme 课时名称 String  
duration 课时时长(分钟) int  
isFree 是否免费,0 免费,1 付费 int  
orderNum 排序字段 int  
  • 请求示例

//新建
{
    "courseId":7,
    "sectionId":7,
    "theme":"文案高手养成",
    "duration":15,
    "isFree":0,
    "orderNum":2
}
  • 响应结果示例
    {
        "success": true,
        "state": 200,
        "message": "响应成功",
        "content": null
    }

5.广告模块

5.1 广告位列表查询

参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  

 

  • 响应示例:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": [{
        "id": 1,
        "name": "首页顶部推荐位",
        "spaceKey": "666",
        "createTime": 1594703011000,
        "updateTime": 1594962801000,
        "isDel": 0
    },
    {
        "id": 2,
        "name": "首页侧边广告位",
        "spaceKey": "888",
        "createTime": 1594703011000,
        "updateTime": 1594957982000,
        "isDel": 0
    }......
}

5.2 添加&修改广告位

参数名称参数说明in是否必须数据类型备注
id 广告位ID     修改必须携带ID
name 广告位名称      
  • 请求示例
// 新增
{
    "name": "页面头部广告位"
}
// 更新
{
    "id":173,
    "name": "页面头部广告位"
}
  • 响应参数:
参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  
  • 响应示例:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": null
}

5.3 回显广告位名称

参数名称参数说明in是否必须数据类型备注
id 广告位ID     修改必须携带ID
  • 响应结果:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "id": 1,
        "name": "首页顶部推荐位",
        "spaceKey": null,
        "createTime": null,
        "updateTime": null,
        "isDel": null
    }
}

5.4 广告分页查询

参数名称参数说明in是否必须数据类型schema
currentPage 当前页   false integer(int32)  
pageSize 每页显示条数   false integer(int32)  
  • 请求示例: http://localhost:8080/ssm-web/PromotionAd/findAllPromotionAdByPage?currentPage=1&pageSize=5
  • 响应结果示例:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "pageNum": 1,
        "pageSize": 5,
        "size": 5,
        "orderBy": null,
        "startRow": 1,
        "endRow": 5,
        "total": 17,
        "pages": 4,
        "list": [{
            "id": 1074,
            "name": "java高级训练营",
            "spaceId": 1,
            "keyword": null,
            "htmlContent": null,
            "text": "Java高级训练营 Java高级训练营 Java高级训练营",
            "link": "https://localhost:8080/upload",
            "startTime": 1597634487000,
            "endTime": 1597741425000,
            "status": 0,
            "createTime": 1594708114000,
            "updateTime": 1597636191000,
            "priority": 0,
            "img": "http://localhost:8080/upload/1597634499619.jpg"
        }......
}

5.5 图片上传接口

参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  
  • 响应结果示例:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "fileName": "1597730889723.jpg",
        "filePath": "http://localhost:8080/upload/1597730889723.jpg"
    }
}

2.6 新建&修改广告接口

字段说明类型是否必需备注
id 广告id int 添加操作不用携带, 修改操作必须携带ID
name 广告名称 String  
spaceId 广告位置 String  
startTime 开始时间 Date  
endTime 到期时间 Date  
status 上线/下线 int  
img 广告图片 String  
link 广告链接 String  
text 广告备注 String  
priority 优先级 int  
  • 请求示例:
//新增
{
    name: "Python高级训练营",
    img: "http://localhost:8080/upload/1597731135966.jpg",
    link: "www.xxxx.com",
    priority: 0,
    spaceId: 1,
    startTime: "2020-08-18T06:12:08.000Z",
    endTime: "2020-08-19T16:00:00.000Z",
    status: 1,
    text: "大家一起学Python"
}

//修改
{
    id: 1091,
    img: "http://localhost:8080/upload/1597731135966.jpg",
    link: "www.xxxx.com",
    name: "Python高级训练营01",
    status: 1,
    spaceId: 2,
    startTime: 1597731128000,
    endTime: 1597852800000,
    text: "大家一起学Python1111" 
}

5.7 修改回显广告信息接口

参数名称参数说明in是否必须数据类型schema
id 广告id   true int  
  • 请求示例:http://10.1.194.181:8080/ssm-web/PromotionAd/findPromotionAdById?id=1091
  • 响应结果示例
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "id": 1091,
        "name": "Python高级训练营",
        "spaceId": 1,
        "keyword": null,
        "htmlContent": null,
        "text": "大家一起学Python",
        "link": "www.xxxx.com",
        "startTime": 1597731128000,
        "endTime": 1597852800000,
        "status": 1,
        "createTime": null,
        "updateTime": null,
        "priority": null,
        "img": "http://localhost:8080/upload/1597731135966.jpg"
    }
}

5.8 广告状态上下线

参数名称参数说明in是否必须数据类型schema
id 广告id   true int  
status 课程状态   true int  
  • 请求参数示例:http://localhost:8080/ssm-web/PromotionAd/updatePromotionAdStatus?id=1074&status=1
  • 响应示例:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "status": 1
    }
}

6.用户模块

6.1 用户分页&条件查询

参数名称参数说明in是否必须数据类型备注
currentPage 当前页   false integer(int32)  
pageSize 每页显示条数   false integer(int32)  
username 用户名   false String 输入手机号即可
startCreateTime 注册起始时间   false Date  
endCreateTime 注册结束时间   false Date  
  • 请求参数示例:
{
    "currentPage": "1",
    "pageSize": "10",
    "endCreateTime": "2020-07-13",
    "startCreateTime": "2020-07-09",
    "username": "15321919577"
}

6.2 用户状态设置

参数名称参数说明in是否必须数据类型备注
id 用户id   integer(int32)  
status 用户状态   String 用户状态:ENABLE能登录,DISABLE不能登录
  • 请求参数示例:http://10.1.194.181:8080/ssm-web/user/updateUserStatus?id=100030011&status=ENABLE
  • 响应参数示例:
{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": "DISABLE"
}

7.权限模块

7.1 角色模块

7.1.1 角色列表查询&条件查询

  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": [{
        "id": 1,
        "code": "ADMIN",
        "name": "超级管理员",
        "description": "后台管理员,初始拥有权限管理功能",
        "createdTime": 1595230889000,
        "updatedTime": 1595230889000,
        "createdBy": "system",
        "updatedBy": "system"
    }
    ......
}

7.1.2 添加&修改角色

参数名称参数说明in是否必须数据类型备注
id 角色ID   false int 修改操作携带ID
name 角色名称   true String  
code 角色编码   true String  
description 角色描述   true String  
  • 请求参数示例

// 添加
{
    "name":"资源管理员",
    "code": "RE_MANAGER",
    "description": "管理资源"
}
​
// 更新
{
    "id":"6"
    "name":"资源管理员",
    "code": "RE_MANAGER",
    "description": "管理资源"
}
  • 响应参数:

参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  
  • 响应示例:

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": ""
}

7.1.3 分配菜单

接口1 查询所有菜单列表
  • 响应结果示例:content内容为 前端所需的JSON格式菜单数据, 方便在树形空间中展示

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "parentMenuList": [{
            "id": 1,
            "parentId": -1,
            "href": "",
            "icon": "lock",
            "name": "权限管理",
            "description": "管理系统角色、菜单、资源",
            "orderNum": 1,
            "shown": 1,
            "level": 0,
            "createdTime": 1595230898000,
            "updatedTime": 1595230898000,
            "createdBy": "system",
            "updatedBy": "system",
            "subMenuList": [{
                "id": 2,
                "parentId": 1,
                "href": "Role",
                "icon": "lock",
                "name": "角色列表",
                "description": "管理系统角色",
                "orderNum": 1,
                "shown": 1,
                "level": 1,
                "createdTime": 1595230898000,
                "updatedTime": 1595230898000,
                "createdBy": "system",
                "updatedBy": "system",
                "subMenuList": []
            }]
}]
接口2 根据角色ID查询关联菜单ID
  • 响应结果示例content中的内容为: 当前角色关联的菜单ID

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": ["1","2","3","4","10"]
}
接口3 为角色分配菜单列表
参数名称参数说明是否必须数据类型备注
roleId 角色id true int  
menuIdList 所选的菜单列表id true List  
  • 请求参数示例:

{
    "roleId": 4, 
    "menuIdList": [7, 8, 9, 15, 16, 17, 18]
}
  • 响应参数示例:

{"success":true,"state":200,"message":"响应成功","content":""}

7.1.4 删除角色

  • 响应示例:

{"success":true,"state":200,"message":"响应成功","content":""}

7.2 菜单模块

7.2.1 菜单列表查询

  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "pageNum": 1,
        "pageSize": 10,
        "size": 10,
        "orderBy": null,
        "startRow": 1,
        "endRow": 10,
        "total": 26,
        "pages": 3,
        "list": [{
            "id": 1,
            "parentId": -1,
            "href": "",
            "icon": "lock",
            "name": "权限管理",
            "description": "管理系统角色、菜单、资源",
            "orderNum": 1,
            "shown": 1,
            "level": 0,
            "createdTime": 1595230898000,
            "updatedTime": 1595230898000,
            "createdBy": "system",
            "updatedBy": "system",
            "subMenuList": []
        },
        {
            "id": 2,
            "parentId": 1,
            "href": "Role",
            "icon": "lock",
            "name": "角色列表",
            "description": "管理系统角色",
            "orderNum": 1,
            "shown": 1,
            "level": 1,
            "createdTime": 1595230898000,
            "updatedTime": 1595230898000,
            "createdBy": "system",
            "updatedBy": "system",
            "subMenuList": []
        }......]
    }
}

4.2.2 查询菜单信息(回显)

参数名称参数说明in是否必须数据类型备注
id 菜单id   true int 如果是新增菜单,则id值为 -1, 修改菜单 则为当前选择的id值
  • 响应结果

参数名称参数说明类型备注
success   boolean  
state   integer(int32)  
message   string  
content   object  
menuInfo 菜单信息 Menu 修改操作需要回显的菜单信息
parentMenuList 菜单列表信息 List<Menu 所有的父子菜单列表信息
  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "menuInfo": {
            "id": 7,
            "parentId": -1,
            "href": "",
            "icon": "setting",
            "name": "广告管理",
            "description": "广告、广告位管理",
            "orderNum": 4,
            "shown": 1,
            "level": 0,
            "createdTime": 1595230898000,
            "updatedTime": 1595230898000,
            "createdBy": "system",
            "updatedBy": "system",
            "subMenuList": []
        },
        "parentMenuList": [
            {
                "id": 1,
                "parentId": -1,
                "href": "",
                "icon": "lock",
                "name": "权限管理",
                "description": "管理系统角色、菜单、资源",
                "orderNum": 1,
                "shown": 1,
                "level": 0,
                "createdTime": 1595230898000,
                "updatedTime": 1595230898000,
                "createdBy": "system",
                "updatedBy": "system",
                "subMenuList": [
                    {
                        "id": 2,
                        "parentId": 1,
                        "href": "Role",
                        "icon": "lock",
                        "name": "角色列表",
                        "description": "管理系统角色",
                        "orderNum": 1,
                        "shown": 1,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 3,
                        "parentId": 1,
                        "href": "Menu",
                        "icon": "lock",
                        "name": "菜单列表",
                        "description": "管理系统菜单",
                        "orderNum": 2,
                        "shown": 1,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 4,
                        "parentId": 1,
                        "href": "Resource",
                        "icon": "lock",
                        "name": "资源列表",
                        "description": "管理系统资源",
                        "orderNum": 3,
                        "shown": 1,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 10,
                        "parentId": 1,
                        "href": "AllocMenu",
                        "icon": "setting",
                        "name": "给角色分配菜单页面",
                        "description": "给角色分配菜单页面路由",
                        "orderNum": 4,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 11,
                        "parentId": 1,
                        "href": "AllocResource",
                        "icon": "setting",
                        "name": "给角色分配资源页面",
                        "description": "给角色分配资源页面路由",
                        "orderNum": 5,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 12,
                        "parentId": 1,
                        "href": "AddMenu",
                        "icon": "setting",
                        "name": "添加菜单页面",
                        "description": "添加菜单页路由",
                        "orderNum": 6,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 13,
                        "parentId": 1,
                        "href": "UpdateMenu",
                        "icon": "setting",
                        "name": "更新菜单页面",
                        "description": "更新菜单页路由",
                        "orderNum": 7,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 14,
                        "parentId": 1,
                        "href": "ResourceCategory",
                        "icon": "setting",
                        "name": "资源分类列表页面",
                        "description": "资源分类列表页面路由",
                        "orderNum": 8,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    }
                ]
            },
            {
                "id": 5,
                "parentId": -1,
                "href": "Courses",
                "icon": "film",
                "name": "课程管理",
                "description": "课程的新增、修改、查看、发布、上下架",
                "orderNum": 2,
                "shown": 1,
                "level": 0,
                "createdTime": 1595230898000,
                "updatedTime": 1595230898000,
                "createdBy": "system",
                "updatedBy": "system",
                "subMenuList": [
                    {
                        "id": 19,
                        "parentId": 5,
                        "href": "CourseItem",
                        "icon": "setting",
                        "name": "课程详情页面",
                        "description": "课程详情页面路由",
                        "orderNum": 1,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 20,
                        "parentId": 5,
                        "href": "CourseSections",
                        "icon": "setting",
                        "name": "课时信息页面",
                        "description": "课时信息页面路由",
                        "orderNum": 2,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 21,
                        "parentId": 5,
                        "href": "VideoOptions",
                        "icon": "setting",
                        "name": "课时上传视频",
                        "description": "课时上传视频页面路由",
                        "orderNum": 3,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    }
                ]
            },
            {
                "id": 6,
                "parentId": -1,
                "href": "Users",
                "icon": "user",
                "name": "用户管理",
                "description": "用户的查询、禁用、启用",
                "orderNum": 3,
                "shown": 1,
                "level": 0,
                "createdTime": 1595230898000,
                "updatedTime": 1595230898000,
                "createdBy": "system",
                "updatedBy": "system",
                "subMenuList": []
            },
            {
                "id": 7,
                "parentId": -1,
                "href": "",
                "icon": "setting",
                "name": "广告管理",
                "description": "广告、广告位管理",
                "orderNum": 4,
                "shown": 1,
                "level": 0,
                "createdTime": 1595230898000,
                "updatedTime": 1595230898000,
                "createdBy": "system",
                "updatedBy": "system",
                "subMenuList": [
                    {
                        "id": 8,
                        "parentId": 7,
                        "href": "Advertise",
                        "icon": "setting",
                        "name": "广告列表",
                        "description": "广告管理",
                        "orderNum": 1,
                        "shown": 1,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 9,
                        "parentId": 7,
                        "href": "AdvertiseSpace",
                        "icon": "setting",
                        "name": "广告位列表",
                        "description": "广告位管理",
                        "orderNum": 2,
                        "shown": 1,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 15,
                        "parentId": 7,
                        "href": "AddAdvertise",
                        "icon": "setting",
                        "name": "添加广告页面",
                        "description": "添加广告页面路由",
                        "orderNum": 3,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 16,
                        "parentId": 7,
                        "href": "UpdateAdvertise",
                        "icon": "setting",
                        "name": "编辑广告页面",
                        "description": "编辑广告页面路由",
                        "orderNum": 4,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 17,
                        "parentId": 7,
                        "href": "AddAdvertiseSpace",
                        "icon": "setting",
                        "name": "添加广告位页面",
                        "description": "添加广告位页面路由",
                        "orderNum": 5,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    },
                    {
                        "id": 18,
                        "parentId": 7,
                        "href": "UpdateAdvertiseSpace",
                        "icon": "setting",
                        "name": "更新广告位页面",
                        "description": "更新广告位页面路由",
                        "orderNum": 6,
                        "shown": 0,
                        "level": 1,
                        "createdTime": 1595230898000,
                        "updatedTime": 1595230898000,
                        "createdBy": "system",
                        "updatedBy": "system",
                        "subMenuList": []
                    }
                ]
            }
        ]
    }
}

4.2.3 添加&修改菜单

参数名称参数说明是否必须数据类型备注
id 菜单列表id int 修改操作必须携带id,插入不需要携带
name 菜单名称 string  
href 菜单路径 string  
parentId 父菜单id int  
description 描述 string  
icon 菜单图标 string  
shown 是否展示 int  
orderNum 排序号 int  
level 菜单层级,从0开始 int  
createdTime 创建时间 date  
updatedTime 更新时间 date  
createdBy 创建人 string  
updatedBy 更新人 string  
  • 请求示例

//新增
{
    "description": "设置课程状态",
    "href": "updateStatus",
    "icon": "lock",
    "name": "课程管理状态",
    "orderNum": 3,
    "parentId": 5,
    "shown": 0,
    "level":0,
    "createdTime":"2020-08-10 20:32:41",
    "updatedTime":"2020-08-10 20:32:41",
    "createdBy":"system",
    "updatedBy":"system"
}
​
//修改
{
    "id":23,
    "description": "设置课程状态修改",
    "href": "updateStatus修改",
    "icon": "lock",
    "name": "课程管理状态修改",
    "orderNum": 3,
    "parentId": 5,
    "shown": 1,
    "level":1,
    "createdTime":"2020-08-10 20:32:41",
    "updatedTime":"2020-08-10 20:32:41",
    "createdBy":"system",
    "updatedBy":"system"
}

7.3 资源模块

7.3.1 查询资源分类信息

  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": [
        {
            "id": 1,
            "code": "ADMIN",
            "name": "超级管理员",
            "description": "后台管理员,初始拥有权限管理功能",
            "createdTime": 1595230889000,
            "updatedTime": 1595230889000,
            "createdBy": "system",
            "updatedBy": "system"
        },
        {
            "id": 2,
            "code": "AUTHORITY_MANAGER",
            "name": "权限管理员",
            "description": "管理权限相关数据,如角色、菜单、资源。可以给用户分配角色。",
            "createdTime": 1595202475000,
            "updatedTime": 1595202475000,
            "createdBy": "15510792994",
            "updatedBy": "15510792994"
        },
        {
            "id": 3,
            "code": "COURSE_MANAGER",
            "name": "课程管理员",
            "description": "管理课程信息,对课程、课时、章节进行管理。",
            "createdTime": 1595202724000,
            "updatedTime": 1595202724000,
            "createdBy": "15510792994",
            "updatedBy": "15510792994"
        },
        {
            "id": 4,
            "code": "AD_MANAGER",
            "name": "广告管理员",
            "description": "管理广告、广告位信息",
            "createdTime": 1595202956000,
            "updatedTime": 1595202956000,
            "createdBy": "15510792994",
            "updatedBy": "15510792994"
        }
    ]
}

7.3.2 资源信息分页&条件查询

参数名称参数说明类型备注
currentPage 当前页 int  
pageSize 每页显示条数 int  
name 资源名称 string  
categoryId 资源分类id int  
url 资源路径 string  
  • 请求参数示例

{
    categoryId: 1,
    currentPage: 1,
    name: "获取所有角色",
    pageSize: 5,
    url: "/boss/role/all"
}
  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "响应成功",
    "content": {
        "pageNum": 1,
        "pageSize": 5,
        "size": 1,
        "orderBy": null,
        "startRow": 1,
        "endRow": 1,
        "total": 1,
        "pages": 1,
        "list": [{
            "id": 1,
            "name": "获取所有角色",
            "url": "/boss/role/all",
            "categoryId": 1,
            "description": "获取所有角色",
            "createdTime": 1595230917000,
            "updatedTime": 1595230917000,
            "createdBy": "system",
            "updatedBy": "system"
        }]
    }
}

7.3.3 添加&更新资源信息

参数名称参数说明in是否必须数据类型备注
id 资源id   false   修改操作需要携带ID
name 资源名称   true String  
url 资源路径   true String  
categoryId 所属资源分类   true Integer  
description 资源描述   true String  
  • 请求示例:
// 添加
{
    "name":"获取所有角色2",
    "url": "/boss/role/all",
    "categoryId":"1",
    "description":"获取所有角色1"
}
​
// 更新
{
    "id":"53",
    "name":"获取所有角色2",
    "url": "/boss/role/all",
    "categoryId":"1",
    "description":"获取所有角色1"
​
}
  • 响应参数:
参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  

7.3.4 删除资源信息

参数名称参数说明类型schema
success   boolean  
state   integer(int32) integer(int32)
message   string  
content   object  

8.登录授权

8.1 用户登录

  • 响应结果示例

{
    state: 1,
    message: "success",
    content: '{
        "access_token": "",
        "user_id": "100030016"
    }',
    success: true
}

8.2 分配角色(回显)

  • 响应结果

参数名称参数说明类型备注
success   boolean  
state   integer(int32)  
message   string  
content   object  
  • 响应结果示例

{
    "success": true,
    "state": 200,
    "message": "分配角色成功",
    "content": [{
        "id": 2,
        "code": "AUTHORITY_MANAGER",
        "name": "权限管理员",
        "description": "管理权限相关数据,如角色、菜单、资源。可以给用户分配角色。",
        "createdTime": null,
        "updatedTime": null,
        "createdBy": null,
        "updatedBy": null
    },
    {
        "id": 3,
        "code": "COURSE_MANAGER",
        "name": "课程管理员",
        "description": "管理课程信息,对课程、课时、章节进行管理。",
        "createdTime": null,
        "updatedTime": null,
        "createdBy": null,
        "updatedBy": null
    }]
}

5.3 分配角色

{
    "userId": 4, 
    "roleIdList": [4,5,6]
}
  • 响应结果

参数名称参数说明类型备注
success   boolean  
state   integer(int32)  
message   string  
content   object  

8.4 获取用户拥有的权限

参数名称参数说明类型备注
success   boolean  
state   integer(int32)  
message   string  
content   object  
  • 响应结果示例

{
    "state": 1,
    "message": "success",
    "content": {
        "menuList": [{
            "id": 1,
            "parentId": -1,
            "name": "权限管理",
            "subMenuList": [{
                "id": 2,
                "name": "角色列表"
            },
            {
                "id": 3,
                "name": "菜单列表",
                
            }]
        }],
        "resourceList": [{
            "id": 1,
            "name": "获取所有角色"
        },
        {
            "id": 2,
            "name": "给用户分配角色",
            
        }]
    },
    "success": true
}
posted @ 2021-07-19 20:17  forever_fate  阅读(414)  评论(0)    收藏  举报