Browse Source

更新蜜源数据采集

master
huangjiajun 1 week ago
parent
commit
312c4bec77
4 changed files with 7 additions and 4 deletions
  1. +3
    -2
      app/lib/haodanku/real_time.go
  2. +3
    -0
      app/task/svc/svc_data_collect_cron_haodanku_real_news.go
  3. +1
    -1
      app/task/svc/svc_data_collect_cron_miyuan_real_news.go
  4. +0
    -1
      go.mod

+ 3
- 2
app/lib/haodanku/real_time.go View File

@@ -12,8 +12,9 @@ type HdkReal struct {
Starttime interface{} `json:"starttime"`
Endtime string `json:"endtime"`
List []struct {
Content string `json:"content,omitempty"`
ItemId string `json:"item_id,omitempty"`
Content string `json:"content,omitempty"`
ItemId string `json:"item_id,omitempty"`
CouponUrl string `json:"coupon_url,omitempty"`
} `json:"list"`
}



+ 3
- 0
app/task/svc/svc_data_collect_cron_haodanku_real_news.go View File

@@ -115,6 +115,9 @@ func DataCollectCronHaodankuRealNews(types int) {
}
goodsList = append(goodsList, tmp1)
} else {
if v1.Content == "" {
v1.Content = v1.CouponUrl
}
tmp1 := map[string]string{
"content": v1.Content,
"gid": "",


+ 1
- 1
app/task/svc/svc_data_collect_cron_miyuan_real_news.go View File

@@ -27,7 +27,7 @@ func DataCollectCronMiyuanRealNews(types int) {
fmt.Println("============", time.Since(now))
for _, v := range ids {
for i := 1; i <= num; i++ {
time.Sleep(time.Microsecond * 10) // 等待10毫秒
time.Sleep(time.Microsecond * 200) // 等待10毫秒
newsData, err := gzmiyuan.GetGzmiRealData(utils.IntToStr(size), utils.IntToStr(i), v)
utils.FilePutContents("my", utils.SerializeStr(newsData))
if err != nil {


+ 0
- 1
go.mod View File

@@ -25,7 +25,6 @@ require (
github.com/sony/sonyflake v1.1.0
github.com/stretchr/testify v1.8.0 // indirect
github.com/syyongx/php2go v0.9.7
github.com/tidwall/gjson v1.14.1
go.uber.org/zap v1.16.0
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
golang.org/x/net v0.14.0 // indirect


Loading…
Cancel
Save