File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,14 @@ func (h *PostHandler) ListAllPosts(c *gin.Context) {
252252 c .JSON (http .StatusOK , gin.H {"posts" : posts })
253253}
254254
255+ // @Summary List public posts
256+ // @Description Retrieve all posts from public clubs
257+ // @Tags Posts
258+ // @Accept json
259+ // @Produce json
260+ // @Success 200 {array} models.Post "Public posts retrieved successfully"
261+ // @Failure 500 {object} gin.H "Internal server error"
262+ // @Router /posts/public [get]
255263func (h * PostHandler ) ListPublicPosts (c * gin.Context ) {
256264 posts , err := h .postService .ListPublicPosts ()
257265 if err != nil {
@@ -262,6 +270,14 @@ func (h *PostHandler) ListPublicPosts(c *gin.Context) {
262270 c .JSON (http .StatusOK , gin.H {"posts" : posts })
263271}
264272
273+ // @Summary List popular public posts
274+ // @Description Retrieve popular posts from public clubs based on number of likes
275+ // @Tags Posts
276+ // @Accept json
277+ // @Produce json
278+ // @Success 200 {array} models.Post "Popular public posts retrieved successfully"
279+ // @Failure 500 {object} gin.H "Internal server error"
280+ // @Router /posts/popular [get]
265281func (h * PostHandler ) ListPopularPublicPosts (c * gin.Context ) {
266282 posts , err := h .postService .ListPopularPublicPosts (20 )
267283 if err != nil {
You can’t perform that action at this time.
0 commit comments