mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-05 16:56:22 +00:00
feat: 更新评论和帖子模型,添加用户信息和原创标识,优化API请求和组件结构
This commit is contained in:
@ -102,13 +102,12 @@ func (cc *CommentController) GetCommentList(ctx context.Context, c *app.RequestC
|
||||
resps.BadRequest(c, "无效的 target_id")
|
||||
return
|
||||
}
|
||||
|
||||
req := dto.GetCommentListReq{
|
||||
Desc: pagination.Desc,
|
||||
OrderBy: pagination.OrderBy,
|
||||
Page: pagination.Page,
|
||||
Size: pagination.Size,
|
||||
TargetID: uint(targetID),
|
||||
Desc: pagination.Desc,
|
||||
OrderBy: pagination.OrderBy,
|
||||
Page: pagination.Page,
|
||||
Size: pagination.Size,
|
||||
TargetID: uint(targetID),
|
||||
TargetType: c.Query("target_type"),
|
||||
}
|
||||
resp, err := cc.service.GetCommentList(ctx, &req)
|
||||
@ -120,4 +119,6 @@ func (cc *CommentController) GetCommentList(ctx context.Context, c *app.RequestC
|
||||
resps.Ok(c, resps.Success, resp)
|
||||
}
|
||||
|
||||
func (cc *CommentController) ReactComment(ctx context.Context, c *app.RequestContext) {}
|
||||
func (cc *CommentController) ReactComment(ctx context.Context, c *app.RequestContext) {
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/cloudwego/hertz/pkg/common/utils"
|
||||
"github.com/snowykami/neo-blog/internal/ctxutils"
|
||||
@ -95,7 +94,6 @@ func (p *PostController) Update(ctx context.Context, c *app.RequestContext) {
|
||||
|
||||
func (p *PostController) List(ctx context.Context, c *app.RequestContext) {
|
||||
pagination := ctxutils.GetPaginationParams(c)
|
||||
fmt.Println(pagination)
|
||||
if pagination.OrderBy == "" {
|
||||
pagination.OrderBy = constant.OrderByUpdatedAt
|
||||
}
|
||||
|
Reference in New Issue
Block a user