MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / DeleteComment

Method DeleteComment

internal/api/comment.go:90–109  ·  view source on GitHub ↗

DeleteComment 删除评论处理器方法

(ctx *gin.Context, req req.DeleteCommentReq)

Source from the content-addressed store, hash-verified

88
89// DeleteComment 删除评论处理器方法
90func (ch *CommentHandler) DeleteComment(ctx *gin.Context, req req.DeleteCommentReq) (Result, error) {
91 if _, ok := requireUser(ctx); !ok {
92 return Result{
93 Code: DeleteCommentErrorCode,
94 Msg: "未登录或登录已过期",
95 }, nil
96 }
97
98 err := ch.svc.DeleteComment(ctx, req.CommentId)
99 if err != nil {
100 return Result{
101 Code: DeleteCommentErrorCode,
102 Msg: DeleteCommentErrorMsg,
103 }, err
104 }
105 return Result{
106 Code: RequestsOK,
107 Msg: DeleteCommentSuccessMsg,
108 }, nil
109}
110
111// GetMoreCommentReply 获取更多评论回复处理器方法
112func (ch *CommentHandler) GetMoreCommentReply(ctx *gin.Context, req req.GetMoreCommentReplyReq) (Result, error) {

Callers

nothing calls this directly

Calls 2

requireUserFunction · 0.85
DeleteCommentMethod · 0.65

Tested by

no test coverage detected