From 4badffca8c03ff12019a5e811d6499eb00636abf Mon Sep 17 00:00:00 2001 From: seheonnn Date: Sat, 25 Nov 2023 20:30:10 +0900 Subject: [PATCH] =?UTF-8?q?FEAT:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20=EB=8D=94?= =?UTF-8?q?=EB=AF=B8=EB=8D=B0=EC=9D=B4=ED=84=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/dev/neordinary/zero/controller/UserController.java | 5 +++++ src/main/java/dev/neordinary/zero/service/UserService.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/dev/neordinary/zero/controller/UserController.java b/src/main/java/dev/neordinary/zero/controller/UserController.java index 110e2b1..4f81c04 100644 --- a/src/main/java/dev/neordinary/zero/controller/UserController.java +++ b/src/main/java/dev/neordinary/zero/controller/UserController.java @@ -7,6 +7,7 @@ import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.Value; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @@ -17,6 +18,10 @@ public class UserController { private final UserService userService; + @GetMapping("/api/v1/user-dummy") + public UserResponse.UserJoinRes showDummy() { + return userService.showDummy(); + } @PostMapping("/api/v1/user") public UserResponse.UserJoinRes join(@RequestBody UserRequest.UserJoin userJoin) { return userService.join(userJoin); diff --git a/src/main/java/dev/neordinary/zero/service/UserService.java b/src/main/java/dev/neordinary/zero/service/UserService.java index 27a6196..1ef7698 100644 --- a/src/main/java/dev/neordinary/zero/service/UserService.java +++ b/src/main/java/dev/neordinary/zero/service/UserService.java @@ -14,6 +14,10 @@ public class UserService { private final UserRepository userRepository; + public UserResponse.UserJoinRes showDummy() { + UserEntity dummyUser = userRepository.findById(1L).orElseThrow(() -> null); + return UserConverter.toUserDto(dummyUser); + } public UserResponse.UserJoinRes join(UserRequest.UserJoin userJoin) { UserEntity newUser = UserConverter.toUser(userJoin);