#22 mvc: change dir

This commit is contained in:
haerong22
2022-09-24 02:12:39 +09:00
parent 0c412100a2
commit b149204c16
11 changed files with 25 additions and 30 deletions

View File

@@ -1,4 +0,0 @@
package org.example;
public class Main {
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,4 +1,4 @@
package org.example.model; package org.example.reflection.model;
import java.util.Objects; import java.util.Objects;

View File

@@ -0,0 +1,7 @@
package org.example.reflection.service;
import org.example.reflection.annotation.Service;
@Service
public class HomeService {
}

View File

@@ -1,7 +0,0 @@
package org.example.service;
import org.example.annotation.Service;
@Service
public class HomeService {
}

View File

@@ -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);