Skip to content

Commit

Permalink
[feat] 유저 프로필 삭제 API 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryeolee committed Nov 13, 2023
1 parent c0588d9 commit 93d5f89
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ public BaseResponseDto reissueToken(HttpServletRequest request) {
return reissueTokenResponseDto;
}

@PatchMapping(value = "/delete/user-profile")
public BaseResponseDto deleteUserProfile(HttpServletRequest request) {

String userId = jwtTokenProvider.getUserId(request);

return userService.deleteUserProfile(Long.valueOf(userId));
}


@GetMapping(value = "/all-user")
public BaseResponseDto allUser() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public interface UserRepository extends JpaRepository<User, Long> {
@Query("update User as u set u.early = 0 where u.id = :userId")
void updateEarly( @Param("userId") Long userId);

@Modifying
@Query("update User as u set u.profileImage = null where u.id = :userId")
void updateUserProfileDefault( @Param("userId") Long userId);


// @Modifying
// @Query("update User as u set u.profileImage = :profileImage where u.id = :userId")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ public BaseResponseDto allUser() {

}

public BaseResponseDto deleteUserProfile(Long userId) {

userRepository.updateUserProfileDefault(userId);

log.info("유저 프로필 삭제 완료");
return BaseResponseDto.of(SuccessMessage.SUCCESS, null);

}

public BaseResponseDto specificUser(Long userId) {


Expand Down

0 comments on commit 93d5f89

Please sign in to comment.