Skip to content

Commit

Permalink
api어노테이션 등록
Browse files Browse the repository at this point in the history
  • Loading branch information
jinia91 committed Jun 28, 2022
1 parent 0d34fb8 commit bd0a8a8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/main/java/myblog/blog/badge/APIController.java
Original file line number Diff line number Diff line change
@@ -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 {
}
3 changes: 2 additions & 1 deletion src/main/java/myblog/blog/badge/BadgeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

@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>";
}
Expand Down

0 comments on commit bd0a8a8

Please sign in to comment.