package research_report

import "time"

// ResearchReport 研究报告表
type ResearchReport struct {
	ResearchReportID    uint64    `gorm:"primaryKey;column:research_report_id;type:bigint(20) unsigned;not null" json:"-"`                       // 研究报告id
	ResearchReportName  string    `gorm:"index:research_report_name;column:research_report_name;type:varchar(128)" json:"researchReportName"`    // 研究报告名称
	ResearchReportTitle string    `gorm:"index:research_report_title;column:research_report_title;type:varchar(128)" json:"researchReportTitle"` // 研究报告标题
	ResearchReportImg   string    `gorm:"column:research_report_img;type:varchar(128)" json:"researchReportImg"`                                 // 报告缩略图URL
	ResearchReportDate  time.Time `gorm:"column:research_report_date;type:date;not null" json:"researchReportDate"`                              // 报告日期
	Type                string    `gorm:"column:type;type:varchar(32);default:day" json:"type"`                                                  // day 晨报  week 周报 twoweek双周报 month 月报
	Author              string    `gorm:"column:author;type:varchar(100)" json:"author"`                                                         // 报告作者
	ReportVariety       string    `gorm:"column:report_variety;type:varchar(30)" json:"reportVariety"`                                           // 研究报告的品种，双周报和月报有标识
	IsHasMenu           int8      `gorm:"column:is_has_menu;type:tinyint(1);default:0" json:"isHasMenu"`                                         // 报告是否含有目录
	IsSendedMsg         int8      `gorm:"column:is_sended_msg;type:tinyint(1);default:0" json:"isSendedMsg"`                                     // 是否发送过模板消息
	Periods             int       `gorm:"column:periods;type:int(8)" json:"periods"`                                                             // 期数
	Status              string    `gorm:"column:status;type:varchar(20);not null" json:"status"`                                                 // 状态，draft：草稿，
	Enabled             int8      `gorm:"index:enabled;column:enabled;type:tinyint(1);default:1" json:"enabled"`                                 // 报告状态
	CreatedTime         time.Time `gorm:"index:created_time;column:created_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createdTime"`     // 创建时间
	LastUpdatedTime     time.Time `gorm:"index:last_updated_time;column:last_updated_time;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"lastUpdatedTime"`
	Viewers             int       `gorm:"column:viewers;type:int(8);default:0" json:"viewers"` // H5观看用户数
}

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

// ResearchReportColumns get sql column name.获取数据库列名
var ResearchReportColumns = struct {
	ResearchReportID    string
	ResearchReportName  string
	ResearchReportTitle string
	ResearchReportImg   string
	ResearchReportDate  string
	Type                string
	Author              string
	ReportVariety       string
	IsHasMenu           string
	IsSendedMsg         string
	Periods             string
	Status              string
	Enabled             string
	CreatedTime         string
	LastUpdatedTime     string
	Viewers             string
}{
	ResearchReportID:    "research_report_id",
	ResearchReportName:  "research_report_name",
	ResearchReportTitle: "research_report_title",
	ResearchReportImg:   "research_report_img",
	ResearchReportDate:  "research_report_date",
	Type:                "type",
	Author:              "author",
	ReportVariety:       "report_variety",
	IsHasMenu:           "is_has_menu",
	IsSendedMsg:         "is_sended_msg",
	Periods:             "periods",
	Status:              "status",
	Enabled:             "enabled",
	CreatedTime:         "created_time",
	LastUpdatedTime:     "last_updated_time",
	Viewers:             "viewers",
}
