mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-24 03:18:35 +08:00
项目目录优化,任务模块后端代码
This commit is contained in:
45
apps/system/router/config.go
Normal file
45
apps/system/router/config.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
api2 "pandax/apps/system/api"
|
||||
services2 "pandax/apps/system/services"
|
||||
"pandax/base/ctx"
|
||||
)
|
||||
|
||||
func InitConfigRouter(router *gin.RouterGroup) {
|
||||
s := &api2.ConfigApi{
|
||||
ConfigApp: services2.SysSysConfigModelDao,
|
||||
}
|
||||
config := router.Group("config")
|
||||
|
||||
configListLog := ctx.NewLogInfo("获取配置分页列表")
|
||||
config.GET("list", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).WithLog(configListLog).Handle(s.GetConfigList)
|
||||
})
|
||||
|
||||
configListByKeyLog := ctx.NewLogInfo("获取配置列表通过ConfigKey")
|
||||
config.GET("configKey", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).WithLog(configListByKeyLog).Handle(s.GetConfigListByKey)
|
||||
})
|
||||
|
||||
configLog := ctx.NewLogInfo("获取配置信息")
|
||||
config.GET(":configId", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).WithLog(configLog).Handle(s.GetConfig)
|
||||
})
|
||||
|
||||
insertConfigLog := ctx.NewLogInfo("添加配置信息")
|
||||
config.POST("", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).WithLog(insertConfigLog).Handle(s.InsertConfig)
|
||||
})
|
||||
|
||||
updateConfigLog := ctx.NewLogInfo("修改配置信息")
|
||||
config.PUT("", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).WithLog(updateConfigLog).Handle(s.UpdateConfig)
|
||||
})
|
||||
|
||||
deleteConfigLog := ctx.NewLogInfo("删除配置信息")
|
||||
config.DELETE(":configId", func(c *gin.Context) {
|
||||
ctx.NewReqCtxWithGin(c).WithLog(deleteConfigLog).Handle(s.DeleteConfig)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user