init: 初始化 web_hgdjb_server 项目
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,261 @@
|
||||
package proto
|
||||
|
||||
import "videoweb/pub/pubdef"
|
||||
|
||||
// -------- 公共站点数据 --------
|
||||
|
||||
// FriendlyLinkItem 友情链接
|
||||
type FriendlyLinkItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Url string `json:"url"`
|
||||
Sort int `json:"sort"`
|
||||
}
|
||||
|
||||
// ContactInfoItem 联系方式
|
||||
type ContactInfoItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Icon string `json:"icon"`
|
||||
Type int `json:"type"` // 1=邮箱 2=URL 3=文字
|
||||
Address string `json:"address"`
|
||||
Sort int `json:"sort"`
|
||||
}
|
||||
|
||||
// SiteCommonData 每个接口都会携带的通用站点信息
|
||||
type SiteCommonData struct {
|
||||
Config ConfigInfo `json:"config"`
|
||||
FriendlyLinks []*FriendlyLinkItem `json:"friendlyLinks"`
|
||||
ContactInfos []*ContactInfoItem `json:"contactInfos"`
|
||||
Advitise AdvitiseData `json:"advitise"`
|
||||
ToolCount int64 `json:"toolCount"` // 审核通过的工具总数
|
||||
}
|
||||
|
||||
// -------- 分类 --------
|
||||
|
||||
// ToolSubCategoryItem 子分类简要信息
|
||||
type ToolSubCategoryItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Name string `json:"name"`
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
SeoInfo pubdef.SeoValue `json:"seoInfo"`
|
||||
}
|
||||
|
||||
// ToolCategoryItem 主分类简要信息
|
||||
type ToolCategoryItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Name string `json:"name"`
|
||||
Icon string `json:"icon"`
|
||||
Sort int `json:"sort"`
|
||||
SeoInfo pubdef.SeoValue `json:"seoInfo"`
|
||||
SubCategories []*ToolSubCategoryItem `json:"subCategories"`
|
||||
}
|
||||
|
||||
// -------- 工具 --------
|
||||
|
||||
// ToolBriefItem 工具简要信息(列表卡片)
|
||||
type ToolBriefItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Logo string `json:"logo"`
|
||||
Snapshot string `json:"snapshot"`
|
||||
Intro string `json:"intro"`
|
||||
OfficialUrl string `json:"officialUrl"`
|
||||
Hot int64 `json:"hot"`
|
||||
}
|
||||
|
||||
// CategorySection 首页分类区块:分类标题 + 子分类列表 + 前10条工具
|
||||
type CategorySection struct {
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
CategorySlug string `json:"categorySlug"`
|
||||
CategoryName string `json:"categoryName"`
|
||||
CategoryIcon string `json:"categoryIcon"`
|
||||
CategorySort int `json:"categorySort"`
|
||||
SubCategories []*ToolSubCategoryItem `json:"subCategories"`
|
||||
Tools []*ToolBriefItem `json:"tools"`
|
||||
}
|
||||
|
||||
// ToolNodeItem 工具节点
|
||||
type ToolNodeItem struct {
|
||||
NodeId int64 `json:"nodeId"`
|
||||
Title string `json:"title"`
|
||||
Type int `json:"type"` // 1=文本 2=条目 3=QA 4=图片
|
||||
Content string `json:"content"` // JSON字符串,格式因类型而异
|
||||
Sort int `json:"sort"`
|
||||
ReviewStatus int `json:"reviewStatus"` // 0=待审核 1=通过 2=下架
|
||||
}
|
||||
|
||||
// ToolRecommendItem 推荐工具简要信息
|
||||
type ToolRecommendItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Intro string `json:"intro"`
|
||||
Logo string `json:"logo"`
|
||||
}
|
||||
|
||||
// ArticleRecommendItem 推荐文章简要信息
|
||||
type ArticleRecommendItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Intro string `json:"intro"`
|
||||
Cover string `json:"cover"`
|
||||
CreatedAt string `json:"createdAt"` // 格式:yyyy/MM/dd
|
||||
}
|
||||
|
||||
// ToolDetailItem 工具详情
|
||||
type ToolDetailItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
CategoryName string `json:"categoryName"`
|
||||
SubCateId int64 `json:"subCateId"`
|
||||
SubCateName string `json:"subCateName"`
|
||||
Title string `json:"title"`
|
||||
Logo string `json:"logo"`
|
||||
Snapshot string `json:"snapshot"`
|
||||
Intro string `json:"intro"`
|
||||
Desc string `json:"desc"`
|
||||
SeoInfo pubdef.SeoValue `json:"seoInfo"`
|
||||
OfficialUrl string `json:"officialUrl"`
|
||||
Hot int64 `json:"hot"`
|
||||
ViewCount int64 `json:"viewCount"`
|
||||
Nodes []*ToolNodeItem `json:"nodes"`
|
||||
RelatedTools []*ToolRecommendItem `json:"relatedTools"` // 相关推荐(优先同子分类,不足补其他分类)
|
||||
RecommendTools []*ToolRecommendItem `json:"recommendTools"` // 工具推荐(随机6个)
|
||||
RecommendArticles []*ArticleRecommendItem `json:"recommendArticles"` // 文章推荐(随机6个)
|
||||
CommentList GetCommentListResp `json:"commentList"` // 评论
|
||||
Categories []*ToolCategoryItem `json:"categories"` // 分类列表
|
||||
Site SiteCommonData `json:"site"`
|
||||
}
|
||||
|
||||
// -------- 文章 --------
|
||||
|
||||
// ArticleBriefItem 文章简要信息(列表卡片)
|
||||
type ArticleBriefItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Intro string `json:"intro"`
|
||||
Author string `json:"author"`
|
||||
AuthorAvatar string `json:"authorAvatar"`
|
||||
Cover string `json:"cover"`
|
||||
ViewCount int64 `json:"viewCount"`
|
||||
Sort int `json:"sort"`
|
||||
CreatedAt string `json:"createdAt"` // 格式:yyyy/MM/dd
|
||||
}
|
||||
|
||||
// ArticleNodeItem 文章节点
|
||||
type ArticleNodeItem struct {
|
||||
NodeId int64 `json:"nodeId"`
|
||||
Title string `json:"title"`
|
||||
Type int `json:"type"` // 1=文本 2=条目 3=QA 4=图片
|
||||
Content string `json:"content"` // JSON字符串,格式因类型而异
|
||||
Sort int `json:"sort"`
|
||||
}
|
||||
|
||||
// ArticleNavItem 文章导航(上一篇/下一篇)
|
||||
type ArticleNavItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
// ArticleDetailItem 文章详情
|
||||
type ArticleDetailItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Intro string `json:"intro"`
|
||||
Author string `json:"author"`
|
||||
AuthorAvatar string `json:"authorAvatar"`
|
||||
Cover string `json:"cover"`
|
||||
SeoInfo pubdef.SeoValue `json:"seoInfo"`
|
||||
ViewCount int64 `json:"viewCount"`
|
||||
Sort int `json:"sort"`
|
||||
ReviewStatus int `json:"reviewStatus"`
|
||||
CreatedAt string `json:"createdAt"` // 格式:yyyy/MM/dd
|
||||
Nodes []*ArticleNodeItem `json:"nodes"`
|
||||
Prev *ArticleNavItem `json:"prev"` // 上一篇(无则为 null)
|
||||
Next *ArticleNavItem `json:"next"` // 下一篇(无则为 null)
|
||||
RecommendTools []*ToolRecommendItem `json:"recommendTools"` // 工具推荐(随机6个)
|
||||
RecommendArticles []*ArticleRecommendItem `json:"recommendArticles"` // 文章推荐(随机6个)
|
||||
CommentList GetCommentListResp `json:"commentList"` // 评论
|
||||
Categories []*ToolCategoryItem `json:"categories"` // 分类列表
|
||||
Site SiteCommonData `json:"site"`
|
||||
}
|
||||
|
||||
// -------- 页面级响应 --------
|
||||
|
||||
// AIToolsHomeData 工具首页数据
|
||||
type AIToolsHomeData struct {
|
||||
Categories []*ToolCategoryItem `json:"categories"`
|
||||
HotTools []*ToolBriefItem `json:"hotTools"` // 热门推荐工具(按设置时间倒序)
|
||||
Sections []*CategorySection `json:"sections"`
|
||||
Articles []*ArticleBriefItem `json:"articles"`
|
||||
Site SiteCommonData `json:"site"`
|
||||
}
|
||||
|
||||
// AIToolsListData 工具列表页数据
|
||||
type AIToolsListData struct {
|
||||
Categories []*ToolCategoryItem `json:"categories"`
|
||||
Total int64 `json:"total"`
|
||||
List []*ToolBriefItem `json:"list"`
|
||||
Site SiteCommonData `json:"site"`
|
||||
}
|
||||
|
||||
// SearchArticleItem 搜索命中的文章
|
||||
type SearchArticleItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Intro string `json:"intro"`
|
||||
Author string `json:"author"`
|
||||
AuthorAvatar string `json:"authorAvatar"`
|
||||
Cover string `json:"cover"`
|
||||
CreatedAt string `json:"createdAt"` // 格式:yyyy/MM/dd
|
||||
Score float32 `json:"score"` // 相关度分数
|
||||
}
|
||||
|
||||
// SearchToolItem 搜索命中的工具
|
||||
type SearchToolItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Slug string `json:"slug"`
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
SubCateId int64 `json:"subCateId"`
|
||||
Title string `json:"title"`
|
||||
Logo string `json:"logo"`
|
||||
Snapshot string `json:"snapshot"`
|
||||
Intro string `json:"intro"`
|
||||
OfficialUrl string `json:"officialUrl"`
|
||||
Hot int64 `json:"hot"`
|
||||
Score float32 `json:"score"` // 相关度分数
|
||||
}
|
||||
|
||||
// AISearchData 搜索结果
|
||||
type AISearchData struct {
|
||||
Keyword string `json:"keyword"`
|
||||
Articles []*SearchArticleItem `json:"articles"`
|
||||
Tools []*SearchToolItem `json:"tools"`
|
||||
Site SiteCommonData `json:"site"`
|
||||
}
|
||||
|
||||
// AIRecommendData 推荐展示数据
|
||||
type AIRecommendData struct {
|
||||
Articles []*ArticleBriefItem `json:"articles"` // 随机2篇文章
|
||||
Tools []*ToolBriefItem `json:"tools"` // 随机20个工具
|
||||
Site SiteCommonData `json:"site"`
|
||||
}
|
||||
|
||||
// AIArticleListData 文章列表页数据
|
||||
type AIArticleListData struct {
|
||||
Categories []*ToolCategoryItem `json:"categories"`
|
||||
Total int64 `json:"total"`
|
||||
List []*ArticleBriefItem `json:"list"`
|
||||
Site SiteCommonData `json:"site"`
|
||||
RecommendTools []*ToolRecommendItem `json:"recommendTools"` // 工具推荐(随机6个)
|
||||
RecommendArticles []*ArticleRecommendItem `json:"recommendArticles"` // 文章推荐(随机6个)
|
||||
}
|
||||
Reference in New Issue
Block a user