Restructure the project

This commit is contained in:
myh 2023-12-10 22:54:22 +08:00
parent 1dda90a1c8
commit 85709591e1
6 changed files with 9 additions and 9 deletions

View File

@ -0,0 +1,4 @@
package com.example.springdemo.utils;
public class UtilsClass {
}

View File

@ -1,4 +1,4 @@
package com.example.springdemo.utils;
package com.example.springdemo.utils.verificationAnnotation;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

View File

@ -1,4 +1,4 @@
package com.example.springdemo.utils;
package com.example.springdemo.utils.verificationAnnotation;
import lombok.AllArgsConstructor;
import lombok.Getter;

View File

@ -1,4 +1,4 @@
package com.example.springdemo.utils;
package com.example.springdemo.utils.verificationAnnotation;
// 在Controller中使用该注解可以实现权限验证

View File

@ -1,4 +1,4 @@
package com.example.springdemo.utils;
package com.example.springdemo.utils.verificationAnnotation;
import com.example.springdemo.entities.Users;
import jakarta.servlet.http.HttpServletRequest;
@ -20,7 +20,7 @@ import java.lang.reflect.Method;
@Component
@Aspect
public class RoleVerificationAspect {
@Pointcut("@annotation(com.example.springdemo.utils.RoleVerificationAnnotation)")
@Pointcut("@annotation(com.example.springdemo.utils.verificationAnnotation.RoleVerificationAnnotation)")
public void roleVerification() {
}

View File

@ -9,16 +9,12 @@ import jakarta.annotation.Resource;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.security.test.context.support.WithUserDetails;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;