refactor: 包名变更ctx -> req

This commit is contained in:
meilin.huang
2023-01-14 16:29:52 +08:00
parent 2a91cdb67a
commit 594ca43505
46 changed files with 395 additions and 401 deletions

View File

@@ -3,7 +3,7 @@ package router
import (
"mayfly-go/internal/sys/api"
"mayfly-go/internal/sys/application"
"mayfly-go/pkg/ctx"
"mayfly-go/pkg/req"
"github.com/gin-gonic/gin"
)
@@ -13,16 +13,16 @@ func InitSysConfigRouter(router *gin.RouterGroup) {
db := router.Group("sys/configs")
{
db.GET("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).Handle(r.Configs)
req.NewCtxWithGin(c).Handle(r.Configs)
})
db.GET("/value", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithNeedToken(false).Handle(r.GetConfigValueByKey)
req.NewCtxWithGin(c).WithNeedToken(false).Handle(r.GetConfigValueByKey)
})
saveConfig := ctx.NewLogInfo("保存系统配置信息").WithSave(true)
saveConfig := req.NewLogInfo("保存系统配置信息").WithSave(true)
db.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).
req.NewCtxWithGin(c).
WithLog(saveConfig).
Handle(r.SaveConfig)
})