This commit is contained in:
parent
eb0b51c2f3
commit
1367b729b0
2
go.mod
2
go.mod
@ -5,7 +5,7 @@ go 1.22.2
|
||||
toolchain go1.22.3
|
||||
|
||||
require (
|
||||
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20241120131415-18ceb8a07738
|
||||
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20241129074538-3eb2ed0d82fb
|
||||
github.com/gofiber/fiber/v3 v3.0.0-beta.3
|
||||
github.com/golang/glog v1.2.1
|
||||
github.com/pkg/errors v0.9.1
|
||||
|
2
go.sum
2
go.sum
@ -1,6 +1,8 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20241120131415-18ceb8a07738 h1:H9qFYOZuFamcvNYBDiQ8AIXSu7oBujon3Vd3wndFyqg=
|
||||
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20241120131415-18ceb8a07738/go.mod h1:BIz+IMGznPiyLnV1+Ntw1zf8rEIcbymmGq+EfvDsSgE=
|
||||
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20241129074538-3eb2ed0d82fb h1:TRUAHaoTMr9DIxtnOJHouObMfh1vcaKHK3XnMiwRd8o=
|
||||
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20241129074538-3eb2ed0d82fb/go.mod h1:BIz+IMGznPiyLnV1+Ntw1zf8rEIcbymmGq+EfvDsSgE=
|
||||
github.com/3andne/restls-client-go v0.1.6 h1:tRx/YilqW7iHpgmEL4E1D8dAsuB0tFF3uvncS+B6I08=
|
||||
github.com/3andne/restls-client-go v0.1.6/go.mod h1:iEdTZNt9kzPIxjIGSMScUFSBrUH6bFRNg0BWlP4orEY=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
|
@ -164,6 +164,7 @@ func (c *Controller) productsToArticles(products []coach_client.Product) (articl
|
||||
Pid: color.VgId,
|
||||
SkuID: color.VgId,
|
||||
Available: color.Orderable,
|
||||
Image: color.Media.Thumbnail.Src,
|
||||
Link: fmt.Sprintf("%s/%s", "https://www.coachoutlet.com", color.Url),
|
||||
}
|
||||
// 拿到现在的价格
|
||||
@ -287,6 +288,9 @@ func (c *Controller) FetchArticleDetail(ctx context.Context, pid string) error {
|
||||
Pid: resp.Id,
|
||||
Brand: v2.Brand_Coach,
|
||||
}
|
||||
if len(resp.ImageGroups) > 0 {
|
||||
article.Image = resp.ImageGroups[0].Images[0].Src
|
||||
}
|
||||
pArticle := v2.ProviderArticle{
|
||||
ProviderId: c.providerId,
|
||||
Brand: v2.Brand_Coach,
|
||||
@ -294,6 +298,7 @@ func (c *Controller) FetchArticleDetail(ctx context.Context, pid string) error {
|
||||
SkuID: pid,
|
||||
Available: resp.Inventory.Orderable,
|
||||
Ast: resp.Inventory.Ats,
|
||||
Image: article.Image,
|
||||
Link: fmt.Sprintf("%s/%s", "https://www.coachoutlet.com", resp.Url),
|
||||
Cost: utils.CalculateProviderPrice(
|
||||
append(c.provider.CalculateProcess, old.CalculateProcess...),
|
||||
@ -305,9 +310,7 @@ func (c *Controller) FetchArticleDetail(ctx context.Context, pid string) error {
|
||||
}
|
||||
pArticle.HistoryPrice = append(pArticle.HistoryPrice, pArticle.Cost)
|
||||
article.Providers = append(article.Providers, pArticle)
|
||||
if len(resp.ImageGroups) > 0 {
|
||||
article.Image = resp.ImageGroups[0].Images[0].Src
|
||||
}
|
||||
|
||||
c.saveProducts([]v2.Article{article})
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user