data.go 714 B

1234567891011121314151617181920212223242526
  1. package medal
  2. import (
  3. "context"
  4. "fmt"
  5. "net/url"
  6. "time"
  7. "go-common/app/job/main/usersuit/model"
  8. "go-common/library/log"
  9. )
  10. // UpInfoData .
  11. func (d *Dao) UpInfoData(c context.Context) (res *model.UpInfo, err error) {
  12. params := url.Values{}
  13. yesterday := time.Now().AddDate(0, 0, -1).Format("2006-01-02")
  14. if err = d.client.Get(c, fmt.Sprintf(d.updateInfo, yesterday), "", params, &res); err != nil {
  15. log.Error("GetWearedfansMedal(%s) error(%v)", d.updateInfo+"?"+params.Encode(), err)
  16. return
  17. }
  18. if res.Code != 0 {
  19. log.Error("GetWearedfansMedal(%s) res(%d)", d.updateInfo+"?"+params.Encode(), res.Code)
  20. }
  21. log.Info("GetWearedfansMedal(%s) res(%+v)", d.updateInfo+"?"+params.Encode(), res)
  22. return
  23. }