parameter.go 441 B

12345678910111213141516171819202122
  1. package http
  2. import (
  3. "go-common/library/log"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. func paramInsert(c *bm.Context) {
  7. v := new(struct {
  8. Name string `form:"name"`
  9. Value int `form:"value"`
  10. Remark string `form:"remark"`
  11. })
  12. if err := c.Bind(v); err != nil {
  13. return
  14. }
  15. err := svr.InsertParameter(c, v.Name, v.Remark, v.Value)
  16. if err != nil {
  17. log.Error("svr.InsertParameter error(%v)", err)
  18. }
  19. c.JSON(nil, err)
  20. }