mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-30 04:31:26 +08:00
[优化]base模块提出
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/XM-GO/PandaKit/restfulx"
|
||||
"github.com/gin-gonic/gin"
|
||||
"pandax/apps/log/api"
|
||||
"pandax/apps/log/services"
|
||||
"pandax/base/ginx"
|
||||
)
|
||||
|
||||
func InitLogRouter(router *gin.RouterGroup) {
|
||||
@@ -15,23 +15,23 @@ func InitLogRouter(router *gin.RouterGroup) {
|
||||
logLogin := router.Group("logLogin")
|
||||
|
||||
logLogin.GET("list", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("获取登录日志列表").Handle(login.GetLoginLogList)
|
||||
restfulx.NewReqCtx(c).WithLog("获取登录日志列表").Handle(login.GetLoginLogList)
|
||||
})
|
||||
|
||||
logLogin.GET(":infoId", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("获取登录日志信息").Handle(login.GetLoginLog)
|
||||
restfulx.NewReqCtx(c).WithLog("获取登录日志信息").Handle(login.GetLoginLog)
|
||||
})
|
||||
|
||||
logLogin.PUT("", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("修改登录日志信息").Handle(login.UpdateLoginLog)
|
||||
restfulx.NewReqCtx(c).WithLog("修改登录日志信息").Handle(login.UpdateLoginLog)
|
||||
})
|
||||
|
||||
logLogin.DELETE("all", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("清空登录日志信息").Handle(login.DeleteAll)
|
||||
restfulx.NewReqCtx(c).WithLog("清空登录日志信息").Handle(login.DeleteAll)
|
||||
})
|
||||
|
||||
logLogin.DELETE(":infoId", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("删除登录日志信息").Handle(login.DeleteLoginLog)
|
||||
restfulx.NewReqCtx(c).WithLog("删除登录日志信息").Handle(login.DeleteLoginLog)
|
||||
})
|
||||
|
||||
// 操作日志
|
||||
@@ -41,19 +41,19 @@ func InitLogRouter(router *gin.RouterGroup) {
|
||||
logOper := router.Group("logOper")
|
||||
|
||||
logOper.GET("list", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("获取操作日志列表").Handle(oper.GetOperLogList)
|
||||
restfulx.NewReqCtx(c).WithLog("获取操作日志列表").Handle(oper.GetOperLogList)
|
||||
})
|
||||
|
||||
logOper.GET(":operId", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("获取操作日志信息").Handle(oper.GetOperLog)
|
||||
restfulx.NewReqCtx(c).WithLog("获取操作日志信息").Handle(oper.GetOperLog)
|
||||
})
|
||||
|
||||
logOper.DELETE("all", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("清空操作日志信息").Handle(oper.DeleteAll)
|
||||
restfulx.NewReqCtx(c).WithLog("清空操作日志信息").Handle(oper.DeleteAll)
|
||||
})
|
||||
|
||||
logOper.DELETE(":operId", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("删除操作日志信息").Handle(oper.DeleteOperLog)
|
||||
restfulx.NewReqCtx(c).WithLog("删除操作日志信息").Handle(oper.DeleteOperLog)
|
||||
})
|
||||
|
||||
// Job日志
|
||||
@@ -63,14 +63,14 @@ func InitLogRouter(router *gin.RouterGroup) {
|
||||
logJob := router.Group("logJob")
|
||||
|
||||
logJob.GET("list", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("获取操作日志列表").Handle(job.GetJobLogList)
|
||||
restfulx.NewReqCtx(c).WithLog("获取操作日志列表").Handle(job.GetJobLogList)
|
||||
})
|
||||
|
||||
logJob.DELETE("all", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("清空操作日志信息").Handle(job.DeleteAll)
|
||||
restfulx.NewReqCtx(c).WithLog("清空操作日志信息").Handle(job.DeleteAll)
|
||||
})
|
||||
|
||||
logJob.DELETE(":logId", func(c *gin.Context) {
|
||||
ginx.NewReqCtx(c).WithLog("删除操作日志信息").Handle(job.DeleteJobLog)
|
||||
restfulx.NewReqCtx(c).WithLog("删除操作日志信息").Handle(job.DeleteJobLog)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user