model

package
v0.0.0-...-115e584 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2021 License: Apache-2.0, GPL-3.0, GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Models = []interface{}{
	&User{}, &UserToken{}, &Tag{}, &Article{}, &ArticleTag{}, &Comment{}, &Favorite{}, &Topic{}, &TopicNode{},
	&TopicTag{}, &UserLike{}, &Message{}, &SysConfig{}, &Project{}, &Link{}, &ThirdAccount{},
	&UserScoreLog{}, &OperateLog{}, &EmailCode{}, &CheckIn{},
}

Functions

This section is empty.

Types

type ActionLink struct {
	Title string `json:"title"`
	Url   string `json:"url"`
}

站点导航

type Article

type Article struct {
	Model
	UserId      int64  `gorm:"index:idx_article_user_id" json:"userId" form:"userId"`             // 所属用户编号
	Title       string `gorm:"size:128;not null;" json:"title" form:"title"`                      // 标题
	Summary     string `gorm:"type:text" json:"summary" form:"summary"`                           // 摘要
	Content     string `gorm:"type:longtext;not null;" json:"content" form:"content"`             // 内容
	ContentType string `gorm:"type:varchar(32);not null" json:"contentType" form:"contentType"`   // 内容类型:markdown、html
	Status      int    `gorm:"type:int(11);index:idx_article_status" json:"status" form:"status"` // 状态
	Share       bool   `gorm:"not null" json:"share" form:"share"`                                // 是否是分享的文章,如果是这里只会显示文章摘要,原文需要跳往原链接查看
	SourceUrl   string `gorm:"type:text" json:"sourceUrl" form:"sourceUrl"`                       // 原文链接
	ViewCount   int64  `gorm:"not null;index:idx_view_count;" json:"viewCount" form:"viewCount"`  // 查看数量
	CreateTime  int64  `gorm:"index:idx_article_create_time" json:"createTime" form:"createTime"` // 创建时间
	UpdateTime  int64  `json:"updateTime" form:"updateTime"`                                      // 更新时间
}

文章

type ArticleResponse

type ArticleResponse struct {
	ArticleSimpleResponse
	Content string `json:"content"`
}

type ArticleSimpleResponse

type ArticleSimpleResponse struct {
	ArticleId  int64          `json:"articleId"`
	User       *UserInfo      `json:"user"`
	Tags       *[]TagResponse `json:"tags"`
	Title      string         `json:"title"`
	Summary    string         `json:"summary"`
	SourceUrl  string         `json:"sourceUrl"`
	ViewCount  int64          `json:"viewCount"`
	CreateTime int64          `json:"createTime"`
	Status     int            `json:"status"`
}

type ArticleTag

type ArticleTag struct {
	Model
	ArticleId  int64 `gorm:"not null;index:idx_article_id;" json:"articleId" form:"articleId"`  // 文章编号
	TagId      int64 `gorm:"not null;index:idx_article_tag_tag_id;" json:"tagId" form:"tagId"`  // 标签编号
	Status     int64 `gorm:"not null;index:idx_article_tag_status" json:"status" form:"status"` // 状态:正常、删除
	CreateTime int64 `json:"createTime" form:"createTime"`                                      // 创建时间
}

文章标签

type CheckIn

type CheckIn struct {
	Model
	UserId          int64 `gorm:"not null;uniqueIndex:idx_user_id" json:"userId" form:"userId"` // 用户编号
	LatestDayName   int   `gorm:"not null;index:idx_latest" json:"dayName" form:"dayName"`      // 最后一次签到
	ConsecutiveDays int   `gorm:"not null;" json:"consecutiveDays" form:"consecutiveDays"`      // 连续签到天数
	CreateTime      int64 `json:"createTime" form:"createTime"`                                 // 创建时间
	UpdateTime      int64 `gorm:"index:idx_latest" json:"updateTime" form:"updateTime"`         // 更新时间
}

签到

type Comment

type Comment struct {
	Model
	UserId      int64  `gorm:"index:idx_comment_user_id;not null" json:"userId" form:"userId"`             // 用户编号
	EntityType  string `gorm:"index:idx_comment_entity_type;not null" json:"entityType" form:"entityType"` // 被评论实体类型
	EntityId    int64  `gorm:"index:idx_comment_entity_id;not null" json:"entityId" form:"entityId"`       // 被评论实体编号
	Content     string `gorm:"type:text;not null" json:"content" form:"content"`                           // 内容
	ContentType string `gorm:"type:varchar(32);not null" json:"contentType" form:"contentType"`            // 内容类型:markdown、html
	QuoteId     int64  `gorm:"not null"  json:"quoteId" form:"quoteId"`                                    // 引用的评论编号
	Status      int    `gorm:"int;index:idx_comment_status" json:"status" form:"status"`                   // 状态:0:待审核、1:审核通过、2:审核失败、3:已发布
	CreateTime  int64  `json:"createTime" form:"createTime"`                                               // 创建时间
}

评论

type CommentResponse

type CommentResponse struct {
	CommentId  int64            `json:"commentId"`
	User       *UserInfo        `json:"user"`
	EntityType string           `json:"entityType"`
	EntityId   int64            `json:"entityId"`
	Content    string           `json:"content"`
	QuoteId    int64            `json:"quoteId"`
	Quote      *CommentResponse `json:"quote"`
	Status     int              `json:"status"`
	CreateTime int64            `json:"createTime"`
}

CommentResponse 评论返回数据

type CreateArticleForm

type CreateArticleForm struct {
	Title       string
	Summary     string
	Content     string
	ContentType string
	Tags        []string
	SourceUrl   string
}

type CreateCommentForm

type CreateCommentForm struct {
	EntityType  string `form:"entityType"`
	EntityId    int64  `form:"entityId"`
	Content     string `form:"content"`
	QuoteId     int64  `form:"quoteId"`
	ContentType string `form:"contentType"`
}

CreateCommentForm 发表评论

type CreateTopicForm

type CreateTopicForm struct {
	Type        constants.TopicType
	CaptchaId   string
	CaptchaCode string
	NodeId      int64
	Title       string
	Content     string
	Tags        []string
	ImageList   []ImageDTO
}

func GetCreateTopicForm

func GetCreateTopicForm(ctx iris.Context) CreateTopicForm

type EmailCode

type EmailCode struct {
	Model
	UserId     int64  `gorm:"not null;index:idx_user_score_log_user_id" json:"userId" form:"userId"` // 用户编号
	Email      string `gorm:"not null;size:128" json:"email" form:"email"`                           // 邮箱
	Code       string `gorm:"not null;size:8" json:"code" form:"code"`                               // 验证码
	Token      string `gorm:"not null;size:32;unique" json:"token" form:"token"`                     // 验证码token
	Title      string `gorm:"size:1024" json:"title" form:"title"`                                   // 标题
	Content    string `gorm:"type:text" json:"content" form:"content"`                               // 内容
	Used       bool   `gorm:"not null" json:"used" form:"used"`                                      // 是否使用
	CreateTime int64  `json:"createTime" form:"createTime"`                                          // 创建时间
}

邮箱验证码

type Favorite

type Favorite struct {
	Model
	UserId     int64  `gorm:"index:idx_favorite_user_id;not null" json:"userId" form:"userId"`                     // 用户编号
	EntityType string `gorm:"index:idx_favorite_entity_type;size:32;not null" json:"entityType" form:"entityType"` // 收藏实体类型
	EntityId   int64  `gorm:"index:idx_favorite_entity_id;not null" json:"entityId" form:"entityId"`               // 收藏实体编号
	CreateTime int64  `json:"createTime" form:"createTime"`                                                        // 创建时间
}

收藏

type FavoriteResponse

type FavoriteResponse struct {
	FavoriteId int64     `json:"favoriteId"`
	EntityType string    `json:"entityType"`
	EntityId   int64     `json:"entityId"`
	Deleted    bool      `json:"deleted"`
	Title      string    `json:"title"`
	Content    string    `json:"content"`
	User       *UserInfo `json:"user"`
	Url        string    `json:"url"`
	CreateTime int64     `json:"createTime"`
}

收藏返回数据

type ImageDTO

type ImageDTO struct {
	Url string `json:"url"`
}

type ImageInfo

type ImageInfo struct {
	Url     string `json:"url"`
	Preview string `json:"preview"`
}

图片

type Link struct {
	Model
	Url        string `gorm:"not null;type:text" json:"url" form:"url"`     // 链接
	Title      string `gorm:"not null;size:128" json:"title" form:"title"`  // 标题
	Summary    string `gorm:"size:1024" json:"summary" form:"summary"`      // 站点描述
	Status     int    `gorm:"not null" json:"status" form:"status"`         // 状态
	CreateTime int64  `gorm:"not null" json:"createTime" form:"createTime"` // 创建时间
}

友链

type LoginMethod

type LoginMethod struct {
	Password bool `json:"password"`
	QQ       bool `json:"qq"`
	Github   bool `json:"github"`
	Osc      bool `json:"osc"`
}

type Message

type Message struct {
	Model
	FromId       int64  `gorm:"not null" json:"fromId" form:"fromId"`                            // 消息发送人
	UserId       int64  `gorm:"not null;index:idx_message_user_id;" json:"userId" form:"userId"` // 用户编号(消息接收人)
	Title        string `gorm:"size:1024" json:"title" form:"title"`                             // 消息标题
	Content      string `gorm:"type:text;not null" json:"content" form:"content"`                // 消息内容
	QuoteContent string `gorm:"type:text" json:"quoteContent" form:"quoteContent"`               // 引用内容
	Type         int    `gorm:"not null" json:"type" form:"type"`                                // 消息类型
	ExtraData    string `gorm:"type:text" json:"extraData" form:"extraData"`                     // 扩展数据
	Status       int    `gorm:"not null" json:"status" form:"status"`                            // 状态:0:未读、1:已读
	CreateTime   int64  `json:"createTime" form:"createTime"`                                    // 创建时间
}

消息

type MessageResponse

type MessageResponse struct {
	MessageId    int64     `json:"messageId"`
	From         *UserInfo `json:"from"`    // 消息发送人
	UserId       int64     `json:"userId"`  // 消息接收人编号
	Title        string    `json:"title"`   // 标题
	Content      string    `json:"content"` // 消息内容
	QuoteContent string    `json:"quoteContent"`
	Type         int       `json:"type"`
	DetailUrl    string    `json:"detailUrl"` // 消息详情url
	ExtraData    string    `json:"extraData"`
	Status       int       `json:"status"`
	CreateTime   int64     `json:"createTime"`
}

消息

type Model

type Model struct {
	Id int64 `gorm:"primaryKey;autoIncrement" json:"id" form:"id"`
}

type NodeResponse

type NodeResponse struct {
	NodeId      int64  `json:"nodeId"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type OperateLog

type OperateLog struct {
	Model
	UserId      int64  `gorm:"not null;index:idx_operate_log_user_id" json:"userId" form:"userId"`  // 用户编号
	OpType      string `gorm:"not null;index:idx_op_type;size:32" json:"opType" form:"opType"`      // 操作类型
	DataType    string `gorm:"not null;index:idx_operate_log_data" json:"dataType" form:"dataType"` // 数据类型
	DataId      int64  `gorm:"not null;index:idx_operate_log_data" json:"dataId" form:"dataId" `    // 数据编号
	Description string `gorm:"not null;size:1024" json:"description" form:"description"`            // 描述
	Ip          string `gorm:"size:128" json:"ip" form:"ip"`                                        // ip地址
	UserAgent   string `gorm:"type:text" json:"userAgent" form:"userAgent"`                         // UserAgent
	Referer     string `gorm:"type:text" json:"referer" form:"referer"`                             // Referer
	CreateTime  int64  `json:"createTime" form:"createTime"`                                        // 创建时间
}

操作日志

type Project

type Project struct {
	Model
	UserId      int64  `gorm:"not null" json:"userId" form:"userId"`
	Name        string `gorm:"type:varchar(1024)" json:"name" form:"name"`
	Title       string `gorm:"type:text" json:"title" form:"title"`
	Url         string `gorm:"type:varchar(1024)" json:"url" form:"url"`
	DocUrl      string `gorm:"type:varchar(1024)" json:"docUrl" form:"docUrl"`
	DownloadUrl string `gorm:"type:varchar(1024)" json:"downloadUrl" form:"downloadUrl"`
	ContentType string `gorm:"type:varchar(32);" json:"contentType" form:"contentType"`
	Content     string `gorm:"type:longtext" json:"content" form:"content"`
	CreateTime  int64  `gorm:"index:idx_project_create_time" json:"createTime" form:"createTime"`
}

开源项目

type ProjectResponse

type ProjectResponse struct {
	ProjectSimpleResponse
	Content string `json:"content"`
}

项目详情

type ProjectSimpleResponse

type ProjectSimpleResponse struct {
	ProjectId   int64     `json:"projectId"`
	User        *UserInfo `json:"user"`
	Name        string    `json:"name"`
	Title       string    `json:"title"`
	Url         string    `json:"url"`
	DocUrl      string    `json:"docUrl"`
	DownloadUrl string    `json:"downloadUrl"`
	Summary     string    `json:"summary"`
	CreateTime  int64     `json:"createTime"`
}

项目简单返回

type ScoreConfig

type ScoreConfig struct {
	PostTopicScore   int `json:"postTopicScore"`   // 发帖获得积分
	PostCommentScore int `json:"postCommentScore"` // 跟帖获得积分
	CheckInScore     int `json:"checkInScore"`     // 签到积分
}

积分配置

type SearchTopicResponse

type SearchTopicResponse struct {
	TopicId    int64          `json:"topicId"`
	User       *UserInfo      `json:"user"`
	Node       *NodeResponse  `json:"node"`
	Tags       *[]TagResponse `json:"tags"`
	Title      string         `json:"title"`
	Summary    string         `json:"summary"`
	CreateTime int64          `json:"createTime"`
}

type SysConfig

type SysConfig struct {
	Model
	Key         string `gorm:"not null;size:128;unique" json:"key" form:"key"` // 配置key
	Value       string `gorm:"type:text" json:"value" form:"value"`            // 配置值
	Name        string `gorm:"not null;size:32" json:"name" form:"name"`       // 配置名称
	Description string `gorm:"size:128" json:"description" form:"description"` // 配置描述
	CreateTime  int64  `gorm:"not null" json:"createTime" form:"createTime"`   // 创建时间
	UpdateTime  int64  `gorm:"not null" json:"updateTime" form:"updateTime"`   // 更新时间
}

系统配置

type SysConfigResponse

type SysConfigResponse struct {
	SiteTitle                  string       `json:"siteTitle"`
	SiteDescription            string       `json:"siteDescription"`
	SiteKeywords               []string     `json:"siteKeywords"`
	SiteNavs                   []ActionLink `json:"siteNavs"`
	SiteNotification           string       `json:"siteNotification"`
	RecommendTags              []string     `json:"recommendTags"`
	UrlRedirect                bool         `json:"urlRedirect"`
	ScoreConfig                ScoreConfig  `json:"scoreConfig"`
	DefaultNodeId              int64        `json:"defaultNodeId"`
	ArticlePending             bool         `json:"articlePending"`
	TopicCaptcha               bool         `json:"topicCaptcha"`
	UserObserveSeconds         int          `json:"userObserveSeconds"`
	TokenExpireDays            int          `json:"tokenExpireDays"`
	LoginMethod                LoginMethod  `json:"loginMethod"`
	CreateTopicEmailVerified   bool         `json:"createTopicEmailVerified"`
	CreateArticleEmailVerified bool         `json:"createArticleEmailVerified"`
	CreateCommentEmailVerified bool         `json:"createCommentEmailVerified"`
}

SysConfigResponse 配置返回结构体

type Tag

type Tag struct {
	Model
	Name        string `gorm:"size:32;unique;not null" json:"name" form:"name"`
	Description string `gorm:"size:1024" json:"description" form:"description"`
	Status      int    `gorm:"index:idx_tag_status;not null" json:"status" form:"status"`
	CreateTime  int64  `json:"createTime" form:"createTime"`
	UpdateTime  int64  `json:"updateTime" form:"updateTime"`
}

标签

type TagResponse

type TagResponse struct {
	TagId   int64  `json:"tagId"`
	TagName string `json:"tagName"`
}

type ThirdAccount

type ThirdAccount struct {
	Model
	UserId     sql.NullInt64 `gorm:"uniqueIndex:idx_user_id_third_type;" json:"userId" form:"userId"`                                  // 用户编号
	Avatar     string        `gorm:"size:1024" json:"avatar" form:"avatar"`                                                            // 头像
	Nickname   string        `gorm:"size:32" json:"nickname" form:"nickname"`                                                          // 昵称
	ThirdType  string        `gorm:"size:32;not null;uniqueIndex:idx_user_id_third_type,idx_third;" json:"thirdType" form:"thirdType"` // 第三方类型
	ThirdId    string        `gorm:"size:64;not null;uniqueIndex:idx_third;" json:"thirdId" form:"thirdId"`                            // 第三方唯一标识,例如:openId,unionId
	ExtraData  string        `gorm:"type:longtext" json:"extraData" form:"extraData"`                                                  // 扩展数据
	CreateTime int64         `json:"createTime" form:"createTime"`                                                                     // 创建时间
	UpdateTime int64         `json:"updateTime" form:"updateTime"`                                                                     // 更新时间
}

type Topic

type Topic struct {
	Model
	Type              constants.TopicType `gorm:"type:int;not null:default:0" json:"type" form:"type"`                             // 类型
	NodeId            int64               `gorm:"not null;index:idx_node_id;" json:"nodeId" form:"nodeId"`                         // 节点编号
	UserId            int64               `gorm:"not null;index:idx_topic_user_id;" json:"userId" form:"userId"`                   // 用户
	Title             string              `gorm:"size:128" json:"title" form:"title"`                                              // 标题
	Content           string              `gorm:"type:longtext" json:"content" form:"content"`                                     // 内容
	ImageList         string              `gorm:"type:longtext" json:"imageList" form:"imageList"`                                 // 图片
	Recommend         bool                `gorm:"not null;index:idx_recommend" json:"recommend" form:"recommend"`                  // 是否推荐
	RecommendTime     int64               `gorm:"not null" json:"recommendTime" form:"recommendTime"`                              // 推荐时间
	ViewCount         int64               `gorm:"not null" json:"viewCount" form:"viewCount"`                                      // 查看数量
	CommentCount      int64               `gorm:"not null" json:"commentCount" form:"commentCount"`                                // 跟帖数量
	LikeCount         int64               `gorm:"not null" json:"likeCount" form:"likeCount"`                                      // 点赞数量
	Status            int                 `gorm:"index:idx_topic_status;" json:"status" form:"status"`                             // 状态:0:正常、1:删除
	LastCommentTime   int64               `gorm:"index:idx_topic_last_comment_time" json:"lastCommentTime" form:"lastCommentTime"` // 最后回复时间
	LastCommentUserId int64               `json:"lastCommentUserId" form:"lastCommentUserId"`                                      // 最后回复用户
	CreateTime        int64               `gorm:"index:idx_topic_create_time" json:"createTime" form:"createTime"`                 // 创建时间
	ExtraData         string              `gorm:"type:text" json:"extraData" form:"extraData"`                                     // 扩展数据
}

话题节点

func (*Topic) GetTitle

func (t *Topic) GetTitle() string

GetTitle 获取帖子的标题

type TopicNode

type TopicNode struct {
	Model
	Name        string `gorm:"size:32;unique" json:"name" form:"name"`          // 名称
	Description string `gorm:"size:1024" json:"description" form:"description"` // 描述
	SortNo      int    `gorm:"index:idx_sort_no" json:"sortNo" form:"sortNo"`   // 排序编号
	Status      int    `gorm:"not null" json:"status" form:"status"`            // 状态
	CreateTime  int64  `json:"createTime" form:"createTime"`                    // 创建时间
}

TopicNode 话题节点

type TopicResponse

type TopicResponse struct {
	TopicId         int64               `json:"topicId"`
	Type            constants.TopicType `json:"type"`
	User            *UserInfo           `json:"user"`
	Node            *NodeResponse       `json:"node"`
	Tags            *[]TagResponse      `json:"tags"`
	Title           string              `json:"title"`
	Summary         string              `json:"summary"`
	Content         string              `json:"content"`
	ImageList       []ImageInfo         `json:"imageList"`
	LastCommentTime int64               `json:"lastCommentTime"`
	ViewCount       int64               `json:"viewCount"`
	CommentCount    int64               `json:"commentCount"`
	LikeCount       int64               `json:"likeCount"`
	Liked           bool                `json:"liked"`
	CreateTime      int64               `json:"createTime"`
	Recommend       bool                `json:"recommend"`
	RecommendTime   int64               `json:"recommendTime"`
}

帖子列表返回实体

type TopicTag

type TopicTag struct {
	Model
	TopicId           int64 `gorm:"not null;index:idx_topic_tag_topic_id;" json:"topicId" form:"topicId"`                // 主题编号
	TagId             int64 `gorm:"not null;index:idx_topic_tag_tag_id;" json:"tagId" form:"tagId"`                      // 标签编号
	Status            int64 `gorm:"not null;index:idx_topic_tag_status" json:"status" form:"status"`                     // 状态:正常、删除
	LastCommentTime   int64 `gorm:"index:idx_topic_tag_last_comment_time" json:"lastCommentTime" form:"lastCommentTime"` // 最后回复时间
	LastCommentUserId int64 `json:"lastCommentUserId" form:"lastCommentUserId"`                                          // 最后回复用户
	CreateTime        int64 `json:"createTime" form:"createTime"`                                                        // 创建时间
}

主题标签

type TweetResponse

type TweetResponse struct {
	TweetId      int64       `json:"tweetId"`
	User         *UserInfo   `json:"user"`
	Content      string      `json:"content"`
	ImageList    []ImageInfo `json:"imageList"`
	CommentCount int64       `json:"commentCount"`
	LikeCount    int64       `json:"likeCount"`
	Status       int         `json:"status"`
	CreateTime   int64       `json:"createTime"`
}

帖子列表返回实体

type User

type User struct {
	Model
	Username         sql.NullString `gorm:"size:32;unique;" json:"username" form:"username"`                    // 用户名
	Email            sql.NullString `gorm:"size:128;unique;" json:"email" form:"email"`                         // 邮箱
	EmailVerified    bool           `gorm:"not null;default:false" json:"emailVerified" form:"emailVerified"`   // 邮箱是否验证
	Nickname         string         `gorm:"size:16;" json:"nickname" form:"nickname"`                           // 昵称
	Avatar           string         `gorm:"type:text" json:"avatar" form:"avatar"`                              // 头像
	BackgroundImage  string         `gorm:"type:text" json:"backgroundImage" form:"backgroundImage"`            // 个人中心背景图片
	Password         string         `gorm:"size:512" json:"password" form:"password"`                           // 密码
	HomePage         string         `gorm:"size:1024" json:"homePage" form:"homePage"`                          // 个人主页
	Description      string         `gorm:"type:text" json:"description" form:"description"`                    // 个人描述
	Score            int            `gorm:"not null;index:idx_user_score" json:"score" form:"score"`            // 积分
	Status           int            `gorm:"index:idx_user_status;not null" json:"status" form:"status"`         // 状态
	TopicCount       int            `gorm:"not null" json:"topicCount" form:"topicCount"`                       // 帖子数量
	CommentCount     int            `gorm:"not null" json:"commentCount" form:"commentCount"`                   // 跟帖数量
	Roles            string         `gorm:"type:text" json:"roles" form:"roles"`                                // 角色
	Type             int            `gorm:"not null" json:"type" form:"type"`                                   // 用户类型
	ForbiddenEndTime int64          `gorm:"not null;default:0" json:"forbiddenEndTime" form:"forbiddenEndTime"` // 禁言结束时间
	CreateTime       int64          `json:"createTime" form:"createTime"`                                       // 创建时间
	UpdateTime       int64          `json:"updateTime" form:"updateTime"`                                       // 更新时间
}

func (*User) GetRoles

func (u *User) GetRoles() []string

GetRoles 获取角色

func (*User) HasAnyRole

func (u *User) HasAnyRole(roles ...string) bool

HasAnyRole 是否有指定的任意角色

func (*User) HasRole

func (u *User) HasRole(role string) bool

HasRole 是否有指定角色

func (*User) InObservationPeriod

func (u *User) InObservationPeriod(observeSeconds int) bool

InObservationPeriod 是否在观察期 observeSeconds 观察时长

func (*User) IsForbidden

func (u *User) IsForbidden() bool

IsForbidden 是否禁言

type UserInfo

type UserInfo struct {
	Id                   int64    `json:"id"`
	Username             string   `json:"username"`
	Email                string   `json:"email"`
	EmailVerified        bool     `json:"emailVerified"`
	Nickname             string   `json:"nickname"`
	Avatar               string   `json:"avatar"`
	SmallAvatar          string   `json:"smallAvatar"`
	BackgroundImage      string   `json:"backgroundImage"`
	SmallBackgroundImage string   `json:"smallBackgroundImage"`
	Type                 int      `json:"type"`
	Roles                []string `json:"roles"`
	HomePage             string   `json:"homePage"`
	Description          string   `json:"description"`
	Score                int      `json:"score"`        // 积分
	TopicCount           int      `json:"topicCount"`   // 话题数量
	CommentCount         int      `json:"commentCount"` // 跟帖数量
	PasswordSet          bool     `json:"passwordSet"`  // 密码已设置
	Forbidden            bool     `json:"forbidden"`    // 是否禁言
	Status               int      `json:"status"`
	CreateTime           int64    `json:"createTime"`
}

type UserLike

type UserLike struct {
	Model
	UserId     int64  `gorm:"not null;uniqueIndex:idx_user_like_unique;" json:"userId" form:"userId"`                                            // 用户
	EntityType string `gorm:"not null;size:32;uniqueIndex:idx_user_like_unique;index:idx_user_like_entity;" json:"entityType" form:"entityType"` // 实体类型
	EntityId   int64  `gorm:"not null;uniqueIndex:idx_user_like_unique;index:idx_user_like_entity;" json:"topicId" form:"topicId"`               // 实体编号
	CreateTime int64  `json:"createTime" form:"createTime"`                                                                                      // 创建时间
}

用户点赞

type UserScoreLog

type UserScoreLog struct {
	Model
	UserId      int64  `gorm:"not null;index:idx_user_score_log_user_id" json:"userId" form:"userId"`   // 用户编号
	SourceType  string `gorm:"not null;index:idx_user_score_score" json:"sourceType" form:"sourceType"` // 积分来源类型
	SourceId    string `gorm:"not null;index:idx_user_score_score" json:"sourceId" form:"sourceId"`     // 积分来源编号
	Description string `json:"description" form:"description"`                                          // 描述
	Type        int    `json:"type" form:"type"`                                                        // 类型(增加、减少)
	Score       int    `json:"score" form:"score"`                                                      // 积分
	CreateTime  int64  `json:"createTime" form:"createTime"`                                            // 创建时间
}

用户积分流水

type UserToken

type UserToken struct {
	Model
	Token      string `gorm:"size:32;unique;not null" json:"token" form:"token"`
	UserId     int64  `gorm:"not null;index:idx_user_token_user_id;" json:"userId" form:"userId"`
	ExpiredAt  int64  `gorm:"not null" json:"expiredAt" form:"expiredAt"`
	Status     int    `gorm:"not null;index:idx_user_token_status" json:"status" form:"status"`
	CreateTime int64  `gorm:"not null" json:"createTime" form:"createTime"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL