mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 11:06:23 +00:00
✨ 优化了评论分页加载的列表显示
All checks were successful
Push to Helm Chart Repository / build (push) Successful in 15s
All checks were successful
Push to Helm Chart Repository / build (push) Successful in 15s
This commit is contained in:
@ -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) {
|
||||
|
@ -2,6 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/cloudwego/hertz/pkg/common/utils"
|
||||
"github.com/snowykami/neo-blog/internal/ctxutils"
|
||||
@ -10,8 +13,6 @@ import (
|
||||
"github.com/snowykami/neo-blog/pkg/constant"
|
||||
"github.com/snowykami/neo-blog/pkg/errs"
|
||||
"github.com/snowykami/neo-blog/pkg/resps"
|
||||
"slices"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type PostController struct {
|
||||
|
@ -69,7 +69,7 @@ func (u *UserController) Logout(ctx context.Context, c *app.RequestContext) {
|
||||
ctxutils.ClearTokenAndRefreshTokenCookie(c)
|
||||
resps.Ok(c, resps.Success, nil)
|
||||
// 尝试吊销服务端状态:若用户登录的情况下
|
||||
// TODO: 这里可以添加服务端状态的吊销逻辑
|
||||
// TODO: 添加服务端状态的吊销逻辑
|
||||
}
|
||||
|
||||
func (u *UserController) OidcList(ctx context.Context, c *app.RequestContext) {
|
||||
@ -176,3 +176,11 @@ func (u *UserController) VerifyEmail(ctx context.Context, c *app.RequestContext)
|
||||
}
|
||||
resps.Ok(c, resps.Success, resp)
|
||||
}
|
||||
|
||||
func (u *UserController) ChangePassword(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: 实现修改密码功能
|
||||
}
|
||||
|
||||
func (u *UserController) ChangeEmail(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: 实现修改邮箱功能
|
||||
}
|
||||
|
Reference in New Issue
Block a user