vip.go 558 B

12345678910111213141516171819202122232425262728
  1. package pendant
  2. import (
  3. "context"
  4. "strconv"
  5. "go-common/app/service/main/usersuit/model"
  6. "go-common/library/ecode"
  7. "github.com/pkg/errors"
  8. )
  9. // VipInfo get identify info by calling api.
  10. func (d *Dao) VipInfo(c context.Context, mid int64, ip string) (idt *model.VipInfo, err error) {
  11. var res struct {
  12. Code int
  13. Data *model.VipInfo
  14. }
  15. if err = d.client.Get(c, d.vipInfoURL+strconv.FormatInt(mid, 10), ip, nil, &res); err != nil {
  16. return
  17. }
  18. if res.Code != 0 {
  19. err = errors.WithStack(ecode.Int(res.Code))
  20. return
  21. }
  22. idt = res.Data
  23. return
  24. }