feat:完善项目
This commit is contained in:
@ -12,6 +12,31 @@ type Config struct{}
|
||||
* @apiDefine Config 配置管理
|
||||
*/
|
||||
|
||||
func (*Config) List(c *gin.Context) {
|
||||
form := &struct {
|
||||
Kind int `json:"kind" form:"kind"`
|
||||
PageForm
|
||||
}{}
|
||||
if err := bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := config.NewInstance()().List(form.Kind, form.Page, form.PageSize)
|
||||
APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Config) Edit(c *gin.Context) {
|
||||
form := &struct {
|
||||
Params map[string]interface{} `json:"params" form:"params"`
|
||||
}{}
|
||||
if err := bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := config.NewInstance()().Form(form.Params)
|
||||
APIResponse(err)(c)
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} /api/v1/config/area 区域信息
|
||||
* @apiVersion 1.0.0
|
||||
@ -47,7 +72,7 @@ func (*Config) Area(c *gin.Context) {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data := config.NewInstance()(getSession()(c).(*service.Session)).Area(form.Key)
|
||||
data := config.NewArea()(getSession()(c).(*service.Session)).List(form.Key)
|
||||
APIResponse(nil, data)(c)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user