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

Method ListComments

internal/repository/comment.go:96–104  ·  view source on GitHub ↗

ListComments 列出评论

(ctx context.Context, postId int64, minId, limit int64)

Source from the content-addressed store, hash-verified

94
95// ListComments 列出评论
96func (c *commentRepository) ListComments(ctx context.Context, postId int64, minId, limit int64) ([]domain.Comment, error) {
97 // 获取评论列表
98 daoComments, err := c.dao.FindCommentsByPostId(ctx, postId, minId, limit)
99 if err != nil {
100 return nil, fmt.Errorf("获取评论列表失败: %w", err)
101 }
102
103 return c.toDomainSliceComments(daoComments), nil
104}
105
106// toDAOComment 将领域模型评论转换为DAO评论
107func (c *commentRepository) toDAOComment(comment domain.Comment) dao.Comment {

Callers

nothing calls this directly

Calls 2

toDomainSliceCommentsMethod · 0.95
FindCommentsByPostIdMethod · 0.65

Tested by

no test coverage detected