feat: 编辑器与帖子展示布局优化 + 新增个人空间
- 编辑器投稿页布局优化:标题与编辑器高度动态适配,工具栏与内容区视觉对齐 - 稿件展示页布局优化:MD 渲染区与评论区视觉分离,代码块主题微调 - CSRF 中间件:图像上传端点豁免,解决 Vditor 拖拽/粘贴上传 403 - Post 状态映射、GetGinUser、SaveUploadedFile 提取至 common 包,遵循审计建议 - 新增个人空间功能:/space(需登录)重定向到 /space/:uid,/space/:uid 公开访问 - 空间页模板:参考 B 站布局,展示头像、用户名、个性签名、UID、加入时间及稿件列表 - 导航栏:用户名链接指向 /space,新增「设置」入口 - 分层实现:SpaceController → SpaceService → PostRepo.FindByUserID,严格 ISP 接口隔离
This commit is contained in:
@ -20,4 +20,37 @@ type CheckEmailRequest struct {
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
}
|
||||
|
||||
// ---- Post DTOs ----
|
||||
|
||||
// PostListResult 帖子列表查询结果
|
||||
type PostListResult struct {
|
||||
Items []Post `json:"items"`
|
||||
Total int64 `json:"total"`
|
||||
Page int `json:"page"`
|
||||
TotalPages int `json:"total_pages"`
|
||||
}
|
||||
|
||||
// PostCreateRequest 发帖请求
|
||||
type PostCreateRequest struct {
|
||||
Title string `json:"title" binding:"required,min=1,max=200"`
|
||||
Body string `json:"body" binding:"required,min=1"`
|
||||
}
|
||||
|
||||
// PostUpdateRequest 编辑请求
|
||||
type PostUpdateRequest struct {
|
||||
Title string `json:"title" binding:"required,min=1,max=200"`
|
||||
Body string `json:"body" binding:"required,min=1"`
|
||||
}
|
||||
|
||||
// PostRejectRequest 退回请求
|
||||
type PostRejectRequest struct {
|
||||
Reason string `json:"reason" binding:"required,min=1,max=500"`
|
||||
}
|
||||
|
||||
// PostListQuery 列表查询参数
|
||||
type PostListQuery struct {
|
||||
Keyword string `form:"keyword"`
|
||||
Status string `form:"status"`
|
||||
Page int `form:"page"`
|
||||
PageSize int `form:"page_size"`
|
||||
}
|
||||
Reference in New Issue
Block a user