Delete 删除帖子
(ctx context.Context, postId uint, uid int64)
| 192 | |
| 193 | // Delete 删除帖子 |
| 194 | func (p *postService) Delete(ctx context.Context, postId uint, uid int64) error { |
| 195 | _, err := p.repo.GetPostById(ctx, postId, uid) |
| 196 | if err != nil { |
| 197 | p.l.Error("获取帖子失败", zap.Error(err)) |
| 198 | return fmt.Errorf("获取帖子失败: %w", err) |
| 199 | } |
| 200 | return p.repo.Delete(ctx, postId, uid) |
| 201 | } |
| 202 | |
| 203 | // GetPost 获取帖子 |
| 204 | func (p *postService) GetPost(ctx context.Context, postId uint) (domain.Post, error) { |
nothing calls this directly
no test coverage detected