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

Method Delete

internal/service/post.go:194–201  ·  view source on GitHub ↗

Delete 删除帖子

(ctx context.Context, postId uint, uid int64)

Source from the content-addressed store, hash-verified

192
193// Delete 删除帖子
194func (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 获取帖子
204func (p *postService) GetPost(ctx context.Context, postId uint) (domain.Post, error) {

Callers

nothing calls this directly

Calls 2

GetPostByIdMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected