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

Method GetPostsByPlate

internal/api/post.go:363–380  ·  view source on GitHub ↗

GetPostsByPlate 根据板块获取帖子

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

361
362// GetPostsByPlate 根据板块获取帖子
363func (ph *PostHandler) GetPostsByPlate(ctx *gin.Context) {
364 var req req.SearchByPlateReq
365 if err := ctx.ShouldBindJSON(&req); err != nil {
366 apiresponse.ErrorWithMessage(ctx, "无效的请求参数")
367 return
368 }
369
370 posts, err := ph.svc.GetPostsByPlate(ctx, req.PlateId, domain.Pagination{
371 Page: req.Page,
372 Size: req.Size,
373 })
374 if err != nil {
375 apiresponse.ErrorWithMessage(ctx, err.Error())
376 return
377 }
378
379 apiresponse.SuccessWithData(ctx, posts)
380}

Callers

nothing calls this directly

Calls 3

ErrorWithMessageFunction · 0.92
SuccessWithDataFunction · 0.92
GetPostsByPlateMethod · 0.65

Tested by

no test coverage detected