package api import ( "SciencesServer/app/controller" "github.com/gin-gonic/gin" ) type Config struct{} func (a *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 := controller.NewConfig()().Config(form.Kind, form.Page, form.PageSize) APIResponse(err, data) } func (a *Config) Edit(c *gin.Context) { form := &struct { Params map[string]interface{} `json:"params" form:"params" binding:"required"` }{} if err := bind(form)(c); err != nil { APIFailure(err.(error))(c) return } err := controller.NewConfig()().Form(form.Params) APIResponse(err) }