优化了评论分页加载的列表显示
All checks were successful
Push to Helm Chart Repository / build (push) Successful in 15s

This commit is contained in:
2025-09-10 14:47:45 +08:00
parent eb66a51051
commit a7da023b1e
14 changed files with 404 additions and 294 deletions

View File

@ -6,6 +6,7 @@ import (
"strconv"
"github.com/cloudwego/hertz/pkg/app"
"github.com/cloudwego/hertz/pkg/common/utils"
"github.com/snowykami/neo-blog/internal/ctxutils"
"github.com/snowykami/neo-blog/internal/dto"
"github.com/snowykami/neo-blog/internal/service"
@ -30,13 +31,13 @@ func (cc *CommentController) CreateComment(ctx context.Context, c *app.RequestCo
resps.BadRequest(c, err.Error())
return
}
err := cc.service.CreateComment(ctx, &req)
commentID, err := cc.service.CreateComment(ctx, &req)
if err != nil {
serviceErr := errs.AsServiceError(err)
resps.Custom(c, serviceErr.Code, serviceErr.Message, nil)
return
}
resps.Ok(c, resps.Success, nil)
resps.Ok(c, resps.Success, utils.H{"id": commentID})
}
func (cc *CommentController) UpdateComment(ctx context.Context, c *app.RequestContext) {