【更新】更新

This commit is contained in:
PandaGoAdmin
2022-08-02 17:19:14 +08:00
parent 791a23306c
commit 0555922a90
50 changed files with 678 additions and 450 deletions

View File

@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitApiRouter(router *gin.RouterGroup) {
@@ -13,38 +13,31 @@ func InitApiRouter(router *gin.RouterGroup) {
}
api := router.Group("api")
apiListLog := ctx.NewLogInfo("获取api分页列表")
api.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(apiListLog).Handle(s.GetApiList)
ginx.NewReqCtx(c).WithLog("获取api分页列表").Handle(s.GetApiList)
})
apiListAllLog := ctx.NewLogInfo("获取所有api")
api.GET("all", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(apiListAllLog).Handle(s.GetAllApis)
ginx.NewReqCtx(c).WithLog("获取所有api").Handle(s.GetAllApis)
})
apiListByRoleLog := ctx.NewLogInfo("获取角色拥有的api权限")
api.GET("getPolicyPathByRoleId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(apiListByRoleLog).Handle(s.GetPolicyPathByRoleId)
ginx.NewReqCtx(c).WithLog("获取角色拥有的api权限").Handle(s.GetPolicyPathByRoleId)
})
apiLog := ctx.NewLogInfo("获取api信息")
api.GET(":id", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(apiLog).Handle(s.GetApiById)
ginx.NewReqCtx(c).WithLog("获取api信息").Handle(s.GetApiById)
})
insertApiLog := ctx.NewLogInfo("添加api信息")
api.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertApiLog).Handle(s.CreateApi)
ginx.NewReqCtx(c).WithLog("添加api信息").Handle(s.CreateApi)
})
updateApiLog := ctx.NewLogInfo("修改api信息")
api.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateApiLog).Handle(s.UpdateApi)
ginx.NewReqCtx(c).WithLog("修改api信息").Handle(s.UpdateApi)
})
deleteApiLog := ctx.NewLogInfo("删除api信息")
api.DELETE(":id", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteApiLog).Handle(s.DeleteApi)
ginx.NewReqCtx(c).WithLog("删除api信息").Handle(s.DeleteApi)
})
}

View File

@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitConfigRouter(router *gin.RouterGroup) {
@@ -13,33 +13,27 @@ func InitConfigRouter(router *gin.RouterGroup) {
}
config := router.Group("config")
configListLog := ctx.NewLogInfo("获取配置分页列表")
config.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(configListLog).Handle(s.GetConfigList)
ginx.NewReqCtx(c).WithLog("获取配置分页列表").Handle(s.GetConfigList)
})
configListByKeyLog := ctx.NewLogInfo("获取配置列表通过ConfigKey")
config.GET("configKey", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(configListByKeyLog).Handle(s.GetConfigListByKey)
ginx.NewReqCtx(c).WithLog("获取配置列表通过ConfigKey").Handle(s.GetConfigListByKey)
})
configLog := ctx.NewLogInfo("获取配置信息")
config.GET(":configId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(configLog).Handle(s.GetConfig)
ginx.NewReqCtx(c).WithLog("获取配置信息").Handle(s.GetConfig)
})
insertConfigLog := ctx.NewLogInfo("添加配置信息")
config.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertConfigLog).Handle(s.InsertConfig)
ginx.NewReqCtx(c).WithLog("添加配置信息").Handle(s.InsertConfig)
})
updateConfigLog := ctx.NewLogInfo("修改配置信息")
config.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateConfigLog).Handle(s.UpdateConfig)
ginx.NewReqCtx(c).WithLog("修改配置信息").Handle(s.UpdateConfig)
})
deleteConfigLog := ctx.NewLogInfo("删除配置信息")
config.DELETE(":configId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteConfigLog).Handle(s.DeleteConfig)
ginx.NewReqCtx(c).WithLog("删除配置信息").Handle(s.DeleteConfig)
})
}

View File

@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitDeptRouter(router *gin.RouterGroup) {
@@ -15,38 +15,31 @@ func InitDeptRouter(router *gin.RouterGroup) {
}
dept := router.Group("dept")
roleDeptTreSelectLog := ctx.NewLogInfo("获取角色部门树")
dept.GET("roleDeptTreeSelect/:roleId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(roleDeptTreSelectLog).Handle(r.GetDeptTreeRoleSelect)
ginx.NewReqCtx(c).WithLog("获取角色部门树").Handle(r.GetDeptTreeRoleSelect)
})
deptTreeLog := ctx.NewLogInfo("获取所有部门树")
dept.GET("deptTree", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deptTreeLog).Handle(r.GetDeptTree)
ginx.NewReqCtx(c).WithLog("获取所有部门树").Handle(r.GetDeptTree)
})
deptListLog := ctx.NewLogInfo("获取部门列表")
dept.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deptListLog).Handle(r.GetDeptList)
ginx.NewReqCtx(c).WithLog("获取部门列表").Handle(r.GetDeptList)
})
deptLog := ctx.NewLogInfo("获取部门信息")
dept.GET(":deptId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deptLog).Handle(r.GetDept)
ginx.NewReqCtx(c).WithLog("获取部门信息").Handle(r.GetDept)
})
inertDeptLog := ctx.NewLogInfo("添加部门信息")
dept.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(inertDeptLog).Handle(r.InsertDept)
ginx.NewReqCtx(c).WithLog("添加部门信息").Handle(r.InsertDept)
})
updateDeptLog := ctx.NewLogInfo("修改部门信息")
dept.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateDeptLog).Handle(r.UpdateDept)
ginx.NewReqCtx(c).WithLog("修改部门信息").Handle(r.UpdateDept)
})
deleteDeptLog := ctx.NewLogInfo("删除部门信息")
dept.DELETE(":deptId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteDeptLog).Handle(r.DeleteDept)
ginx.NewReqCtx(c).WithLog("删除部门信息").Handle(r.DeleteDept)
})
}

View File

@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitDictRouter(router *gin.RouterGroup) {
@@ -14,64 +14,52 @@ func InitDictRouter(router *gin.RouterGroup) {
}
dict := router.Group("dict")
typeList := ctx.NewLogInfo("获取字典类型分页列表")
dict.GET("type/list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(typeList).Handle(s.GetDictTypeList)
ginx.NewReqCtx(c).WithLog("获取字典类型分页列表").Handle(s.GetDictTypeList)
})
typeLog := ctx.NewLogInfo("获取字典类型信息")
dict.GET("type/:dictId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(typeLog).Handle(s.GetDictType)
ginx.NewReqCtx(c).WithLog("获取字典类型信息").Handle(s.GetDictType)
})
insertTypeLog := ctx.NewLogInfo("添加字典类型信息")
dict.POST("type", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertTypeLog).Handle(s.InsertDictType)
ginx.NewReqCtx(c).WithLog("添加字典类型信息").Handle(s.InsertDictType)
})
updateTypeLog := ctx.NewLogInfo("修改字典类型信息")
dict.PUT("type", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateTypeLog).Handle(s.UpdateDictType)
ginx.NewReqCtx(c).WithLog("修改字典类型信息").Handle(s.UpdateDictType)
})
deleteTypeLog := ctx.NewLogInfo("删除字典类型信息")
dict.DELETE("type/:dictId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteTypeLog).Handle(s.DeleteDictType)
ginx.NewReqCtx(c).WithLog("删除字典类型信息").Handle(s.DeleteDictType)
})
exportTypeLog := ctx.NewLogInfo("导出字典类型信息")
dict.GET("type/export", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(exportTypeLog).Handle(s.ExportDictType)
ginx.NewReqCtx(c).WithLog("导出字典类型信息").Handle(s.ExportDictType)
})
dataListLog := ctx.NewLogInfo("获取字典数据分页列表")
dict.GET("data/list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(dataListLog).Handle(s.GetDictDataList)
ginx.NewReqCtx(c).WithLog("获取字典数据分页列表").Handle(s.GetDictDataList)
})
dataListByDictTypeLog := ctx.NewLogInfo("获取字典数据列表通过字典类型")
dict.GET("data/type", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(dataListByDictTypeLog).Handle(s.GetDictDataListByDictType)
ginx.NewReqCtx(c).WithLog("获取字典数据列表通过字典类型").Handle(s.GetDictDataListByDictType)
})
dataLog := ctx.NewLogInfo("获取字典数据信息")
dict.GET("data/:dictCode", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(dataLog).Handle(s.GetDictData)
ginx.NewReqCtx(c).WithLog("获取字典数据信息").Handle(s.GetDictData)
})
insertDataLog := ctx.NewLogInfo("添加字典数据信息")
dict.POST("data", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertDataLog).Handle(s.InsertDictData)
ginx.NewReqCtx(c).WithLog("添加字典数据信息").Handle(s.InsertDictData)
})
updateDataLog := ctx.NewLogInfo("修改字典数据信息")
dict.PUT("data", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateDataLog).Handle(s.UpdateDictData)
ginx.NewReqCtx(c).WithLog("修改字典数据信息").Handle(s.UpdateDictData)
})
deleteDataLog := ctx.NewLogInfo("删除字典数据信息")
dict.DELETE("data/:dictCode", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteDataLog).Handle(s.DeleteDictData)
ginx.NewReqCtx(c).WithLog("删除字典数据信息").Handle(s.DeleteDictData)
})
}

View File

@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitMenuRouter(router *gin.RouterGroup) {
@@ -16,48 +16,39 @@ func InitMenuRouter(router *gin.RouterGroup) {
}
menu := router.Group("menu")
getSetRole := ctx.NewLogInfo("获取菜单树")
menu.GET("menuTreeSelect", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(getSetRole).WithNeedToken(false).WithNeedCasbin(false).Handle(s.GetMenuTreeSelect)
ginx.NewReqCtx(c).WithLog("获取菜单树").WithNeedToken(false).WithNeedCasbin(false).Handle(s.GetMenuTreeSelect)
})
menuRole := ctx.NewLogInfo("获取角色菜单")
menu.GET("menuRole", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(menuRole).Handle(s.GetMenuRole)
ginx.NewReqCtx(c).WithLog("获取角色菜单").Handle(s.GetMenuRole)
})
roleMenuTreSelect := ctx.NewLogInfo("获取角色菜单树")
menu.GET("roleMenuTreeSelect/:roleId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(roleMenuTreSelect).Handle(s.GetMenuTreeRoleSelect)
ginx.NewReqCtx(c).WithLog("获取角色菜单树").Handle(s.GetMenuTreeRoleSelect)
})
menuPaths := ctx.NewLogInfo("获取角色菜单路径列表")
menu.GET("menuPaths", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(menuPaths).Handle(s.GetMenuPaths)
ginx.NewReqCtx(c).WithLog("获取角色菜单路径列表").Handle(s.GetMenuPaths)
})
menuList := ctx.NewLogInfo("获取菜单列表")
menu.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(menuList).Handle(s.GetMenuList)
ginx.NewReqCtx(c).WithLog("获取菜单列表").Handle(s.GetMenuList)
})
menuLog := ctx.NewLogInfo("获取菜单信息")
menu.GET(":menuId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(menuLog).Handle(s.GetMenu)
ginx.NewReqCtx(c).WithLog("获取菜单信息").Handle(s.GetMenu)
})
insertMenuLog := ctx.NewLogInfo("添加菜单信息")
menu.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertMenuLog).Handle(s.InsertMenu)
ginx.NewReqCtx(c).WithLog("添加菜单信息").Handle(s.InsertMenu)
})
updateMenuLog := ctx.NewLogInfo("修改菜单信息")
menu.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateMenuLog).Handle(s.UpdateMenu)
ginx.NewReqCtx(c).WithLog("修改菜单信息").Handle(s.UpdateMenu)
})
deleteMenuLog := ctx.NewLogInfo("删除菜单信息")
menu.DELETE(":menuId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteMenuLog).Handle(s.DeleteMenu)
ginx.NewReqCtx(c).WithLog("删除菜单信息").Handle(s.DeleteMenu)
})
}

View File

@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitNoticeRouter(router *gin.RouterGroup) {
@@ -14,23 +14,19 @@ func InitNoticeRouter(router *gin.RouterGroup) {
}
notice := router.Group("notice")
noticetList := ctx.NewLogInfo("获取通知分页列表")
notice.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(noticetList).Handle(s.GetNoticeList)
ginx.NewReqCtx(c).WithLog("获取通知分页列表").Handle(s.GetNoticeList)
})
insertNoticeLog := ctx.NewLogInfo("添加通知信息")
notice.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertNoticeLog).Handle(s.InsertNotice)
ginx.NewReqCtx(c).WithLog("添加通知信息").Handle(s.InsertNotice)
})
updateNoticeLog := ctx.NewLogInfo("修改通知信息")
notice.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateNoticeLog).Handle(s.UpdateNotice)
ginx.NewReqCtx(c).WithLog("修改通知信息").Handle(s.UpdateNotice)
})
deleteNoticeLog := ctx.NewLogInfo("删除通知信息")
notice.DELETE(":noticeId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteNoticeLog).Handle(s.DeleteNotice)
ginx.NewReqCtx(c).WithLog("删除通知信息").Handle(s.DeleteNotice)
})
}

View File

@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitPostRouter(router *gin.RouterGroup) {
@@ -15,28 +15,23 @@ func InitPostRouter(router *gin.RouterGroup) {
}
post := router.Group("post")
postList := ctx.NewLogInfo("获取岗位分页列表")
post.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(postList).Handle(s.GetPostList)
ginx.NewReqCtx(c).WithLog("获取岗位分页列表").Handle(s.GetPostList)
})
postLog := ctx.NewLogInfo("获取岗位信息")
post.GET(":postId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(postLog).Handle(s.GetPost)
ginx.NewReqCtx(c).WithLog("获取岗位信息").Handle(s.GetPost)
})
insertPostLog := ctx.NewLogInfo("添加岗位信息")
post.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertPostLog).Handle(s.InsertPost)
ginx.NewReqCtx(c).WithLog("添加岗位信息").Handle(s.InsertPost)
})
updatePostLog := ctx.NewLogInfo("修改岗位信息")
post.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updatePostLog).Handle(s.UpdatePost)
ginx.NewReqCtx(c).WithLog("修改岗位信息").Handle(s.UpdatePost)
})
deletePostLog := ctx.NewLogInfo("删除岗位信息")
post.DELETE(":postId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deletePostLog).Handle(s.DeletePost)
ginx.NewReqCtx(c).WithLog("删除岗位信息").Handle(s.DeletePost)
})
}

View File

@@ -4,7 +4,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitRoleRouter(router *gin.RouterGroup) {
@@ -16,42 +16,35 @@ func InitRoleRouter(router *gin.RouterGroup) {
}
role := router.Group("role")
roleListLog := ctx.NewLogInfo("获取角色分页列表")
role.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(roleListLog).Handle(s.GetRoleList)
ginx.NewReqCtx(c).WithLog("获取角色分页列表").Handle(s.GetRoleList)
})
roleLog := ctx.NewLogInfo("获取角色信息")
role.GET(":roleId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(roleLog).Handle(s.GetRole)
ginx.NewReqCtx(c).WithLog("获取角色信息").Handle(s.GetRole)
})
insertRoleLog := ctx.NewLogInfo("添加角色信息")
role.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertRoleLog).Handle(s.InsertRole)
ginx.NewReqCtx(c).WithLog("添加角色信息").Handle(s.InsertRole)
})
updateRoleLog := ctx.NewLogInfo("修改角色信息")
role.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateRoleLog).Handle(s.UpdateRole)
ginx.NewReqCtx(c).WithLog("修改角色信息").Handle(s.UpdateRole)
})
updateStaRoleLog := ctx.NewLogInfo("修改角色状态")
role.PUT("changeStatus", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateStaRoleLog).Handle(s.UpdateRoleStatus)
ginx.NewReqCtx(c).WithLog("修改角色状态").Handle(s.UpdateRoleStatus)
})
updateDaSRoleLog := ctx.NewLogInfo("修改角色部门权限")
role.PUT("dataScope", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateDaSRoleLog).Handle(s.UpdateRoleDataScope)
ginx.NewReqCtx(c).WithLog("修改角色部门权限").Handle(s.UpdateRoleDataScope)
})
deleteRoleLog := ctx.NewLogInfo("删除角色信息")
role.DELETE(":roleId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteRoleLog).Handle(s.DeleteRole)
ginx.NewReqCtx(c).WithLog("删除角色信息").Handle(s.DeleteRole)
})
exportRoleLog := ctx.NewLogInfo("导出角色信息")
role.GET("export", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(exportRoleLog).Handle(s.ExportRole)
ginx.NewReqCtx(c).WithLog("导出角色信息").Handle(s.ExportRole)
})
}

View File

@@ -10,7 +10,7 @@ import (
"github.com/gin-gonic/gin"
"pandax/apps/system/api"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitSysTenantRouter(router *gin.RouterGroup) {
@@ -19,31 +19,27 @@ func InitSysTenantRouter(router *gin.RouterGroup) {
}
routerGroup := router.Group("tenant")
SysTenantListLog := ctx.NewLogInfo("获取SysTenant分页列表")
routerGroup.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(SysTenantListLog).Handle(s.GetSysTenantsList)
ginx.NewReqCtx(c).WithLog("获取SysTenant分页列表").Handle(s.GetSysTenantsList)
})
SysTenantAllLog := ctx.NewLogInfo("获取SysTenant列表")
routerGroup.GET("lists", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(SysTenantAllLog).Handle(s.GetSysTenantsAll)
ginx.NewReqCtx(c).WithLog("获取SysTenant列表").Handle(s.GetSysTenantsAll)
})
SysTenantLog := ctx.NewLogInfo("获取SysTenant信息")
routerGroup.GET(":tenantId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(SysTenantLog).Handle(s.GetSysTenants)
ginx.NewReqCtx(c).WithLog("获取SysTenant信息").Handle(s.GetSysTenants)
})
insertSysTenantLog := ctx.NewLogInfo("添加SysTenant信息")
routerGroup.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertSysTenantLog).Handle(s.InsertSysTenants)
ginx.NewReqCtx(c).WithLog("添加SysTenant信息").Handle(s.InsertSysTenants)
})
updateSysTenantLog := ctx.NewLogInfo("修改SysTenant信息")
routerGroup.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateSysTenantLog).Handle(s.UpdateSysTenants)
ginx.NewReqCtx(c).WithLog("修改SysTenant信息").Handle(s.UpdateSysTenants)
})
deleteSysTenantLog := ctx.NewLogInfo("删除SysTenant信息")
routerGroup.DELETE(":tenantId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteSysTenantLog).Handle(s.DeleteSysTenants)
ginx.NewReqCtx(c).WithLog("删除SysTenant信息").Handle(s.DeleteSysTenants)
})
}

View File

@@ -6,7 +6,7 @@ import (
"pandax/apps/system/services"
logServices "pandax/apps/log/services"
"pandax/base/ctx"
"pandax/base/ginx"
)
func InitUserRouter(router *gin.RouterGroup) {
@@ -23,71 +23,57 @@ func InitUserRouter(router *gin.RouterGroup) {
// 获取验证码
user.GET("getCaptcha", s.GenerateCaptcha)
loginLog := ctx.NewLogInfo("登录")
user.POST("login", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(loginLog).WithNeedToken(false).WithNeedCasbin(false).Handle(s.Login)
ginx.NewReqCtx(c).WithLog("登录").WithNeedToken(false).WithNeedCasbin(false).Handle(s.Login)
})
authLog := ctx.NewLogInfo("认证信息")
user.GET("auth", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(authLog).WithNeedCasbin(false).Handle(s.Auth)
ginx.NewReqCtx(c).WithLog("认证信息").WithNeedCasbin(false).Handle(s.Auth)
})
logoutLog := ctx.NewLogInfo("退出登录")
user.POST("logout", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(logoutLog).WithNeedToken(false).WithNeedCasbin(false).Handle(s.LogOut)
ginx.NewReqCtx(c).WithLog("退出登录").WithNeedToken(false).WithNeedCasbin(false).Handle(s.LogOut)
})
sysUserListLog := ctx.NewLogInfo("得到用户分页列表")
user.GET("list", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(sysUserListLog).Handle(s.GetSysUserList)
ginx.NewReqCtx(c).WithLog("得到用户分页列表").Handle(s.GetSysUserList)
})
avatarLog := ctx.NewLogInfo("修改用户头像")
user.POST("avatar", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(avatarLog).Handle(s.InsetSysUserAvatar)
ginx.NewReqCtx(c).WithLog("修改用户头像").Handle(s.InsetSysUserAvatar)
})
pwdLog := ctx.NewLogInfo("修改用户密码")
user.PUT("pwd", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(pwdLog).Handle(s.SysUserUpdatePwd)
ginx.NewReqCtx(c).WithLog("修改用户密码").Handle(s.SysUserUpdatePwd)
})
userLog := ctx.NewLogInfo("获取用户信息")
user.GET("getById/:userId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(userLog).Handle(s.GetSysUser)
ginx.NewReqCtx(c).WithLog("获取用户信息").Handle(s.GetSysUser)
})
getSysUserInitLog := ctx.NewLogInfo("获取初始化角色岗位信息(添加用户初始化)")
user.GET("getInit", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(getSysUserInitLog).Handle(s.GetSysUserInit)
ginx.NewReqCtx(c).WithLog("获取初始化角色岗位信息(添加用户初始化)").Handle(s.GetSysUserInit)
})
getSysUserRoPoLog := ctx.NewLogInfo("获取用户角色岗位信息(添加用户初始化)")
user.GET("getRoPo", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(getSysUserRoPoLog).Handle(s.GetUserRolePost)
ginx.NewReqCtx(c).WithLog("获取用户角色岗位信息(添加用户初始化)").Handle(s.GetUserRolePost)
})
insertUserLog := ctx.NewLogInfo("添加用户信息")
user.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(insertUserLog).Handle(s.InsertSysUser)
ginx.NewReqCtx(c).WithLog("添加用户信息").Handle(s.InsertSysUser)
})
updateUserLog := ctx.NewLogInfo("修改用户信息")
user.PUT("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateUserLog).Handle(s.UpdateSysUser)
ginx.NewReqCtx(c).WithLog("修改用户信息").Handle(s.UpdateSysUser)
})
updateUserStuLog := ctx.NewLogInfo("修改用户状态")
user.PUT("changeStatus", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(updateUserStuLog).Handle(s.UpdateSysUserStu)
ginx.NewReqCtx(c).WithLog("修改用户状态").Handle(s.UpdateSysUserStu)
})
deleteUserLog := ctx.NewLogInfo("删除用户信息")
user.DELETE(":userId", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(deleteUserLog).Handle(s.DeleteSysUser)
ginx.NewReqCtx(c).WithLog("删除用户信息").Handle(s.DeleteSysUser)
})
exportUserLog := ctx.NewLogInfo("导出用户信息")
user.GET("export", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(exportUserLog).Handle(s.ExportUser)
ginx.NewReqCtx(c).WithLog("导出用户信息").Handle(s.ExportUser)
})
}