display.go 443 B

12345678910111213141516171819202122232425
  1. package http
  2. import (
  3. "time"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. func displayID(c *bm.Context) {
  7. header := c.Request.Header
  8. buvid := header.Get("Buvid")
  9. var mid int64
  10. if midInter, ok := c.Get("mid"); ok {
  11. mid = midInter.(int64)
  12. }
  13. id := displaySvr.DisplayID(c, mid, buvid, time.Now())
  14. c.JSON(struct {
  15. ID string `json:"id"`
  16. }{ID: id}, nil)
  17. }
  18. func zone(c *bm.Context) {
  19. c.JSON(displaySvr.Zone(c, time.Now()), nil)
  20. }