feat: SSR 问答帖发帖与解决状态切换

compose 支持 question;详情徽章并由作者/管理员切换。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-30 02:04:56 +08:00
parent 92b68b9eef
commit 303755b47a
9 changed files with 71 additions and 11 deletions

View File

@@ -67,7 +67,7 @@ func (d Deps) ComposePost(c *gin.Context) {
form := composeFormFrom(c)
htmlBody := services.ComposeBodyToHTML(form.Content)
postType := form.PostType
if postType != models.PostTypePoll {
if postType != models.PostTypePoll && postType != models.PostTypeQuestion {
postType = models.PostTypeNormal
}
post, err := d.Post.Create(ctx.UserID(), form.BoardID, form.Title, htmlBody, form.Tags, postType, ctx.SkipsModeration())
@@ -197,7 +197,7 @@ func composeFormFrom(c *gin.Context) composeForm {
maxChoices = 1
}
postType := strings.TrimSpace(c.PostForm("post_type"))
if postType != models.PostTypePoll {
if postType != models.PostTypePoll && postType != models.PostTypeQuestion {
postType = models.PostTypeNormal
}
return composeForm{