web.go 456 B

12345678910111213141516171819
  1. package http
  2. import bm "go-common/library/net/http/blademaster"
  3. func webIndex(c *bm.Context) {
  4. var mid int64
  5. v := new(struct {
  6. VMid int64 `form:"mid" validate:"min=1"`
  7. Pn int32 `form:"pn" default:"1" validate:"min=1"`
  8. Ps int32 `form:"ps" default:"20" validate:"min=1"`
  9. })
  10. if err := c.Bind(v); err != nil {
  11. return
  12. }
  13. if midInter, ok := c.Get("mid"); ok {
  14. mid = midInter.(int64)
  15. }
  16. c.JSON(spcSvc.WebIndex(c, mid, v.VMid, v.Pn, v.Ps))
  17. }