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

Method RegisterRoutes

internal/api/comment.go:26–33  ·  view source on GitHub ↗

RegisterRoutes 注册路由

(server *gin.Engine)

Source from the content-addressed store, hash-verified

24
25// RegisterRoutes 注册路由
26func (ch *CommentHandler) RegisterRoutes(server *gin.Engine) {
27 commentsGroup := server.Group("/api/comments")
28 commentsGroup.POST("/create", WrapBody(ch.CreateComment))
29 commentsGroup.POST("/list", WrapBody(ch.ListComments))
30 commentsGroup.DELETE("/delete/:commentId", WrapParam(ch.DeleteComment))
31 commentsGroup.POST("/get_more", WrapBody(ch.GetMoreCommentReply))
32 commentsGroup.POST("/get_top", WrapBody(ch.GetTopCommentReply))
33}
34
35// CreateComment 创建评论处理器方法
36func (ch *CommentHandler) CreateComment(ctx *gin.Context, req req.CreateCommentReq) (Result, error) {

Callers

nothing calls this directly

Calls 2

WrapBodyFunction · 0.85
WrapParamFunction · 0.85

Tested by

no test coverage detected