Skip to content

Commit

Permalink
feat(annotation) : controller와 RequestMapping 에대한 annotation 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
mjj111 committed May 19, 2024
1 parent 88faf2a commit 20e8c77
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/spring/mvc/annotation/Controller.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package spring.mvc.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Controller {
String value() default "";
}
16 changes: 16 additions & 0 deletions src/main/java/spring/mvc/annotation/RequestMapping.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package spring.mvc.annotation;

import spring.mvc.handler.mapping.RequestMethod;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface RequestMapping {
String value() default "";

RequestMethod method() default RequestMethod.GET;
}

0 comments on commit 20e8c77

Please sign in to comment.