mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 07:50:25 +08:00
31 lines
691 B
Go
31 lines
691 B
Go
package router
|
|
|
|
import (
|
|
"mayfly-go/internal/sys/api"
|
|
"mayfly-go/internal/sys/application"
|
|
"mayfly-go/pkg/req"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func InitSysConfigRouter(router *gin.RouterGroup) {
|
|
r := &api.Config{ConfigApp: application.GetConfigApp()}
|
|
db := router.Group("sys/configs")
|
|
{
|
|
db.GET("", func(c *gin.Context) {
|
|
req.NewCtxWithGin(c).Handle(r.Configs)
|
|
})
|
|
|
|
db.GET("/value", func(c *gin.Context) {
|
|
req.NewCtxWithGin(c).DontNeedToken().Handle(r.GetConfigValueByKey)
|
|
})
|
|
|
|
saveConfig := req.NewLogInfo("保存系统配置信息").WithSave(true)
|
|
db.POST("", func(c *gin.Context) {
|
|
req.NewCtxWithGin(c).
|
|
WithLog(saveConfig).
|
|
Handle(r.SaveConfig)
|
|
})
|
|
}
|
|
}
|