account.go 589 B

1234567891011121314151617181920212223242526272829
  1. package http
  2. import (
  3. bm "go-common/library/net/http/blademaster"
  4. )
  5. func attentions(c *bm.Context) {
  6. var mid int64
  7. midStr, _ := c.Get("mid")
  8. mid = midStr.(int64)
  9. c.JSON(webSvc.Attentions(c, mid))
  10. }
  11. func card(c *bm.Context) {
  12. var loginID int64
  13. v := new(struct {
  14. Mid int64 `form:"mid" validate:"min=1"`
  15. TopPhoto bool `form:"photo"`
  16. Article bool `form:"article"`
  17. })
  18. if err := c.Bind(v); err != nil {
  19. return
  20. }
  21. // login mid
  22. if loginIDStr, ok := c.Get("mid"); ok {
  23. loginID = loginIDStr.(int64)
  24. }
  25. c.JSON(webSvc.Card(c, v.Mid, loginID, v.TopPhoto, v.Article))
  26. }