package user_view_history

import (
"time"
)

// UserViewHistory 访问历史
type UserViewHistory struct {
	ViewHistoryID        uint64    `gorm:"primaryKey;column:view_history_id" json:"-"`              // id
	UserID               uint64    `gorm:"column:user_id" json:"userId"`                            // 用户id
	Mobile               string    `gorm:"column:mobile" json:"mobile"`                             // 手机号
	Email                string    `gorm:"column:email" json:"email"`                               // 邮箱
	RealName             string    `gorm:"column:real_name" json:"realName"`                        // 用户实际名称
	CompanyName          string    `gorm:"column:company_name" json:"companyName"`                  // 公司名称
	ViewTitle            string    `gorm:"column:view_title" json:"viewTitle"`                      // 访问标题
	ViewPage             string    `gorm:"column:view_page" json:"viewPage"`                        // 访问页面
	ReportChapterModule  string    `gorm:"column:report_chapter_module" json:"reportChapterModule"` // 访问核心观点或者图文逻辑
	CreatedTime          time.Time `gorm:"column:created_time" json:"createdTime"`                  // 创建时间
	LastUpdatedTime      time.Time `gorm:"column:last_updated_time" json:"lastUpdatedTime"`
	Type                 string    `gorm:"column:type" json:"type"`                                    // 访问历史类型，weekly_report 周报，pdf
	ResearchReportID     uint64    `gorm:"column:research_report_id" json:"researchReportId"`          // 研报id
	ResearchReportTypeID uint64    `gorm:"column:research_report_type_id" json:"researchReportTypeId"` // 报告章节id,为0时表示查看目录或者首页
}

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

// UserViewHistoryColumns get sql column name.获取数据库列名
var UserViewHistoryColumns = struct {
	ViewHistoryID        string
	UserID               string
	Mobile               string
	Email                string
	RealName             string
	CompanyName          string
	ViewTitle            string
	ViewPage             string
	ReportChapterModule  string
	CreatedTime          string
	LastUpdatedTime      string
	Type                 string
	ResearchReportID     string
	ResearchReportTypeID string
}{
	ViewHistoryID:        "view_history_id",
	UserID:               "user_id",
	Mobile:               "mobile",
	Email:                "email",
	RealName:             "real_name",
	CompanyName:          "company_name",
	ViewTitle:            "view_title",
	ViewPage:             "view_page",
	ReportChapterModule:  "report_chapter_module",
	CreatedTime:          "created_time",
	LastUpdatedTime:      "last_updated_time",
	Type:                 "type",
	ResearchReportID:     "research_report_id",
	ResearchReportTypeID: "research_report_type_id",
}
