oldvip.go 789 B

12345678910111213141516171819202122232425262728293031323334353637
  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(mid, status int64) (err error) {
  14. var (
  15. c = context.Background()
  16. )
  17. params := url.Values{}
  18. params.Set("mid", fmt.Sprintf("%v", mid))
  19. params.Set("status", fmt.Sprintf("%v", status))
  20. rel := new(struct {
  21. Code int64 `json:"code"`
  22. Data string `json:"data"`
  23. })
  24. if err = d.client.Get(c, d.c.URLConf.OldVipCoURL+_frozenChange, "127.0.0.1", params, rel); err != nil {
  25. log.Error("send error(%v) url(%v)", err, d.c.URLConf.OldVipCoURL+_frozenChange)
  26. return
  27. }
  28. if rel != nil && rel.Code == int64(ecode.OK.Code()) {
  29. return
  30. }
  31. err = ecode.VipJavaAPIErr
  32. return
  33. }