(server *gin.Engine)
| 22 | } |
| 23 | |
| 24 | func (ph *PostHandler) RegisterRoutes(server *gin.Engine) { |
| 25 | postGroup := server.Group("/api/posts") |
| 26 | |
| 27 | postGroup.POST("/edit", ph.Edit) |
| 28 | postGroup.POST("/update", ph.Update) |
| 29 | postGroup.POST("/publish", ph.Publish) |
| 30 | postGroup.POST("/withdraw", ph.Withdraw) |
| 31 | postGroup.DELETE("/delete/:postId", ph.DeletePost) |
| 32 | postGroup.POST("/list", ph.List) |
| 33 | postGroup.POST("/list_pub", ph.ListPub) |
| 34 | postGroup.POST("/list_all", ph.ListAll) |
| 35 | postGroup.GET("/get/:postId", ph.GetPost) |
| 36 | postGroup.GET("/detail/:postId", ph.Detail) |
| 37 | postGroup.GET("/detail_pub/:postId", ph.DetailPub) |
| 38 | postGroup.POST("/like", ph.Like) |
| 39 | postGroup.POST("/collect", ph.Collect) |
| 40 | postGroup.GET("/count", ph.GetPostsCount) |
| 41 | postGroup.POST("/get_by_plate", ph.GetPostsByPlate) |
| 42 | } |
| 43 | |
| 44 | // Edit 创建新帖子 |
| 45 | func (ph *PostHandler) Edit(ctx *gin.Context) { |
nothing calls this directly
no outgoing calls
no test coverage detected