klausY 5 years ago
parent
commit
85b7e5bed9
  1. 2
      QMPlusServer/docs/docs.go
  2. 17
      QMPlusServer/init/initRouter/init_router.go
  3. 3
      QMPlusServer/router/exp_fileUploadAndDownload.go
  4. 15
      QMPlusServer/router/sys_api.go
  5. 9
      QMPlusServer/router/sys_authority.go
  6. 2
      QMPlusServer/router/sys_base.go
  7. 4
      QMPlusServer/router/sys_casbin.go
  8. 16
      QMPlusServer/router/sys_menu.go
  9. 2
      QMPlusServer/router/sys_user.go
  10. 3
      QMPlusServer/router/sys_workflow.go
  11. 2
      QMPlusServer/static/dbconfig/config.json
  12. 5
      README.md

2
QMPlusServer/docs/docs.go

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-12-13 14:26:18.8216929 +0800 CST m=+0.080748501
// 2019-12-13 14:31:12.9298434 +0800 CST m=+0.056881601
package docs

17
QMPlusServer/init/initRouter/init_router.go

@ -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
}

3
QMPlusServer/router/exp_fileUploadAndDownload.go

@ -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
}

15
QMPlusServer/router/sys_api.go

@ -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
}

9
QMPlusServer/router/sys_authority.go

@ -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
}

2
QMPlusServer/router/sys_base.go

@ -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)

4
QMPlusServer/router/sys_casbin.go

@ -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
}

16
QMPlusServer/router/sys_menu.go

@ -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
}

2
QMPlusServer/router/sys_user.go

@ -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) // 修改密码

3
QMPlusServer/router/sys_workflow.go

@ -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
}

2
QMPlusServer/static/dbconfig/config.json

@ -3,7 +3,7 @@
"username": "root",
"password": "Aa@6447985",
"path": "127.0.0.1:3306",
"dbname": "yx",
"dbname": "qmplus",
"config": "charset=utf8&parseTime=True&loc=Local"
}
}

5
README.md

@ -27,6 +27,9 @@
各位在clone项目以后,把db文件导入自己创建的库后,最好前往七牛云申请自己的空间地址,
替换掉项目中的七牛云公钥,私钥,仓名和默认url地址,以免发生测试文件数据错乱
## 测试环境地址
http://qmplus.henrongyi.top/
## 环境搭建教学视频
腾讯视频:https://v.qq.com/x/page/e3008xjxqtu.html
@ -124,4 +127,4 @@ swag init
<div align=center>
<h3>qq交流群:622360840</h3>
<h3>微信交流群可以添加任意一位开发者备注"加入gin-vue-admin交流群"</h3>
</div>
</div>
Loading…
Cancel
Save