channel.go 891 B

1234567891011121314151617
  1. package model
  2. import "time"
  3. // Channel stores discovered Telegram channels.
  4. type Channel struct {
  5. ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
  6. Username string `gorm:"uniqueIndex;size:255;not null" json:"username"`
  7. ChannelID int64 `gorm:"default:0" json:"channel_id"` // cached TG entity ID
  8. AccessHash int64 `gorm:"default:0" json:"access_hash"` // cached TG access hash
  9. Status string `gorm:"size:20;default:'pending';index" json:"status"` // pending / scraped / failed / skipped
  10. LastMessageID int `gorm:"default:0" json:"last_message_id"`
  11. MerchantsFound int `gorm:"default:0" json:"merchants_found"`
  12. Source string `gorm:"size:50;not null;index" json:"source"` // seed / snowball / search / github
  13. CreatedAt time.Time `json:"created_at"`
  14. UpdatedAt time.Time `json:"updated_at"`
  15. }