api어노테이션 등록
This commit is contained in:
16
src/main/java/myblog/blog/badge/APIController.java
Normal file
16
src/main/java/myblog/blog/badge/APIController.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package myblog.blog.badge;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
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)
|
||||
@RestController
|
||||
@RequestMapping("/open-api/v1")
|
||||
public @interface APIController {
|
||||
}
|
||||
@@ -6,9 +6,10 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@APIController
|
||||
public class BadgeController {
|
||||
|
||||
@GetMapping("api/v1/badges")
|
||||
@GetMapping("/badges")
|
||||
String generateBadges() {
|
||||
return "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"100\" height=\"100%\">" +"<circle cx=\"50\" cy=\"50\" r=\"30\" fill=\"red\">" +"</svg>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user