Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 25/유저 정보 조회 #26

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[feat] 유저 프로필 삭제 API 완료
  • Loading branch information
Ryeolee committed Nov 13, 2023
commit 93d5f89bfce4c9a19933264437d28e87a0e30371
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