package yb_community_question_like_tease

import (
	"time"
)

// YbCommunityQuestionLikeTease 问答点赞/吐槽表
type YbCommunityQuestionLikeTease struct {
	CommunityQuestionLikeTeaseID uint64    `gorm:"primaryKey;column:community_question_like_tease_id;type:bigint(20) unsigned;not null" json:"-"`                                    // 点赞/吐槽自增id
	UserID                       uint64    `gorm:"index:idx_user_id;column:user_id;type:bigint(20) unsigned;not null;default:0" json:"userId"`                                       // 用户id
	OpType                       int8      `gorm:"column:op_type;type:tinyint(1);not null;default:1" json:"opType"`                                                                  // 类型. 1-点赞 2-吐槽
	Enabled                      int8      `gorm:"column:enabled;type:tinyint(1);not null;default:1" json:"enabled"`                                                                 // 状态. 0-无效数据（已取消点赞/吐槽） 1-有效数据（点赞/吐槽）
	CreateTime                   time.Time `gorm:"column:create_time;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"createTime"`                                            // 创建时间
	ModifyTime                   time.Time `gorm:"column:modify_time;type:datetime;not null;default:CURRENT_TIMESTAMP" json:"modifyTime"`                                            // 修改时间
	CommunityQuestionID          uint32    `gorm:"index:idx_community_question_id;column:community_question_id;type:int(10) unsigned;not null;default:0" json:"communityQuestionId"` // 问答ID
	SourceAgent                  int8      `gorm:"column:source_agent;type:tinyint(1);not null;default:0" json:"sourceAgent"`                                                        // 点赞/吐槽入口来源，1：小程序，2：小程序pc, 4：web pc
	Source                       int8      `gorm:"column:source;type:tinyint(4);not null;default:1" json:"source"`                                                                   // 来源：1-问答社区(默认); 2-视频社区
}

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

// YbCommunityQuestionLikeTeaseColumns get sql column name.获取数据库列名
var YbCommunityQuestionLikeTeaseColumns = struct {
	CommunityQuestionLikeTeaseID string
	UserID                       string
	OpType                       string
	Enabled                      string
	CreateTime                   string
	ModifyTime                   string
	CommunityQuestionID          string
	SourceAgent                  string
	Source                       string
}{
	CommunityQuestionLikeTeaseID: "community_question_like_tease_id",
	UserID:                       "user_id",
	OpType:                       "op_type",
	Enabled:                      "enabled",
	CreateTime:                   "create_time",
	ModifyTime:                   "modify_time",
	CommunityQuestionID:          "community_question_id",
	SourceAgent:                  "source_agent",
	Source:                       "source",
}

const (
	SourceQuestion  = iota + 1 // 问答社区->1
	SourceVideo                // 视频社区->2
	SourceRoadVideo            // 路演视频->3
)
