package controller import ( "github.com/gin-gonic/gin" "base-gin/service" "base-gin/utils/base" ) type ConfigParam struct { Key string `form:"key" binding:"required"` } func GetConfig(c *gin.Context) { var input ConfigParam if err := c.ShouldBind(&input); err != nil { base.RenderJsonFail(c, err) return } ret, err := service.GetConfig(c, input.Key) if err != nil { base.RenderJsonFail(c, err) return } base.RenderJsonSucc(c, gin.H{"detail": ret}) }