feat: 文章属性前端完成 — Phase 3
- 写文章页:可见性/类型/转载来源/创作声明/禁止转载 属性表单 - 类型切换联动(转载显示来源,原创显示禁止转载复选框) - 文章详情页:私密角标、置顶标记、创作声明横幅、转载来源 - 管理后台:置顶/取消置顶操作按钮 - PostService Create/Update 签名扩展接受文章属性 - DTO/接口同步更新
This commit is contained in:
@ -42,9 +42,9 @@ type postUseCase interface {
|
||||
|
||||
// studioUseCase StudioController 对 PostService 的最小依赖(ISP:9 个方法)
|
||||
type studioUseCase interface {
|
||||
Create(userID uint, title, body string) (*model.Post, error)
|
||||
Create(userID uint, title, body, visibility, postType, reprintSource, declaration string, reprintProhibited bool) (*model.Post, error)
|
||||
GetByID(id uint) (*model.Post, error)
|
||||
Update(postID uint, title, body string) error
|
||||
Update(postID uint, title, body, visibility, postType, reprintSource, declaration string, reprintProhibited bool) error
|
||||
Delete(postID uint) error
|
||||
SubmitForAudit(postID uint) error
|
||||
ListByUser(userID uint, status string, page, pageSize int) ([]model.Post, int64, error)
|
||||
|
||||
@ -30,7 +30,7 @@ func (ctrl *StudioController) Create(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
post, err := ctrl.postService.Create(uid, req.Title, req.Body)
|
||||
post, err := ctrl.postService.Create(uid, req.Title, req.Body, req.Visibility, req.PostType, req.ReprintSource, req.Declaration, req.ReprintProhibited)
|
||||
if err != nil {
|
||||
common.Error(c, http.StatusInternalServerError, "发布失败")
|
||||
return
|
||||
@ -69,7 +69,7 @@ func (ctrl *StudioController) Update(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := ctrl.postService.Update(uint(id), req.Title, req.Body); err != nil {
|
||||
if err := ctrl.postService.Update(uint(id), req.Title, req.Body, req.Visibility, req.PostType, req.ReprintSource, req.Declaration, req.ReprintProhibited); err != nil {
|
||||
common.Error(c, http.StatusInternalServerError, "编辑失败")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user