feat(editor): update

This commit is contained in:
2025-12-31 14:50:18 +08:00
parent 20e1a2fa19
commit 984770c6a1
14 changed files with 303 additions and 117 deletions

View File

@@ -48,7 +48,7 @@ func (c *Content) List(
// @Bind id path
func (c *Content) Get(ctx fiber.Ctx, id string) (*dto.ContentDetail, error) {
uid := cast.ToInt64(ctx.Locals(consts.CtxKeyUser))
return services.Content.Get(ctx.Context(), uid, id)
return services.Content.Get(ctx, uid, id)
}
// Get comments for a content
@@ -66,7 +66,7 @@ func (c *Content) Get(ctx fiber.Ctx, id string) (*dto.ContentDetail, error) {
// @Bind page query
func (c *Content) ListComments(ctx fiber.Ctx, id string, page int) (*requests.Pager, error) {
uid := cast.ToInt64(ctx.Locals(consts.CtxKeyUser))
return services.Content.ListComments(ctx.Context(), uid, id, page)
return services.Content.ListComments(ctx, uid, id, page)
}
// Post a comment
@@ -84,7 +84,7 @@ func (c *Content) ListComments(ctx fiber.Ctx, id string, page int) (*requests.Pa
// @Bind form body
func (c *Content) CreateComment(ctx fiber.Ctx, id string, form *dto.CommentCreateForm) error {
uid := cast.ToInt64(ctx.Locals(consts.CtxKeyUser))
return services.Content.CreateComment(ctx.Context(), uid, id, form)
return services.Content.CreateComment(ctx, uid, id, form)
}
// Like a comment
@@ -100,7 +100,7 @@ func (c *Content) CreateComment(ctx fiber.Ctx, id string, form *dto.CommentCreat
// @Bind id path
func (c *Content) LikeComment(ctx fiber.Ctx, id string) error {
uid := cast.ToInt64(ctx.Locals(consts.CtxKeyUser))
return services.Content.LikeComment(ctx.Context(), uid, id)
return services.Content.LikeComment(ctx, uid, id)
}
// List curated topics