#22 mvc: change dir
This commit is contained in:
@@ -1,4 +0,0 @@
|
|||||||
package org.example;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.example.annotation;
|
package org.example.reflection.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.example.annotation;
|
package org.example.reflection.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.example.annotation;
|
package org.example.reflection.annotation;
|
||||||
|
|
||||||
public enum RequestMethod {
|
public enum RequestMethod {
|
||||||
GET, POST, PUT, PATCH, DELETE
|
GET, POST, PUT, PATCH, DELETE
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.example.annotation;
|
package org.example.reflection.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.example.controller;
|
package org.example.reflection.controller;
|
||||||
|
|
||||||
import org.example.annotation.Controller;
|
import org.example.reflection.annotation.Controller;
|
||||||
import org.example.annotation.RequestMapping;
|
import org.example.reflection.annotation.RequestMapping;
|
||||||
import org.example.annotation.RequestMethod;
|
import org.example.reflection.annotation.RequestMethod;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.example.controller;
|
package org.example.reflection.controller;
|
||||||
|
|
||||||
import org.example.annotation.Controller;
|
import org.example.reflection.annotation.Controller;
|
||||||
import org.example.annotation.RequestMapping;
|
import org.example.reflection.annotation.RequestMapping;
|
||||||
import org.example.annotation.RequestMethod;
|
import org.example.reflection.annotation.RequestMethod;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.example.model;
|
package org.example.reflection.model;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package org.example.reflection.service;
|
||||||
|
|
||||||
|
import org.example.reflection.annotation.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class HomeService {
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package org.example.service;
|
|
||||||
|
|
||||||
import org.example.annotation.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class HomeService {
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
package org.example;
|
package org.example.reflection;
|
||||||
|
|
||||||
import org.assertj.core.api.Assertions;
|
import org.example.reflection.annotation.Controller;
|
||||||
import org.example.annotation.Controller;
|
import org.example.reflection.annotation.Service;
|
||||||
import org.example.annotation.Service;
|
import org.example.reflection.model.User;
|
||||||
import org.example.model.User;
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.reflections.Reflections;
|
import org.reflections.Reflections;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -47,7 +46,7 @@ public class ReflectionTest {
|
|||||||
User user = new User("1", "test");
|
User user = new User("1", "test");
|
||||||
Class<? extends User> clazz2 = user.getClass();
|
Class<? extends User> clazz2 = user.getClass();
|
||||||
|
|
||||||
Class<?> clazz3 = Class.forName("org.example.model.User");
|
Class<?> clazz3 = Class.forName("org.example.reflection.model.User");
|
||||||
|
|
||||||
logger.debug("clazz: [{}]", clazz);
|
logger.debug("clazz: [{}]", clazz);
|
||||||
logger.debug("clazz2: [{}]", clazz2);
|
logger.debug("clazz2: [{}]", clazz2);
|
||||||
Reference in New Issue
Block a user