77 lines
3.1 KiB
Go
77 lines
3.1 KiB
Go
package database
|
||
|
||
import (
|
||
"time"
|
||
)
|
||
|
||
// OfficialAccount 公众号信息
|
||
type OfficialAccount struct {
|
||
ID int64 `json:"id"`
|
||
Biz string `json:"biz"` // 公众号唯一标识
|
||
Nickname string `json:"nickname"` // 公众号名称
|
||
Homepage string `json:"homepage"` // 公众号主页链接
|
||
Description string `json:"description"` // 公众号描述
|
||
CreatedAt time.Time `json:"created_at"` // 创建时间
|
||
UpdatedAt time.Time `json:"updated_at"` // 更新时间
|
||
}
|
||
|
||
// Article 文章信息
|
||
type Article struct {
|
||
ID int64 `json:"id"`
|
||
OfficialID int64 `json:"official_id"` // 关联的公众号ID
|
||
Title string `json:"title"` // 文章标题
|
||
Author string `json:"author"` // 作者
|
||
Link string `json:"link"` // 文章链接
|
||
PublishTime string `json:"publish_time"` // 发布时间
|
||
CreateTime string `json:"create_time"` // 创建时间(抓取时间)
|
||
CommentID string `json:"comment_id"` // 评论ID
|
||
ReadNum int `json:"read_num"` // 阅读数
|
||
LikeNum int `json:"like_num"` // 点赞数
|
||
ShareNum int `json:"share_num"` // 分享数
|
||
ContentPreview string `json:"content_preview"` // 内容预览(前200字)
|
||
ParagraphCount int `json:"paragraph_count"` // 段落数
|
||
CreatedAt time.Time `json:"created_at"` // 数据库创建时间
|
||
UpdatedAt time.Time `json:"updated_at"` // 数据库更新时间
|
||
}
|
||
|
||
// ArticleContent 文章详细内容
|
||
type ArticleContent struct {
|
||
ID int64 `json:"id"`
|
||
ArticleID int64 `json:"article_id"` // 关联的文章ID
|
||
HtmlContent string `json:"html_content"` // HTML原始内容
|
||
TextContent string `json:"text_content"` // 纯文本内容
|
||
Paragraphs string `json:"paragraphs"` // 段落内容(JSON数组)
|
||
Images string `json:"images"` // 图片链接(JSON数组)
|
||
CreatedAt time.Time `json:"created_at"` // 创建时间
|
||
}
|
||
|
||
// ArticleListItem 文章列表项(用于API返回)
|
||
type ArticleListItem struct {
|
||
ID int64 `json:"id"`
|
||
Title string `json:"title"`
|
||
Author string `json:"author"`
|
||
PublishTime string `json:"publish_time"`
|
||
ReadNum int `json:"read_num"`
|
||
LikeNum int `json:"like_num"`
|
||
OfficialName string `json:"official_name"`
|
||
ContentPreview string `json:"content_preview"`
|
||
}
|
||
|
||
// ArticleDetail 文章详情(用于API返回)
|
||
type ArticleDetail struct {
|
||
Article
|
||
OfficialName string `json:"official_name"`
|
||
HtmlContent string `json:"html_content"`
|
||
TextContent string `json:"text_content"`
|
||
Paragraphs []string `json:"paragraphs"`
|
||
Images []string `json:"images"`
|
||
}
|
||
|
||
// Statistics 统计信息
|
||
type Statistics struct {
|
||
TotalOfficials int `json:"total_officials"` // 公众号总数
|
||
TotalArticles int `json:"total_articles"` // 文章总数
|
||
TotalReadNum int `json:"total_read_num"` // 总阅读数
|
||
TotalLikeNum int `json:"total_like_num"` // 总点赞数
|
||
}
|