merchant_raw.go 1.1 KB

123456789101112131415161718192021222324
  1. package model
  2. import "time"
  3. // MerchantRaw stores raw merchant data from all collector plugins.
  4. // Dedup rule: same tg_username + same source_url = skip insert.
  5. type MerchantRaw struct {
  6. ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
  7. TgUsername string `gorm:"size:255;index;not null" json:"tg_username"`
  8. TgLink string `gorm:"size:500" json:"tg_link"`
  9. MerchantName string `gorm:"size:500" json:"merchant_name"`
  10. Website string `gorm:"size:2048" json:"website"`
  11. Email string `gorm:"size:255" json:"email"`
  12. Phone string `gorm:"size:100" json:"phone"`
  13. SourceType string `gorm:"size:50;not null" json:"source_type"`
  14. SourceName string `gorm:"size:500" json:"source_name"`
  15. SourceURL string `gorm:"size:2048" json:"source_url"`
  16. OriginalText string `gorm:"type:text" json:"original_text"`
  17. IndustryTag string `gorm:"size:100" json:"industry_tag"`
  18. Status string `gorm:"size:20;default:'raw';index" json:"status"` // raw / processing / done
  19. CreatedAt time.Time `json:"created_at"`
  20. }
  21. func (MerchantRaw) TableName() string { return "merchants_raw" }