2024-08-03 14:12:44 +08:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type ProviderId string
|
|
|
|
|
2024-08-03 17:07:10 +08:00
|
|
|
const (
|
|
|
|
ProviderId_CoachOutlet_US ProviderId = "coachOutlet_us"
|
|
|
|
ProviderId_CoachOutlet_CN ProviderId = "coachOutlet_cn"
|
|
|
|
ProviderId_Coach_CN ProviderId = "coach_cn"
|
|
|
|
)
|
|
|
|
|
2024-08-03 14:12:44 +08:00
|
|
|
// ProviderArticle 供应商商品信息
|
|
|
|
type ProviderArticle struct {
|
|
|
|
ID uint `gorm:"primary_key" json:"-"`
|
|
|
|
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
// 对应的商品ID
|
|
|
|
ArticleID uint
|
|
|
|
// 货号
|
2024-08-03 17:07:10 +08:00
|
|
|
Pid string `gorm:"index" json:"pid"`
|
2024-08-03 14:12:44 +08:00
|
|
|
// 品牌
|
2024-08-03 17:07:10 +08:00
|
|
|
Brand Brand `gorm:"index" json:"brand"`
|
2024-08-03 14:12:44 +08:00
|
|
|
// 供应商商品链接链接
|
|
|
|
Link string `json:"link"`
|
|
|
|
// 供应商id
|
|
|
|
ProviderId ProviderId `gorm:"index:providerId_sku,unique" json:"providerId"`
|
|
|
|
// 供应商的sku
|
|
|
|
SkuID string `gorm:"index:providerId_sku,unique" json:"skuID"`
|
|
|
|
// 当前成本价
|
|
|
|
Cost ProviderPrice `json:"cost" gorm:"type:json;serializer:json"`
|
|
|
|
// 历史成本价格
|
|
|
|
HistoryPrice []ProviderPrice `json:"historyPrice"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ProviderPrice 供应商成本价格
|
|
|
|
type ProviderPrice struct {
|
|
|
|
ID uint `gorm:"primary_key" json:"-"`
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
|
|
|
|
ProviderArticleID uint `gorm:"index"`
|
|
|
|
// 供应商原始价格,美元、人名币、加元,单位为分
|
|
|
|
OriginalPrice int `json:"originalPrice"`
|
|
|
|
// 计算优惠后最终价格,人名币,单位为分
|
|
|
|
FinalPrice int `json:"finalPrice"` // 计算完优惠的最终的价格
|
|
|
|
CalMark string `json:"calMark"` //计算优惠的过程
|
|
|
|
}
|