mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-31 03:46:34 +08:00
refactor: 包名变更ctx -> req
This commit is contained in:
@@ -5,8 +5,8 @@ import (
|
||||
"mayfly-go/internal/sys/application"
|
||||
"mayfly-go/internal/sys/domain/entity"
|
||||
"mayfly-go/pkg/biz"
|
||||
"mayfly-go/pkg/ctx"
|
||||
"mayfly-go/pkg/ginx"
|
||||
"mayfly-go/pkg/req"
|
||||
"mayfly-go/pkg/utils"
|
||||
)
|
||||
|
||||
@@ -14,19 +14,19 @@ type Config struct {
|
||||
ConfigApp application.Config
|
||||
}
|
||||
|
||||
func (c *Config) Configs(rc *ctx.ReqCtx) {
|
||||
func (c *Config) Configs(rc *req.Ctx) {
|
||||
g := rc.GinCtx
|
||||
condition := &entity.Config{Key: g.Query("key")}
|
||||
rc.ResData = c.ConfigApp.GetPageList(condition, ginx.GetPageParam(g), new([]entity.Config))
|
||||
}
|
||||
|
||||
func (c *Config) GetConfigValueByKey(rc *ctx.ReqCtx) {
|
||||
func (c *Config) GetConfigValueByKey(rc *req.Ctx) {
|
||||
key := rc.GinCtx.Query("key")
|
||||
biz.NotEmpty(key, "key不能为空")
|
||||
rc.ResData = c.ConfigApp.GetConfig(key).Value
|
||||
}
|
||||
|
||||
func (c *Config) SaveConfig(rc *ctx.ReqCtx) {
|
||||
func (c *Config) SaveConfig(rc *req.Ctx) {
|
||||
g := rc.GinCtx
|
||||
form := &form.ConfigForm{}
|
||||
ginx.BindJsonAndValid(g, form)
|
||||
|
||||
Reference in New Issue
Block a user