Restructure the project
This commit is contained in:
parent
1dda90a1c8
commit
85709591e1
@ -0,0 +1,4 @@
|
|||||||
|
package com.example.springdemo.utils;
|
||||||
|
|
||||||
|
public class UtilsClass {
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.springdemo.utils;
|
package com.example.springdemo.utils.verificationAnnotation;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.springdemo.utils;
|
package com.example.springdemo.utils.verificationAnnotation;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.springdemo.utils;
|
package com.example.springdemo.utils.verificationAnnotation;
|
||||||
|
|
||||||
// 在Controller中使用该注解,可以实现权限验证
|
// 在Controller中使用该注解,可以实现权限验证
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.springdemo.utils;
|
package com.example.springdemo.utils.verificationAnnotation;
|
||||||
|
|
||||||
import com.example.springdemo.entities.Users;
|
import com.example.springdemo.entities.Users;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
@ -20,7 +20,7 @@ import java.lang.reflect.Method;
|
|||||||
@Component
|
@Component
|
||||||
@Aspect
|
@Aspect
|
||||||
public class RoleVerificationAspect {
|
public class RoleVerificationAspect {
|
||||||
@Pointcut("@annotation(com.example.springdemo.utils.RoleVerificationAnnotation)")
|
@Pointcut("@annotation(com.example.springdemo.utils.verificationAnnotation.RoleVerificationAnnotation)")
|
||||||
public void roleVerification() {
|
public void roleVerification() {
|
||||||
}
|
}
|
||||||
|
|
@ -9,16 +9,12 @@ import jakarta.annotation.Resource;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
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.AutoConfigureMockMvc;
|
||||||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
|
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.boot.test.mock.mockito.MockBean;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.security.test.context.support.WithMockUser;
|
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.annotation.Rollback;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
|
||||||
import org.springframework.test.web.servlet.MockMvc;
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
import org.springframework.test.web.servlet.MvcResult;
|
import org.springframework.test.web.servlet.MvcResult;
|
||||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||||
|
Loading…
Reference in New Issue
Block a user