어노테이션1 [Spring] 스프링 웹 어노테이션 (Spring Web Annotation) Spring에서의 Spring Web 어노테이션을 이용하여 RESTful 웹 서비스를 만들어보자. http://localhost:8080/greeting API GET 요청으로 아래의 JSON 응답을 받는 API를 작성해보자. {"id":1,"content":"Hello, World!"} 먼저 greeting 모델 클래스를 만들자. package com.example.demo; public class Greeting { private final long id; private final String content; public Greeting(long id, String content) { this.id = id; this.content = content; } public long getId() { ret.. 2022. 3. 15. 이전 1 다음