diff --git "a/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/java/com/example/kong/KongController.java" "b/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/java/com/example/kong/KongController.java" index 78474c7..5ff1157 100644 --- "a/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/java/com/example/kong/KongController.java" +++ "b/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/java/com/example/kong/KongController.java" @@ -1,11 +1,15 @@ package com.example.kong; +import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; /* Spring Boot에서 컨트롤러는 어떻게 인식할까요? */ +@RestController +@RequiredArgsConstructor public class KongController { - private KongService kongService; + private final KongService kongService; @GetMapping("/reaction") public String reaction() { diff --git "a/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/java/com/example/kong/KongService.java" "b/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/java/com/example/kong/KongService.java" index 27bd1ac..0c75181 100644 --- "a/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/java/com/example/kong/KongService.java" +++ "b/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/java/com/example/kong/KongService.java" @@ -3,12 +3,16 @@ import com.example.kong.util.DrinkPrinter; import com.example.kong.util.DrinkProperties; import com.example.kong.util.Space; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; /* Spring Boot에서 서비스는 어떻게 인식할까요? */ +@Service +@RequiredArgsConstructor public class KongService { /* 어떻게 주입받아야 할까요? */ - private DrinkProperties drinkProperties; + private final DrinkProperties drinkProperties; // 냄새가 나는 코드지만 예제를 위한 부분이니 신경쓰지 말아주세요.. public String reactToDrink() { diff --git "a/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/resources/application.yml" "b/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/resources/application.yml" index d1b299e..70f224e 100644 --- "a/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/resources/application.yml" +++ "b/v1/backend/SPRING_LV_1_\354\275\251_\354\213\254\354\235\200_\353\215\260_\354\275\251_\353\202\234\353\213\244/src/main/resources/application.yml" @@ -1,3 +1,3 @@ spring: kong: - what-kind-of-drink: 'coffee' \ No newline at end of file + what-kind-of-drink: 'coke' \ No newline at end of file