mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-05 16:56:22 +00:00
⚡️ feat: update global styles and color variables for improved theming
refactor: change import paths for DeviceContext and GravatarAvatar components fix: adjust login form API call and update UI text for clarity feat: add post API for listing posts with pagination and filtering options feat: implement BlogCard component for displaying blog posts with enhanced UI feat: create Badge component for consistent styling of labels and indicators refactor: reintroduce DeviceContext with improved functionality for theme and language management feat: define Label and Post models for better type safety and structure
This commit is contained in:
@ -1,22 +1,30 @@
|
||||
package dto
|
||||
|
||||
import "time"
|
||||
|
||||
type PostDto struct {
|
||||
ID uint `json:"id"` // 帖子ID
|
||||
UserID uint `json:"user_id"` // 发布者的用户ID
|
||||
Title string `json:"title"` // 帖子标题
|
||||
Content string `json:"content"`
|
||||
Cover string `json:"cover"` // 帖子封面图
|
||||
Type string `json:"type"` // 帖子类型 markdown / html / text
|
||||
Labels []LabelDto `json:"labels"` // 关联的标签
|
||||
IsPrivate bool `json:"is_private"` // 是否为私密帖子
|
||||
LikeCount uint64 `json:"like_count"` // 点赞数
|
||||
CommentCount uint64 `json:"comment_count"` // 评论数
|
||||
ViewCount uint64 `json:"view_count"` // 浏览数
|
||||
Heat uint64 `json:"heat"` // 热度
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
type CreateOrUpdatePostReq struct {
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Cover string `json:"cover"`
|
||||
IsPrivate bool `json:"is_private"`
|
||||
Type string `json:"type"`
|
||||
Labels []uint `json:"labels"` // 标签ID列表
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user