Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
1532635456
gin-vue-admin
提交
72b5d60b
G
gin-vue-admin
项目概览
1532635456
/
gin-vue-admin
落后 Fork 源项目 1212 个版本
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
72b5d60b
编写于
12月 13, 2019
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
initrouter增加group壳子 方便统一添加前缀 多服务部署使用 添加前缀过后 请统一处理api数据库
上级
fc069383
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
33 addition
and
38 deletion
+33
-38
QMPlusServer/init/initRouter/init_router.go
QMPlusServer/init/initRouter/init_router.go
+9
-8
QMPlusServer/router/exp_fileUploadAndDownload.go
QMPlusServer/router/exp_fileUploadAndDownload.go
+1
-2
QMPlusServer/router/sys_api.go
QMPlusServer/router/sys_api.go
+7
-8
QMPlusServer/router/sys_authority.go
QMPlusServer/router/sys_authority.go
+4
-5
QMPlusServer/router/sys_base.go
QMPlusServer/router/sys_base.go
+1
-1
QMPlusServer/router/sys_casbin.go
QMPlusServer/router/sys_casbin.go
+1
-3
QMPlusServer/router/sys_menu.go
QMPlusServer/router/sys_menu.go
+8
-8
QMPlusServer/router/sys_user.go
QMPlusServer/router/sys_user.go
+1
-1
QMPlusServer/router/sys_workflow.go
QMPlusServer/router/sys_workflow.go
+1
-2
未找到文件。
QMPlusServer/init/initRouter/init_router.go
浏览文件 @
72b5d60b
...
...
@@ -15,14 +15,15 @@ func InitRouter() *gin.Engine {
//Router.Use(middleware.LoadTls()) // 打开就能玩https了
Router
.
Use
(
middleware
.
Logger
())
// 如果不需要日志 请关闭这里
Router
.
GET
(
"/swagger/*any"
,
ginSwagger
.
WrapHandler
(
swaggerFiles
.
Handler
))
ApiGroup
:=
Router
.
Group
(
""
)
// 方便统一添加路由组前缀 多服务器上线使用
//Router.Use(middleware.Logger())
router
.
InitUserRouter
(
Router
)
// 注册用户路由
router
.
InitBaseRouter
(
Router
)
// 注册基础功能路由 不做鉴权
router
.
InitMenuRouter
(
Router
)
// 注册menu路由
router
.
InitAuthorityRouter
(
Router
)
// 注册角色路由
router
.
InitApiRouter
(
Router
)
// 注册功能api路由
router
.
InitFileUploadAndDownloadRouter
(
Router
)
// 文件上传下载功能路由
router
.
InitWorkflowRouter
(
Router
)
// 工作流相关路由
router
.
InitCasbinRouter
(
Router
)
router
.
InitUserRouter
(
ApiGroup
)
// 注册用户路由
router
.
InitBaseRouter
(
ApiGroup
)
// 注册基础功能路由 不做鉴权
router
.
InitMenuRouter
(
ApiGroup
)
// 注册menu路由
router
.
InitAuthorityRouter
(
ApiGroup
)
// 注册角色路由
router
.
InitApiRouter
(
ApiGroup
)
// 注册功能api路由
router
.
InitFileUploadAndDownloadRouter
(
ApiGroup
)
// 文件上传下载功能路由
router
.
InitWorkflowRouter
(
ApiGroup
)
// 工作流相关路由
router
.
InitCasbinRouter
(
ApiGroup
)
return
Router
}
QMPlusServer/router/exp_fileUploadAndDownload.go
浏览文件 @
72b5d60b
...
...
@@ -6,7 +6,7 @@ import (
"main/middleware"
)
func
InitFileUploadAndDownloadRouter
(
Router
*
gin
.
Engine
)(
R
gin
.
IRoutes
)
{
func
InitFileUploadAndDownloadRouter
(
Router
*
gin
.
RouterGroup
)
{
FileUploadAndDownloadGroup
:=
Router
.
Group
(
"fileUploadAndDownload"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
//.Use(middleware.JWTAuth())
{
...
...
@@ -14,5 +14,4 @@ func InitFileUploadAndDownloadRouter(Router *gin.Engine)(R gin.IRoutes) {
FileUploadAndDownloadGroup
.
POST
(
"/getFileList"
,
api
.
GetFileList
)
// 获取上传文件列表
FileUploadAndDownloadGroup
.
POST
(
"/deleteFile"
,
api
.
DeleteFile
)
// 删除指定文件
}
return
FileUploadAndDownloadGroup
}
QMPlusServer/router/sys_api.go
浏览文件 @
72b5d60b
...
...
@@ -6,15 +6,14 @@ import (
"main/middleware"
)
func
InitApiRouter
(
Router
*
gin
.
Engine
)(
R
gin
.
IRoutes
)
{
func
InitApiRouter
(
Router
*
gin
.
RouterGroup
)
{
ApiRouter
:=
Router
.
Group
(
"api"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
{
ApiRouter
.
POST
(
"createApi"
,
api
.
CreateApi
)
//创建Api
ApiRouter
.
POST
(
"deleteApi"
,
api
.
DeleteApi
)
//删除Api
ApiRouter
.
POST
(
"getApiList"
,
api
.
GetApiList
)
//获取Api列表
ApiRouter
.
POST
(
"getApiById"
,
api
.
GetApiById
)
//获取单条Api消息
ApiRouter
.
POST
(
"updataApi"
,
api
.
UpdataApi
)
//更新api
ApiRouter
.
POST
(
"getAllApis"
,
api
.
GetAllApis
)
// 获取所有api
ApiRouter
.
POST
(
"createApi"
,
api
.
CreateApi
)
//创建Api
ApiRouter
.
POST
(
"deleteApi"
,
api
.
DeleteApi
)
//删除Api
ApiRouter
.
POST
(
"getApiList"
,
api
.
GetApiList
)
//获取Api列表
ApiRouter
.
POST
(
"getApiById"
,
api
.
GetApiById
)
//获取单条Api消息
ApiRouter
.
POST
(
"updataApi"
,
api
.
UpdataApi
)
//更新api
ApiRouter
.
POST
(
"getAllApis"
,
api
.
GetAllApis
)
// 获取所有api
}
return
ApiRouter
}
QMPlusServer/router/sys_authority.go
浏览文件 @
72b5d60b
...
...
@@ -6,12 +6,11 @@ import (
"main/middleware"
)
func
InitAuthorityRouter
(
Router
*
gin
.
Engine
)(
R
gin
.
IRoutes
)
{
func
InitAuthorityRouter
(
Router
*
gin
.
RouterGroup
)
{
AuthorityRouter
:=
Router
.
Group
(
"authority"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
{
AuthorityRouter
.
POST
(
"createAuthority"
,
api
.
CreateAuthority
)
//创建角色
AuthorityRouter
.
POST
(
"deleteAuthority"
,
api
.
DeleteAuthority
)
//删除角色
AuthorityRouter
.
POST
(
"getAuthorityList"
,
api
.
GetAuthorityList
)
//获取角色列表
AuthorityRouter
.
POST
(
"createAuthority"
,
api
.
CreateAuthority
)
//创建角色
AuthorityRouter
.
POST
(
"deleteAuthority"
,
api
.
DeleteAuthority
)
//删除角色
AuthorityRouter
.
POST
(
"getAuthorityList"
,
api
.
GetAuthorityList
)
//获取角色列表
}
return
AuthorityRouter
}
QMPlusServer/router/sys_base.go
浏览文件 @
72b5d60b
...
...
@@ -5,7 +5,7 @@ import (
"main/controller/api"
)
func
InitBaseRouter
(
Router
*
gin
.
Engine
)
(
R
gin
.
IRoutes
)
{
func
InitBaseRouter
(
Router
*
gin
.
RouterGroup
)
(
R
gin
.
IRoutes
)
{
BaseRouter
:=
Router
.
Group
(
"base"
)
{
BaseRouter
.
POST
(
"regist"
,
api
.
Regist
)
...
...
QMPlusServer/router/sys_casbin.go
浏览文件 @
72b5d60b
...
...
@@ -6,13 +6,11 @@ import (
"main/middleware"
)
func
InitCasbinRouter
(
Router
*
gin
.
Engine
)(
R
gin
.
IRoutes
)
{
func
InitCasbinRouter
(
Router
*
gin
.
RouterGroup
)
{
BaseRouter
:=
Router
.
Group
(
"casbin"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
{
BaseRouter
.
POST
(
"casbinPUpdata"
,
api
.
CasbinPUpdata
)
BaseRouter
.
POST
(
"getPolicyPathByAuthorityId"
,
api
.
GetPolicyPathByAuthorityId
)
}
return
BaseRouter
}
QMPlusServer/router/sys_menu.go
浏览文件 @
72b5d60b
...
...
@@ -6,18 +6,18 @@ import (
"main/middleware"
)
func
InitMenuRouter
(
Router
*
gin
.
Engine
)(
R
gin
.
IRoutes
)
{
func
InitMenuRouter
(
Router
*
gin
.
RouterGroup
)
(
R
gin
.
IRoutes
)
{
MenuRouter
:=
Router
.
Group
(
"menu"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
{
MenuRouter
.
POST
(
"getMenu"
,
api
.
GetMenu
)
//获取菜单树
MenuRouter
.
POST
(
"getMenuList"
,
api
.
GetMenuList
)
// 分页获取基础menu列表
MenuRouter
.
POST
(
"addBaseMenu"
,
api
.
AddBaseMenu
)
// 新增菜单
MenuRouter
.
POST
(
"getBaseMenuTree"
,
api
.
GetBaseMenuTree
)
// 获取用户动态路由
MenuRouter
.
POST
(
"getMenu"
,
api
.
GetMenu
)
//获取菜单树
MenuRouter
.
POST
(
"getMenuList"
,
api
.
GetMenuList
)
// 分页获取基础menu列表
MenuRouter
.
POST
(
"addBaseMenu"
,
api
.
AddBaseMenu
)
// 新增菜单
MenuRouter
.
POST
(
"getBaseMenuTree"
,
api
.
GetBaseMenuTree
)
// 获取用户动态路由
MenuRouter
.
POST
(
"addMenuAuthority"
,
api
.
AddMenuAuthority
)
// 增加menu和角色关联关系
MenuRouter
.
POST
(
"getMenuAuthority"
,
api
.
GetMenuAuthority
)
// 获取指定角色menu
MenuRouter
.
POST
(
"deleteBaseMenu"
,
api
.
DeleteBaseMenu
)
// 删除菜单
MenuRouter
.
POST
(
"updataBaseMenu"
,
api
.
UpdataBaseMenu
)
// 更新菜单
MenuRouter
.
POST
(
"getBaseMenuById"
,
api
.
GetBaseMenuById
)
//根据id获取菜单
MenuRouter
.
POST
(
"deleteBaseMenu"
,
api
.
DeleteBaseMenu
)
// 删除菜单
MenuRouter
.
POST
(
"updataBaseMenu"
,
api
.
UpdataBaseMenu
)
// 更新菜单
MenuRouter
.
POST
(
"getBaseMenuById"
,
api
.
GetBaseMenuById
)
//根据id获取菜单
}
return
MenuRouter
}
QMPlusServer/router/sys_user.go
浏览文件 @
72b5d60b
...
...
@@ -6,7 +6,7 @@ import (
"main/middleware"
)
func
InitUserRouter
(
Router
*
gin
.
Engine
)
{
func
InitUserRouter
(
Router
*
gin
.
RouterGroup
)
{
UserRouter
:=
Router
.
Group
(
"user"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
{
UserRouter
.
POST
(
"changePassword"
,
api
.
ChangePassword
)
// 修改密码
...
...
QMPlusServer/router/sys_workflow.go
浏览文件 @
72b5d60b
...
...
@@ -6,10 +6,9 @@ import (
"main/middleware"
)
func
InitWorkflowRouter
(
Router
*
gin
.
Engine
)(
R
gin
.
IRoutes
)
{
func
InitWorkflowRouter
(
Router
*
gin
.
RouterGroup
)
{
WorkflowRouter
:=
Router
.
Group
(
"workflow"
)
.
Use
(
middleware
.
JWTAuth
())
.
Use
(
middleware
.
CasbinHandler
())
{
WorkflowRouter
.
POST
(
"createWorkFlow"
,
api
.
CreateWorkFlow
)
// 创建工作流
}
return
WorkflowRouter
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录