CancelLike 处理取消点赞逻辑
(ctx context.Context, postId uint, uid int64)
| 54 | |
| 55 | // CancelLike 处理取消点赞逻辑 |
| 56 | func (i *interactiveService) CancelLike(ctx context.Context, postId uint, uid int64) error { |
| 57 | if postId == 0 || uid <= 0 { |
| 58 | return errors.New("invalid parameters") |
| 59 | } |
| 60 | return i.repo.DecrLike(ctx, postId, uid) |
| 61 | } |
| 62 | |
| 63 | // Collect 处理收藏逻辑 |
| 64 | func (i *interactiveService) Collect(ctx context.Context, postId uint, uid int64) error { |