feat: 文章属性前端完成 — Phase 3
- 写文章页:可见性/类型/转载来源/创作声明/禁止转载 属性表单 - 类型切换联动(转载显示来源,原创显示禁止转载复选框) - 文章详情页:私密角标、置顶标记、创作声明横幅、转载来源 - 管理后台:置顶/取消置顶操作按钮 - PostService Create/Update 签名扩展接受文章属性 - DTO/接口同步更新
This commit is contained in:
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// Update 编辑帖子(权限在 controller 层检查)
|
||||
func (s *PostService) Update(postID uint, title, body string) error {
|
||||
func (s *PostService) Update(postID uint, title, body string, visibility, postType, reprintSource, declaration string, reprintProhibited bool) error {
|
||||
post, err := s.findPost(postID)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -16,6 +16,13 @@ func (s *PostService) Update(postID uint, title, body string) error {
|
||||
return common.ErrPostCannotEdit
|
||||
}
|
||||
|
||||
// 文章属性随时可更新(不影响已发布内容展示)
|
||||
post.Visibility = visibility
|
||||
post.PostType = postType
|
||||
post.ReprintSource = reprintSource
|
||||
post.Declaration = declaration
|
||||
post.ReprintProhibited = reprintProhibited
|
||||
|
||||
// 已通过帖子:编辑内容保存为待审修订,不影响当前展示
|
||||
if post.Status == model.PostStatusApproved {
|
||||
post.PendingTitle = title
|
||||
|
||||
Reference in New Issue
Block a user