数据采集
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

real_time.go 968 B

10 months ago
12345678910111213141516171819202122232425262728293031323334353637383940
  1. package haodanku
  2. import (
  3. "applet/app/utils"
  4. )
  5. type HdkReal struct {
  6. WireId string `json:"wire_id"`
  7. CateId []string `json:"cate_id"`
  8. Images []string `json:"images"`
  9. Platform string `json:"platform"`
  10. Starttime interface{} `json:"starttime"`
  11. Endtime string `json:"endtime"`
  12. List []struct {
  13. Content string `json:"content,omitempty"`
  14. ItemId string `json:"item_id,omitempty"`
  15. } `json:"list"`
  16. }
  17. // 好单库详情接口
  18. func HaodankuRealTime(topic, pageId, pageSize, selectTime string) (res []HdkReal, err error) {
  19. params := map[string]string{
  20. "version": "v2.1.0",
  21. "min_size": pageSize,
  22. "min_id": pageId,
  23. }
  24. if topic != "" {
  25. params["type"] = topic
  26. }
  27. resp, err := SendReq("http://v2.api.haodanku.com/wire_report", params)
  28. if err != nil {
  29. return nil, err
  30. }
  31. var featuredList struct {
  32. Data []HdkReal `json:"data"`
  33. }
  34. utils.Unserialize(resp, &featuredList)
  35. res = featuredList.Data
  36. return res, nil
  37. }