follower.go 668 B

1234567891011121314151617181920212223242526272829303132
  1. package dao
  2. import (
  3. "context"
  4. "net/url"
  5. "strconv"
  6. "go-common/library/log"
  7. )
  8. // consts
  9. const (
  10. AttrFollowing = uint32(1) << 1
  11. AttrFriend = uint32(1) << 2
  12. )
  13. // DelFollowerCache del follower cache
  14. func (d *Dao) DelFollowerCache(fid int64) (err error) {
  15. params := url.Values{}
  16. params.Set("mid", strconv.FormatInt(fid, 10))
  17. var res struct {
  18. Code int `json:"code"`
  19. }
  20. if err = d.client.Post(context.TODO(), d.clearFollowerPath, "", params, &res); err != nil {
  21. log.Error("d.client.Post error(%v)", err)
  22. return
  23. }
  24. if res.Code != 0 {
  25. log.Error("url(%s) res code(%d) or res.result(%v)", d.clearFollowerPath+"?"+params.Encode(), res.Code)
  26. }
  27. return
  28. }