feat: add user leveling and experience system

This commit is contained in:
Tim
2025-07-28 12:34:45 +08:00
parent a5900aa60d
commit 1c2751422d
18 changed files with 167 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import com.openisle.model.Post;
import com.openisle.model.User;
import com.openisle.service.CommentService;
import com.openisle.service.CaptchaService;
import com.openisle.service.LevelService;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
@@ -33,6 +34,8 @@ class CommentControllerTest {
private CommentService commentService;
@MockBean
private CaptchaService captchaService;
@MockBean
private LevelService levelService;
private Comment createComment(Long id, String content, String authorName) {
User user = new User();

View File

@@ -9,6 +9,7 @@ import com.openisle.service.CommentService;
import com.openisle.service.ReactionService;
import com.openisle.service.CaptchaService;
import com.openisle.service.DraftService;
import com.openisle.service.LevelService;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
@@ -50,6 +51,8 @@ class PostControllerTest {
private CaptchaService captchaService;
@MockBean
private DraftService draftService;
@MockBean
private LevelService levelService;
@Test
void createAndGetPost() throws Exception {

View File

@@ -6,6 +6,7 @@ import com.openisle.model.Reaction;
import com.openisle.model.ReactionType;
import com.openisle.model.User;
import com.openisle.service.ReactionService;
import com.openisle.service.LevelService;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +30,8 @@ class ReactionControllerTest {
@MockBean
private ReactionService reactionService;
@MockBean
private LevelService levelService;
@Test
void reactToPost() throws Exception {

View File

@@ -38,6 +38,8 @@ class UserControllerTest {
private PostService postService;
@MockBean
private CommentService commentService;
@MockBean
private LevelService levelService;
@Test
void getCurrentUser() throws Exception {