oldvip.go 747 B

12345678910111213141516171819202122232425262728293031323334
  1. package dao
  2. import (
  3. "context"
  4. "fmt"
  5. "go-common/library/ecode"
  6. "go-common/library/log"
  7. "net/url"
  8. )
  9. const (
  10. _frozenChange = "/internal/v1/user/frozenChange"
  11. )
  12. // OldFrozenChange .
  13. func (d *Dao) OldFrozenChange(c context.Context, mid int64) (err error) {
  14. params := url.Values{}
  15. params.Set("mid", fmt.Sprintf("%v", mid))
  16. params.Set("status", "0")
  17. rel := new(struct {
  18. Code int64 `json:"code"`
  19. Data string `json:"data"`
  20. })
  21. if err = d.client.Get(c, d.c.Property.VipURL+_frozenChange, "127.0.0.1", params, rel); err != nil {
  22. log.Error("send error(%v) url(%v)", err, d.c.Property.VipURL+_frozenChange+_frozenChange)
  23. return
  24. }
  25. if rel != nil && rel.Code == int64(ecode.OK.Code()) {
  26. return
  27. }
  28. err = ecode.VipJavaAPIErr
  29. return
  30. }