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

Method GetPostsCount

internal/repository/dao/post.go:341–348  ·  view source on GitHub ↗

GetPostsCount 获取帖子总数

(ctx context.Context)

Source from the content-addressed store, hash-verified

339
340// GetPostsCount 获取帖子总数
341func (p *postDAO) GetPostsCount(ctx context.Context) (int64, error) {
342 var count int64
343 if err := p.db.WithContext(ctx).Model(&Post{}).Count(&count).Error; err != nil {
344 p.l.Error("获取帖子总数失败", zap.Error(err))
345 return 0, err
346 }
347 return count, nil
348}
349
350// GetPostsByPlate 根据板块获取帖子
351func (p *postDAO) GetPostsByPlate(ctx context.Context, plateId int64, pagination domain.Pagination) ([]Post, error) {

Callers

nothing calls this directly

Calls 1

CountMethod · 0.65

Tested by

no test coverage detected