Skip to content

Commit

Permalink
fix crawl date
Browse files Browse the repository at this point in the history
  • Loading branch information
minicloudsky committed Feb 4, 2024
1 parent b2b55f3 commit e765269
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/biz/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,25 @@ func (uc *LianjiaUsecase) poolFunc(i interface{}) {
case HouseTypeErshoufang:
err := uc.ListCityErshouFang(ctx, city)
if err != nil {
uc.log.Errorf("ListCityErshouFang err! %v", err)
return
}
case HouseTypeLoupan:
err := uc.ListCityLoupan(ctx, city)
if err != nil {
uc.log.Errorf("ListCityLoupan err! %v", err)
return
}
case HouseTypeCommercial:
err := uc.ListCityCommercial(ctx, city)
if err != nil {
uc.log.Errorf("ListCityCommercial err! %v", err)
return
}
case HouseTypeZufang:
err := uc.ListCityZufang(ctx, city)
if err != nil {
uc.log.Errorf("ListCityZufang err! %v", err)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type Data struct {
type BaseModel struct {
ID int64 `gorm:"primary_key;type:bigint;" json:"id"`
CreateTime *time.Time `gorm:"column:create_time;type:datetime not null;default:CURRENT_TIMESTAMP();comment:创建时间" json:"created_at"`
UpdateTime *time.Time `gorm:"column:update_time;type:datetime on update current_timestamp;comment:更新时间" json:"updated_at"`
CrawlDate *time.Time `gorm:"column:crawl_date;type:date;default:(CURRENT_DATE);comment:爬取日期" json:"crawl_date"`
}

type contextTransactionKey struct{}
Expand Down

0 comments on commit e765269

Please sign in to comment.