From 4415d5aa49fe3920f6893871861968cea31dfb40 Mon Sep 17 00:00:00 2001 From: singsangssong Date: Tue, 15 Oct 2024 19:41:03 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=9A=8C=EC=9B=90=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=88=98=EC=A0=95=EA=B8=B0=EB=8A=A5=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kr/tgwing/tech/user/repository/UserRepository.java | 5 +++-- .../java/kr/tgwing/tech/user/service/UserServiceImpl.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/kr/tgwing/tech/user/repository/UserRepository.java b/src/main/java/kr/tgwing/tech/user/repository/UserRepository.java index b1d97a5..7bf9f7b 100644 --- a/src/main/java/kr/tgwing/tech/user/repository/UserRepository.java +++ b/src/main/java/kr/tgwing/tech/user/repository/UserRepository.java @@ -20,8 +20,9 @@ public interface UserRepository extends JpaRepository { @Transactional @Modifying - @Query("UPDATE User U SET U.name = :name, U.phoneNumber = :phoneNumber, U.profilePicture = :profilePicture WHERE U.studentId = :id") - void changeUser(String id, String name, String phoneNumber, String profilePicture); + @Query("UPDATE User U SET U.name = :name, U.phoneNumber = :phoneNumber, U.profilePicture = :profilePicture " + + "WHERE U.studentNumber = :studentNumber") + void changeUser(String studentNumber, String name, String phoneNumber, String profilePicture); } diff --git a/src/main/java/kr/tgwing/tech/user/service/UserServiceImpl.java b/src/main/java/kr/tgwing/tech/user/service/UserServiceImpl.java index 9e21733..5649110 100644 --- a/src/main/java/kr/tgwing/tech/user/service/UserServiceImpl.java +++ b/src/main/java/kr/tgwing/tech/user/service/UserServiceImpl.java @@ -105,7 +105,8 @@ public Page showMyBlog(String studentNumber,Pageable pageable){ .orElseThrow(UserNotFoundException::new); Page myBlog = postRepository.findByWriter(user, pageable); - List overviews = myBlog.stream().map(PostOverview::of).collect(Collectors.toList()); + List overviews = myBlog.stream().map(PostOverview::of) + .collect(Collectors.toList()); return new PageImpl<>(overviews, pageable, myBlog.getTotalElements()); }