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

Method GetPost

internal/service/post.go:204–211  ·  view source on GitHub ↗

GetPost 获取帖子

(ctx context.Context, postId uint)

Source from the content-addressed store, hash-verified

202
203// GetPost 获取帖子
204func (p *postService) GetPost(ctx context.Context, postId uint) (domain.Post, error) {
205 dp, err := p.repo.GetPost(ctx, postId)
206 if err != nil {
207 p.l.Error("获取帖子失败", zap.Error(err))
208 return domain.Post{}, fmt.Errorf("获取帖子失败: %w", err)
209 }
210 return dp, nil
211}
212
213// ListAll 列出所有帖子
214func (p *postService) ListAll(ctx context.Context, pagination domain.Pagination) ([]domain.Post, error) {

Callers

nothing calls this directly

Calls 1

GetPostMethod · 0.65

Tested by

no test coverage detected