Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = sqlx.ErrNotFound
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { Id int64 `db:"id"` // 主键ID Title string `db:"title"` // 标题 Content string `db:"content"` // 内容 Cover string `db:"cover"` // 封面 Description string `db:"description"` // 描述 AuthorId int64 `db:"author_id"` // 作者ID Status int64 `db:"status"` // 状态 0:待审核 1:审核不通过 2:可见 3:用户删除 CommentNum int64 `db:"comment_num"` // 评论数 LikeNum int64 `db:"like_num"` // 点赞数 CollectNum int64 `db:"collect_num"` // 收藏数 ViewNum int64 `db:"view_num"` // 浏览数 TagIds string `db:"tag_ids"` // 标签ID PublishTime time.Time `db:"publish_time"` // 发布时间 CreateTime time.Time `db:"create_time"` // 创建时间 UpdateTime time.Time `db:"update_time"` // 最后修改时间 }
type ArticleModel ¶
type ArticleModel interface { ArticlesByUserId(ctx context.Context, userId int64, status int, likeNum int64, pubTime, sortField string, limit int) ([]*Article, error) UpdateArticleStatus(ctx context.Context, id int64, status int) error // contains filtered or unexported methods }
ArticleModel is an interface to be customized, add more methods here, and implement the added methods in customArticleModel.
func NewArticleModel ¶
NewArticleModel returns a model for the database table.
Click to show internal directories.
Click to hide internal directories.