-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 회원 탈퇴 사유 저장 로직 추가 및 cors 관련 재설정 (#123)
* refactor: SecurityConfig Cors 관련 전체 허용으로 변경 및 회원 카드 등록 API permitAll 로 변경 (#117) * refactor: 기존 엔티티 관련 리팩토링 (#117) * feat: WithdrawReason 생성 sql 추가 (#117) * feat: WithdrawReason 관련 도메인 구현 (#117) * feat: 회원 탈퇴 시 탈퇴 사유 기능 추가 (#117) * test: 회원 탈퇴 단위 테스트 (#117) * refactor: 회원 탈퇴 API POST 로 수정 (#117) * refactor: 회원탈퇴 관련 통합 테스트 수정 및 요청 DTO 수정 (#117) * refactor: meeting 엔티티명 다시 복구 - 모든 테이블에 `s` 붙이는 방향 논의 필요 (#117) * feat: withdraw_reason 테이블 이름 변경 (#117) * fix: CI 에러 해결 (#117)
- Loading branch information
1 parent
59f1794
commit f1ec12a
Showing
17 changed files
with
205 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/net/teumteum/user/domain/WithdrawReason.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.teumteum.user.domain; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import net.teumteum.core.entity.TimeBaseEntity; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Entity(name = "withdraw_reasons") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class WithdrawReason extends TimeBaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "withdraw_reason", nullable = false) | ||
private String reason; | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/net/teumteum/user/domain/WithdrawReasonRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package net.teumteum.user.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface WithdrawReasonRepository extends JpaRepository<WithdrawReason, Long> { | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/net/teumteum/user/domain/request/UserWithdrawRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package net.teumteum.user.domain.request; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | ||
import jakarta.validation.constraints.Size; | ||
import java.util.List; | ||
import net.teumteum.user.domain.WithdrawReason; | ||
|
||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) | ||
public record UserWithdrawRequest( | ||
@Size(min = 1, max = 3, message = "탈퇴 사유는 최소 1개, 최대 3개의 입력값입니다.") | ||
List<String> withdrawReasons | ||
) { | ||
|
||
private static final Long IGNORE_ID = null; | ||
|
||
public List<WithdrawReason> toEntity() { | ||
return withdrawReasons.stream() | ||
.map(withdrawReason -> new WithdrawReason(IGNORE_ID, withdrawReason)) | ||
.toList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/resources/db/migration/V7__create_withdraw_reason.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
create table if not exists withdraw_reason | ||
( | ||
id bigint not null auto_increment, | ||
withdraw_reason varchar(30) not null, | ||
created_at timestamp(6) not null, | ||
updated_at timestamp(6) not null, | ||
primary key (id) | ||
); |
10 changes: 10 additions & 0 deletions
10
src/main/resources/db/migration/V8__rename_withdraw_reason.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
drop table withdraw_reason; | ||
|
||
create table if not exists withdraw_reasons | ||
( | ||
id bigint not null auto_increment, | ||
withdraw_reason varchar(30) not null, | ||
created_at timestamp(6) not null, | ||
updated_at timestamp(6) not null, | ||
primary key (id) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.