package yb_user_collection

import (
	"time"
)

// YbUserCollection 研报-用户收藏表
type YbUserCollection struct {
	CollectionID   int       `gorm:"primaryKey;column:collection_id;type:int(10) unsigned;not null" json:"-"`
	CollectionType int       `gorm:"column:collection_type;type:tinyint(4) unsigned;not null;default:0" json:"collectionType"` // 收藏类型：1-研报; 2-视频社区; 3-微路演视频
	UserID         int       `gorm:"index:idx_user_id;column:user_id;type:int(10) unsigned;not null;default:0" json:"userId"`
	RealName       string    `gorm:"column:real_name;type:varchar(100);not null;default:''" json:"realName"` // 真实姓名
	CompanyID      int       `gorm:"column:company_id;type:int(10) unsigned;not null;default:0" json:"companyId"`
	CompanyName    string    `gorm:"column:company_name;type:varchar(100);not null;default:''" json:"companyName"` // 客户名称
	CompanyStatus  string    `gorm:"column:company_status;type:varchar(30);not null;default:''" json:"companyStatus"`
	SellerID       int       `gorm:"column:seller_id;type:int(11)" json:"sellerId"`
	PrimaryID      int       `gorm:"index:idx_primary_id;column:primary_id;type:int(10) unsigned;not null;default:0" json:"primaryId"` // 不同类型的主ID
	ExtendID       int       `gorm:"index:idx_extend_id;column:extend_id;type:int(10) unsigned;not null;default:0" json:"extendId"`    // 扩展ID-如晨周报章节ID
	State          int       `gorm:"column:state;type:tinyint(4) unsigned;not null;default:0" json:"state"`                            // 状态：1-已收藏；0-取消收藏；
	SourceAgent    int       `gorm:"column:source_agent;type:tinyint(4) unsigned;not null;default:0" json:"sourceAgent"`               // 操作来源：1-小程序 2-小程序 PC 3-弘则研究公众号 4-Web PC
	Title          string    `gorm:"column:title;type:varchar(255);not null;default:''" json:"title"`                                  // 研报/视频标题-冗余
	PublishTime    time.Time `gorm:"column:publish_time;type:datetime" json:"publishTime"`                                             // 研报/视频发布时间-冗余
	CreateTime     time.Time `gorm:"column:create_time;type:datetime" json:"createTime"`                                               // 创建时间
	ModifyTime     time.Time `gorm:"column:modify_time;type:datetime" json:"modifyTime"`                                               // 修改时间
}

// TableName get sql table name.获取数据库表名
func (m *YbUserCollection) TableName() string {
	return "yb_user_collection"
}

// YbUserCollectionColumns get sql column name.获取数据库列名
var YbUserCollectionColumns = struct {
	CollectionID   string
	CollectionType string
	UserID         string
	PrimaryID      string
	ExtendID       string
	State          string
	SourceAgent    string
	Title          string
	PublishTime    string
	CreateTime     string
	ModifyTime     string
}{
	CollectionID:   "collection_id",
	CollectionType: "collection_type",
	UserID:         "user_id",
	PrimaryID:      "primary_id",
	ExtendID:       "extend_id",
	State:          "state",
	SourceAgent:    "source_agent",
	Title:          "title",
	PublishTime:    "publish_time",
	CreateTime:     "create_time",
	ModifyTime:     "modify_time",
}
