MCPcopy Create free account
hub / github.com/apache/answer / GetTagWithPage

Method GetTagWithPage

internal/controller/tag_controller.go:269–287  ·  view source on GitHub ↗

GetTagWithPage get tag page @Summary get tag page @Description get tag page @Tags Tag @Produce json @Param page query int false "page size" @Param page_size query int false "page size" @Param slug_name query string false "slug_name" @Param query_cond query string false "query condition" Enums(popula

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

267// @Success 200 {object} handler.RespBody{data=pager.PageModel{list=[]schema.GetTagPageResp}}
268// @Router /answer/api/v1/tags/page [get]
269func (tc *TagController) GetTagWithPage(ctx *gin.Context) {
270 req := &schema.GetTagWithPageReq{}
271 if handler.BindAndCheck(ctx, req) {
272 return
273 }
274
275 req.UserID = middleware.GetLoginUserIDFromContext(ctx)
276
277 resp, err := tc.tagService.GetTagWithPage(ctx, req)
278 if err != nil {
279 handler.HandleResponse(ctx, err, nil)
280 return
281 }
282 if pager.ValPageOutOfRange(resp.Count, req.Page, req.PageSize) {
283 handler.HandleResponse(ctx, errors.NotFound(reason.RequestFormatError), nil)
284 return
285 }
286 handler.HandleResponse(ctx, err, resp)
287}
288
289// GetFollowingTags get following tag list
290// @Summary get following tag list

Callers 1

TagListMethod · 0.45

Calls 4

BindAndCheckFunction · 0.92
HandleResponseFunction · 0.92
ValPageOutOfRangeFunction · 0.92

Tested by

no test coverage detected