feat(model): 为 Comment 和 PointHistory 实体添加逻辑删除功能

This commit is contained in:
sivdead
2025-08-31 14:03:10 +08:00
parent 59232f99ca
commit 72adc5b232
6 changed files with 37 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import com.openisle.repository.UserRepository;
import com.openisle.repository.ReactionRepository;
import com.openisle.repository.CommentSubscriptionRepository;
import com.openisle.repository.NotificationRepository;
import com.openisle.repository.PointHistoryRepository;
import com.openisle.exception.RateLimitException;
import org.junit.jupiter.api.Test;
@@ -24,10 +25,11 @@ class CommentServiceTest {
ReactionRepository reactionRepo = mock(ReactionRepository.class);
CommentSubscriptionRepository subRepo = mock(CommentSubscriptionRepository.class);
NotificationRepository nRepo = mock(NotificationRepository.class);
PointHistoryRepository pointHistoryRepo = mock(PointHistoryRepository.class);
ImageUploader imageUploader = mock(ImageUploader.class);
CommentService service = new CommentService(commentRepo, postRepo, userRepo,
notifService, subService, reactionRepo, subRepo, nRepo, imageUploader);
notifService, subService, reactionRepo, subRepo, nRepo, pointHistoryRepo, imageUploader);
when(commentRepo.countByAuthorAfter(eq("alice"), any())).thenReturn(3L);