pendant_new.go 919 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package http
  2. import (
  3. usmdl "go-common/app/service/main/usersuit/model"
  4. "go-common/library/ecode"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. const _mobilePendant = "http://account.bilibili.com/mobile/pendant/#/my"
  8. func pointFlagMobile(c *bm.Context) {
  9. mid, ok := c.Get("mid")
  10. if !ok {
  11. c.JSON(nil, ecode.NoLogin)
  12. return
  13. }
  14. var (
  15. err error
  16. pointFlag struct {
  17. Link struct {
  18. PendantLink string `json:"pendant_link"`
  19. MedalLink string `json:"medal_link"`
  20. } `json:"link"`
  21. Flag *usmdl.PointFlag `json:"flag"`
  22. }
  23. )
  24. if pointFlag.Flag, err = usSvc.PointFlag(c, &usmdl.ArgMID{MID: mid.(int64)}); err != nil {
  25. c.JSON(nil, err)
  26. return
  27. }
  28. pointFlag.Link.PendantLink = _mobilePendant
  29. c.JSON(pointFlag, nil)
  30. }
  31. func pointFlag(c *bm.Context) {
  32. mid, ok := c.Get("mid")
  33. if !ok {
  34. c.JSON(nil, ecode.NoLogin)
  35. return
  36. }
  37. c.JSON(usSvc.PointFlag(c, &usmdl.ArgMID{MID: mid.(int64)}))
  38. }