From d1fdf40cdf5122fcf1530d98e5642ad991680886 Mon Sep 17 00:00:00 2001 From: Chanho Lee Date: Sat, 15 Feb 2025 17:11:46 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[PC-607]=20feat:=20BlockContact=20OnDelete?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yapp/core/domain/block/BlockContact.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/core/domain/src/main/java/org/yapp/core/domain/block/BlockContact.java b/core/domain/src/main/java/org/yapp/core/domain/block/BlockContact.java index 53cc5427..4db910cf 100644 --- a/core/domain/src/main/java/org/yapp/core/domain/block/BlockContact.java +++ b/core/domain/src/main/java/org/yapp/core/domain/block/BlockContact.java @@ -15,6 +15,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.yapp.core.domain.BaseEntity; import org.yapp.core.domain.user.User; @@ -33,14 +35,15 @@ ) public class BlockContact extends BaseEntity { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "user_id", nullable = false) - private User user; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id", nullable = false) + @OnDelete(action = OnDeleteAction.CASCADE) + private User user; - @Column(nullable = false) - private String phoneNumber; + @Column(nullable = false) + private String phoneNumber; } \ No newline at end of file From a7073a4d62a31e0d2d4411351181a7daedad23b5 Mon Sep 17 00:00:00 2001 From: Chanho Lee Date: Sat, 15 Feb 2025 17:13:50 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[PC-607]=20feat:=20MatchInfo=20OnDelete=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/yapp/core/domain/match/MatchInfo.java | 82 ++++++++++--------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/core/domain/src/main/java/org/yapp/core/domain/match/MatchInfo.java b/core/domain/src/main/java/org/yapp/core/domain/match/MatchInfo.java index 94f70d24..882c6b19 100644 --- a/core/domain/src/main/java/org/yapp/core/domain/match/MatchInfo.java +++ b/core/domain/src/main/java/org/yapp/core/domain/match/MatchInfo.java @@ -10,6 +10,8 @@ import java.time.LocalDate; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.yapp.core.domain.user.User; @Entity @@ -17,56 +19,58 @@ @NoArgsConstructor public class MatchInfo { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @Column(name = "date") - private LocalDate date; + @Column(name = "date") + private LocalDate date; - @ManyToOne - @JoinColumn(name = "user_1") - private User user1; + @ManyToOne + @JoinColumn(name = "user_1") + @OnDelete(action = OnDeleteAction.CASCADE) + private User user1; - @Column(name = "user_1_piece_checked") - private Boolean user1PieceChecked = false; + @Column(name = "user_1_piece_checked") + private Boolean user1PieceChecked = false; - @Column(name = "user_1_accept") - private Boolean user1Accepted = false; + @Column(name = "user_1_accept") + private Boolean user1Accepted = false; - @ManyToOne - @JoinColumn(name = "user_2") - private User user2; + @ManyToOne + @JoinColumn(name = "user_2") + @OnDelete(action = OnDeleteAction.CASCADE) + private User user2; - @Column(name = "user_2_piece_checked") - private Boolean user2PieceChecked = false; + @Column(name = "user_2_piece_checked") + private Boolean user2PieceChecked = false; - @Column(name = "user_2_accept") - private Boolean user2Accepted = false; + @Column(name = "user_2_accept") + private Boolean user2Accepted = false; - public MatchInfo(LocalDate date, User user1, User user2) { - this.date = date; - this.user1 = user1; - this.user2 = user2; - } + public MatchInfo(LocalDate date, User user1, User user2) { + this.date = date; + this.user1 = user1; + this.user2 = user2; + } - public static MatchInfo createMatchInfo(User user1, User user2) { - return new MatchInfo(LocalDate.now(), user1, user2); - } + public static MatchInfo createMatchInfo(User user1, User user2) { + return new MatchInfo(LocalDate.now(), user1, user2); + } - public void checkPiece(Long userId) { - if (user1.getId().equals(userId)) { - user1PieceChecked = true; - } else { - user2PieceChecked = true; - } + public void checkPiece(Long userId) { + if (user1.getId().equals(userId)) { + user1PieceChecked = true; + } else { + user2PieceChecked = true; } + } - public void acceptPiece(Long userId) { - if (user1.getId().equals(userId)) { - user1Accepted = true; - } else { - user2Accepted = true; - } + public void acceptPiece(Long userId) { + if (user1.getId().equals(userId)) { + user1Accepted = true; + } else { + user2Accepted = true; } + } } From a01d4f6e7ab7e077fa66bbf9d018548890a01f2c Mon Sep 17 00:00:00 2001 From: Chanho Lee Date: Sat, 15 Feb 2025 17:14:09 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[PC-607]=20feat:=20Report=20OnDelete=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/yapp/core/domain/report/Report.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/core/domain/src/main/java/org/yapp/core/domain/report/Report.java b/core/domain/src/main/java/org/yapp/core/domain/report/Report.java index 2c1928de..44ac42ec 100644 --- a/core/domain/src/main/java/org/yapp/core/domain/report/Report.java +++ b/core/domain/src/main/java/org/yapp/core/domain/report/Report.java @@ -11,6 +11,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.yapp.core.domain.BaseEntity; import org.yapp.core.domain.user.User; @@ -21,19 +23,21 @@ @Getter public class Report extends BaseEntity { - @Id - @Column(name = "report_id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @Column(name = "report_id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @ManyToOne - @JoinColumn(name = "reporter_user_id", nullable = false) - private User reporter; + @ManyToOne + @JoinColumn(name = "reporter_user_id", nullable = false) + @OnDelete(action = OnDeleteAction.CASCADE) + private User reporter; - @ManyToOne - @JoinColumn(name = "reported_user_id", nullable = false) - private User reportedUser; + @ManyToOne + @JoinColumn(name = "reported_user_id", nullable = false) + @OnDelete(action = OnDeleteAction.CASCADE) + private User reportedUser; - @Column(length = 500) - private String reason; + @Column(length = 500) + private String reason; } From 883152c458c04625f380067d78fdeb4e4594ba2a Mon Sep 17 00:00:00 2001 From: Chanho Lee Date: Sat, 15 Feb 2025 17:14:35 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[PC-607]=20feat:=20TermAgreement=20OnDelete?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yapp/core/domain/term/TermAgreement.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/core/domain/src/main/java/org/yapp/core/domain/term/TermAgreement.java b/core/domain/src/main/java/org/yapp/core/domain/term/TermAgreement.java index f9bf01d1..3c5bb192 100644 --- a/core/domain/src/main/java/org/yapp/core/domain/term/TermAgreement.java +++ b/core/domain/src/main/java/org/yapp/core/domain/term/TermAgreement.java @@ -13,6 +13,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.yapp.core.domain.user.User; @Entity @@ -22,19 +24,20 @@ @Builder public class TermAgreement { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "agreement_id") - private long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "agreement_id") + private long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "user_id", nullable = false) - private User user; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id", nullable = false) + @OnDelete(action = OnDeleteAction.CASCADE) + private User user; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "term_id", nullable = false) - private Term term; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "term_id", nullable = false) + private Term term; - @Column(nullable = false) - private LocalDateTime agreedAt; + @Column(nullable = false) + private LocalDateTime agreedAt; } From 1e5c17c1b3361702af67142496df9a3d2839c2d1 Mon Sep 17 00:00:00 2001 From: Chanho Lee Date: Sat, 15 Feb 2025 17:14:43 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[PC-607]=20feat:=20User=20OnDelete=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/yapp/core/domain/user/User.java | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/core/domain/src/main/java/org/yapp/core/domain/user/User.java b/core/domain/src/main/java/org/yapp/core/domain/user/User.java index 6689580d..b77412af 100644 --- a/core/domain/src/main/java/org/yapp/core/domain/user/User.java +++ b/core/domain/src/main/java/org/yapp/core/domain/user/User.java @@ -1,5 +1,6 @@ package org.yapp.core.domain.user; +import jakarta.persistence.CascadeType; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -23,37 +24,37 @@ @NoArgsConstructor public class User extends BaseEntity { - @Id - @Column(name = "user_id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @Column(name = "user_id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @Column(name = "oauth_id") - private String oauthId; + @Column(name = "oauth_id") + private String oauthId; - @Column(name = "name") - private String name; + @Column(name = "name") + private String name; - @Column(name = "phone") - private String phoneNumber; + @Column(name = "phone") + private String phoneNumber; - @Column(name = "role") - private String role; + @Column(name = "role") + private String role; - @OneToOne - @JoinColumn(name = "profile_id", unique = true) // User가 profile_id를 FK로 가짐 - private Profile profile; + @OneToOne(cascade = {CascadeType.REMOVE}) + @JoinColumn(name = "profile_id", unique = true) // User가 profile_id를 FK로 가짐 + private Profile profile; - public void initializePhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } + public void initializePhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } - public void setProfile(Profile profile) { - this.profile = profile; - } + public void setProfile(Profile profile) { + this.profile = profile; + } - public void updateUserRole(String role) { - this.role = role; - } + public void updateUserRole(String role) { + this.role = role; + } } From 742ad856f25ce1bd615a6396d8ff199335a40b89 Mon Sep 17 00:00:00 2001 From: Chanho Lee Date: Sat, 15 Feb 2025 17:15:48 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[PC-607]=20feat:=20UserRejectHistory=20OnDe?= =?UTF-8?q?lete=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/domain/user/UserRejectHistory.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/core/domain/src/main/java/org/yapp/core/domain/user/UserRejectHistory.java b/core/domain/src/main/java/org/yapp/core/domain/user/UserRejectHistory.java index 3bd62ee2..8dfaa6a2 100644 --- a/core/domain/src/main/java/org/yapp/core/domain/user/UserRejectHistory.java +++ b/core/domain/src/main/java/org/yapp/core/domain/user/UserRejectHistory.java @@ -13,6 +13,8 @@ import lombok.Getter; import lombok.NoArgsConstructor; import org.hibernate.annotations.ColumnDefault; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; import org.yapp.core.domain.BaseEntity; @Entity @@ -22,20 +24,21 @@ @Getter public class UserRejectHistory extends BaseEntity { - @Id - @Column(name = "user_reject_history_id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @Column(name = "user_reject_history_id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "user_id") - private User user; + @ManyToOne(fetch = FetchType.LAZY) + @OnDelete(action = OnDeleteAction.CASCADE) + @JoinColumn(name = "user_id") + private User user; - @ColumnDefault("false") - @Builder.Default - private boolean reasonImage = false; + @ColumnDefault("false") + @Builder.Default + private boolean reasonImage = false; - @Builder.Default - @ColumnDefault("false") - private boolean reasonDescription = false; + @Builder.Default + @ColumnDefault("false") + private boolean reasonDescription = false; } From eda5aca06e705fd9ed032d43f77d70352ccf39d2 Mon Sep 17 00:00:00 2001 From: Chanho Lee Date: Sat, 15 Feb 2025 17:18:37 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[PC-607]=20feat:=20=ED=9A=8C=EC=9B=90=20?= =?UTF-8?q?=ED=83=88=ED=87=B4=20API=20=EC=97=94=EB=93=9C=ED=8F=AC=EC=9D=B8?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/presentation/UserController.java | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/api/src/main/java/org/yapp/domain/user/presentation/UserController.java b/api/src/main/java/org/yapp/domain/user/presentation/UserController.java index 9c407aa3..e3c3b90d 100644 --- a/api/src/main/java/org/yapp/domain/user/presentation/UserController.java +++ b/api/src/main/java/org/yapp/domain/user/presentation/UserController.java @@ -6,6 +6,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -18,17 +19,25 @@ @RequestMapping("/api/users") public class UserController { - private final UserService userService; + private final UserService userService; - @PreAuthorize(value = "hasRole('USER')") - @GetMapping("/reject") - @Operation(summary = "사용자 거절 사유 조회", description = "사용자의 최근 거절 사유를 조회합니다.", tags = {"사용자"}) - public ResponseEntity> getUserRejectHistory( - @AuthenticationPrincipal Long userId) { - UserRejectHistoryResponse response = userService.getUserRejectHistoryLatest( - userId); - - return ResponseEntity.status(HttpStatus.OK) - .body(CommonResponse.createSuccess(response)); - } + @PreAuthorize(value = "hasRole('USER')") + @GetMapping("/reject") + @Operation(summary = "사용자 거절 사유 조회", description = "사용자의 최근 거절 사유를 조회합니다.", tags = {"사용자"}) + public ResponseEntity> getUserRejectHistory( + @AuthenticationPrincipal Long userId) { + UserRejectHistoryResponse response = userService.getUserRejectHistoryLatest( + userId); + + return ResponseEntity.status(HttpStatus.OK) + .body(CommonResponse.createSuccess(response)); + } + + @DeleteMapping + @PreAuthorize(value = "hasRole('USER')") + @Operation(summary = "회원 탈퇴", description = "회원 탈퇴합니다.", tags = {"사용자"}) + public ResponseEntity> deleteUser(@AuthenticationPrincipal Long userId) { + userService.deleteUser(userId); + return ResponseEntity.ok(CommonResponse.createSuccessWithNoContent()); + } } From b03662b6d32feb900e7a8fa1544ab0362abe1dc0 Mon Sep 17 00:00:00 2001 From: Chanho Lee Date: Sat, 15 Feb 2025 17:18:50 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[PC-607]=20feat:=20=ED=9A=8C=EC=9B=90=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/user/application/UserService.java | 129 +++++++++--------- 1 file changed, 67 insertions(+), 62 deletions(-) diff --git a/api/src/main/java/org/yapp/domain/user/application/UserService.java b/api/src/main/java/org/yapp/domain/user/application/UserService.java index ff62909d..c0db4884 100644 --- a/api/src/main/java/org/yapp/domain/user/application/UserService.java +++ b/api/src/main/java/org/yapp/domain/user/application/UserService.java @@ -19,75 +19,80 @@ @RequiredArgsConstructor public class UserService { - private final UserRepository userRepository; - private final UserRejectHistoryRepository userRejectHistoryRepository; - private final JwtUtil jwtUtil; + private final UserRepository userRepository; + private final UserRejectHistoryRepository userRejectHistoryRepository; + private final JwtUtil jwtUtil; - /** - * Role을 USER로 바꾸고 변경된 토큰을 반환한다. - * - * @return 액세스토큰과 리프레시 토큰 - */ - @Transactional - public OauthLoginResponse completeProfileInitialize(Long userId, Profile profile) { - User user = - userRepository.findById(userId) - .orElseThrow(() -> new ApplicationException(UserErrorCode.NOTFOUND_USER)); - user.setProfile(profile); - user.updateUserRole(RoleStatus.PENDING.getStatus()); - String oauthId = user.getOauthId(); - String accessToken = jwtUtil.createJwt("access_token", userId, oauthId, user.getRole(), - 600000L); - String refreshToken = jwtUtil.createJwt("refresh_token", userId, oauthId, user.getRole(), - 864000000L); - return new OauthLoginResponse(RoleStatus.PENDING.getStatus(), accessToken, refreshToken); - } - - public User getUserById(Long userId) { - return userRepository.findById(userId) + /** + * Role을 USER로 바꾸고 변경된 토큰을 반환한다. + * + * @return 액세스토큰과 리프레시 토큰 + */ + @Transactional + public OauthLoginResponse completeProfileInitialize(Long userId, Profile profile) { + User user = + userRepository.findById(userId) .orElseThrow(() -> new ApplicationException(UserErrorCode.NOTFOUND_USER)); - } + user.setProfile(profile); + user.updateUserRole(RoleStatus.PENDING.getStatus()); + String oauthId = user.getOauthId(); + String accessToken = jwtUtil.createJwt("access_token", userId, oauthId, user.getRole(), + 600000L); + String refreshToken = jwtUtil.createJwt("refresh_token", userId, oauthId, user.getRole(), + 864000000L); + return new OauthLoginResponse(RoleStatus.PENDING.getStatus(), accessToken, refreshToken); + } - /** - * Role을 Register로 바꾸고 변경된 토큰을 반환한다. - * - * @return 액세스토큰과 리프레시 토큰 - */ - @Transactional - public OauthLoginResponse registerPhoneNumber(Long userId, String phoneNumber) { - User user = - userRepository.findById(userId) - .orElseThrow(() -> new ApplicationException(UserErrorCode.NOTFOUND_USER)); - user.updateUserRole(RoleStatus.REGISTER.getStatus()); - user.initializePhoneNumber(phoneNumber); - String oauthId = user.getOauthId(); - String accessToken = jwtUtil.createJwt("access_token", userId, oauthId, user.getRole(), - 600000L); - String refreshToken = jwtUtil.createJwt("refresh_token", userId, oauthId, user.getRole(), - 864000000L); - return new OauthLoginResponse(RoleStatus.REGISTER.getStatus(), accessToken, refreshToken); - } + public User getUserById(Long userId) { + return userRepository.findById(userId) + .orElseThrow(() -> new ApplicationException(UserErrorCode.NOTFOUND_USER)); + } - @Transactional(readOnly = true) - public UserRejectHistoryResponse getUserRejectHistoryLatest(Long userId) { - User user = this.getUserById(userId); - Profile profile = user.getProfile(); + /** + * Role을 Register로 바꾸고 변경된 토큰을 반환한다. + * + * @return 액세스토큰과 리프레시 토큰 + */ + @Transactional + public OauthLoginResponse registerPhoneNumber(Long userId, String phoneNumber) { + User user = + userRepository.findById(userId) + .orElseThrow(() -> new ApplicationException(UserErrorCode.NOTFOUND_USER)); + user.updateUserRole(RoleStatus.REGISTER.getStatus()); + user.initializePhoneNumber(phoneNumber); + String oauthId = user.getOauthId(); + String accessToken = jwtUtil.createJwt("access_token", userId, oauthId, user.getRole(), + 600000L); + String refreshToken = jwtUtil.createJwt("refresh_token", userId, oauthId, user.getRole(), + 864000000L); + return new OauthLoginResponse(RoleStatus.REGISTER.getStatus(), accessToken, refreshToken); + } - boolean reasonImage = false; - boolean reasonDescription = false; + @Transactional(readOnly = true) + public UserRejectHistoryResponse getUserRejectHistoryLatest(Long userId) { + User user = this.getUserById(userId); + Profile profile = user.getProfile(); - UserRejectHistory userRejectHistory = userRejectHistoryRepository.findTopByUserIdOrderByCreatedAtDesc( - userId).orElse(null); + boolean reasonImage = false; + boolean reasonDescription = false; - if (userRejectHistory != null) { - reasonImage = userRejectHistory.isReasonImage(); - reasonDescription = userRejectHistory.isReasonDescription(); - } + UserRejectHistory userRejectHistory = userRejectHistoryRepository.findTopByUserIdOrderByCreatedAtDesc( + userId).orElse(null); - return new UserRejectHistoryResponse( - profile.getProfileStatus(), - reasonImage, - reasonDescription - ); + if (userRejectHistory != null) { + reasonImage = userRejectHistory.isReasonImage(); + reasonDescription = userRejectHistory.isReasonDescription(); } + + return new UserRejectHistoryResponse( + profile.getProfileStatus(), + reasonImage, + reasonDescription + ); + } + + @Transactional + public void deleteUser(Long userId) { + userRepository.deleteById(userId); + } }