api어노테이션 등록

This commit is contained in:
jinia91
2022-06-28 01:30:10 +09:00
parent 0d34fb8e7a
commit bd0a8a8ed1
2 changed files with 18 additions and 1 deletions

View 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 {
}

View File

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