-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] User 도메인 - 회원가입 #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
acc06a9
fix: web, doc 의존성 삭제
kamillcream bfbf000
feat: lombok 추가
kamillcream 491517a
feat: web, doc 의존성 추가
kamillcream cbcd883
feat: Lombok 추가
kamillcream 24b527c
feat: Lombok 추가
kamillcream fa3fc9d
feat: 공통 응답 객체 추가
kamillcream d9a3d8a
feat: BaseEntity 추가
kamillcream a75167b
feat: 상태코드 인터페이스
kamillcream 142725b
feat: 에러 상세정보 객체
kamillcream 31520cb
feat: 에러 상태코드
kamillcream 35b6f5f
feat: 정상 상태코드
kamillcream 6f93fa0
feat: 전역 예외처리
kamillcream 9e8b2ca
feat: 유저 엔티티
kamillcream 9b64620
feat: 유저 타입 enum
kamillcream 10d2632
feat: exceptionadvice
kamillcream 012e2be
feat: module 간 의존성 추가
kamillcream 6873140
fix: 기본 생성자 protected 삭제
kamillcream 6fe3785
chore: 도메인으로 이동
kamillcream d06a364
feat: 영속성 어댑터 테스트
kamillcream d74ecc1
feat: 영속성 어댑터
kamillcream 23a52f2
feat: 유저 아웃포트
kamillcream 8a076f8
feat: lombok 의존성 추가
kamillcream a29d7e2
feat: lombok 어노테이션 적용
kamillcream 61bbc49
feat: 회원가입 성공 테스트
kamillcream 871d9db
feat: 회원가입 요청 객체
kamillcream c48e0ad
feat: 유저 영속성 레포
kamillcream 58e5696
feat: 유저 매퍼
kamillcream 2861da9
fix: kotlin 주석 처리
kamillcream 5242af5
feat: 유효하지 않은 요청 객체 예외
kamillcream d50dbe6
fix: 시큐리티 의존성 비활성화
kamillcream 6f2d09d
feat: lombok 및 테스트 의존성 추가
kamillcream 36ceb60
feat: 회원가입 요청 객체
kamillcream e9ab22c
feat: 이메일 중복 확인
kamillcream 41e006b
feat: 이메일 중복 확인 인터페이스
kamillcream b998606
feat: 이메일 중복 확인 구현체
kamillcream 45df738
feat: 영속성 레이어에 맞는 테스트 구현
kamillcream e0ac51c
feat: 유저 생성 서비스 테스트
kamillcream 70a0195
feat: 유저 조회 서비스 테스트
kamillcream ed4870b
feat: 유저 조회 유스케이스
kamillcream c8605f8
feat: 유저 조회 유스케이스 구현체
kamillcream 6c3cba6
feat: 유저 생성 유스케이스
kamillcream c9835c4
feat: 유저 컨트롤러
kamillcream 4c63527
feat: 유저 컨트롤러 테스트
kamillcream a27e72a
feat: 유저 도메인 jpa 설정
kamillcream 9d7b14d
fix: getStactTrace() 수정
kamillcream d7fe9bc
fix: lombok 버전 수정
kamillcream be19ec9
fix: USER_001 메시지 수정
kamillcream da7b08f
fix: 테스트 stub 대상 수정
kamillcream a6ff544
fix: email 길이, isActive 주석 수정
kamillcream d124720
feat: 조회 대상 사용자가 존재하지 않을 때 예외
kamillcream 86565da
feat: findById가 null일 때 커스텀 예외 던지기
kamillcream 456a6d2
feat: findById가 null일 때 테스트 추가
kamillcream 57f7383
feat: NotNull 추가
kamillcream 9962af4
feat: 시큐리티 의존성 활성화
kamillcream 65e1f02
chore: 어댑터에서 포트로 패키지 이동
kamillcream d42d599
feat: 비밀번호 암호화해서 저장
kamillcream 818a4ce
feat: 비밀번호 암호화 확인 테스트
kamillcream 2ad7815
chore: SignUpCommand 패키지 이동
kamillcream ede1490
feat: PasswordEncoder 빈 등록
kamillcream f0786e2
chore: 테이블 명칭 변경
kamillcream 146e257
chore: checkEmailAvailable -> checkEmailExists
kamillcream a5de23a
chore: checkEmailAvailable -> checkEmailExists
kamillcream 6e39453
chore: checkEmailAvailable -> checkEmailExists
kamillcream a9a8725
fix: verify 먼저 실행 후 비교
kamillcream b5b3632
fix: encoder spy
kamillcream 3129aa2
feat: bootstrap 모듈에서 user 모듈의 인프라 모듈 의존
kamillcream eee5589
feat: transactional 어노테이션 의존성 추가
kamillcream f539b31
fix: lombok -> mapstruct 의존성 순서 변경
kamillcream 2dec099
feat: transactional 어노테이션 의존성 추가
kamillcream 5560cbf
feat: 시큐리티 모든 요청 허용
kamillcream 109c08d
feat: Transactional(readonly=false) 추가
kamillcream 4b11ce5
feat: Transactional(readonly=true) 추가
kamillcream ec482d8
feat: 이메일 중복여부 응답 객체
kamillcream 70a8c67
feat: 이메일 중복여부 응답 객체 반환
kamillcream a059791
feat: 컨트롤러 테스트에서 시큐리티 설정 off
kamillcream File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
31 changes: 31 additions & 0 deletions
31
main-modules/bootstrap/src/main/java/com/sidework/config/SecurityConfig.java
This file contains hidden or 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,31 @@ | ||
| package com.sidework.config; | ||
|
|
||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
| import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; | ||
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | ||
| import org.springframework.security.crypto.password.PasswordEncoder; | ||
| import org.springframework.security.web.SecurityFilterChain; | ||
|
|
||
| @Configuration | ||
| @EnableWebSecurity | ||
| public class SecurityConfig { | ||
|
|
||
| @Bean | ||
| public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { | ||
| http | ||
| .csrf(AbstractHttpConfigurer::disable) // CSRF 비활성화 | ||
| .authorizeHttpRequests(auth -> auth | ||
| .anyRequest().permitAll() // 모든 요청 허용 | ||
| ); | ||
|
|
||
| return http.build(); | ||
| } | ||
|
|
||
| @Bean | ||
| public PasswordEncoder passwordEncoder() { | ||
| return new BCryptPasswordEncoder(); | ||
| } | ||
| } |
This file contains hidden or 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
24 changes: 24 additions & 0 deletions
24
main-modules/common/src/main/java/com/sidework/common/entity/BaseEntity.java
This file contains hidden or 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,24 @@ | ||
| package com.sidework.common.entity; | ||
|
|
||
|
|
||
| import jakarta.persistence.*; | ||
| import lombok.Getter; | ||
| import org.springframework.data.annotation.CreatedDate; | ||
| import org.springframework.data.annotation.LastModifiedDate; | ||
| import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
|
||
| import java.time.Instant; | ||
|
|
||
| @MappedSuperclass | ||
| @EntityListeners(AuditingEntityListener.class) | ||
| @Getter | ||
| public abstract class BaseEntity { | ||
|
|
||
| @CreatedDate | ||
| @Column(updatable = false) | ||
| private Instant createdAt; | ||
|
|
||
| @LastModifiedDate | ||
| private Instant updatedAt; | ||
|
|
||
| } |
60 changes: 60 additions & 0 deletions
60
main-modules/common/src/main/java/com/sidework/common/response/ApiResponse.java
This file contains hidden or 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,60 @@ | ||
| package com.sidework.common.response; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
| import com.sidework.common.response.status.SuccessStatus; | ||
|
|
||
|
|
||
| @JsonPropertyOrder({"code", "message", "result", "isSuccess"}) | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public record ApiResponse<T>(boolean isSuccess, String code, String message, T result, String path) { | ||
|
|
||
| // 성공 - 데이터 반환 | ||
| public static <T> ApiResponse<T> onSuccess(T result) { | ||
| return new ApiResponse<>( | ||
| true, | ||
| SuccessStatus.OK.getCode(), | ||
| SuccessStatus.OK.getMessage(), | ||
| result, | ||
| null | ||
| ); | ||
| } | ||
|
|
||
| // 성공 - 생성됨 (201) | ||
| public static <T> ApiResponse<T> onSuccessCreated() { | ||
| return new ApiResponse<>( | ||
| true, | ||
| SuccessStatus.CREATED.getCode(), | ||
| SuccessStatus.CREATED.getMessage(), | ||
| null, | ||
| null | ||
| ); | ||
| } | ||
|
|
||
| // 성공 - void 응답 | ||
| public static <T> ApiResponse<T> onSuccessVoid() { | ||
| return new ApiResponse<>( | ||
| true, | ||
| SuccessStatus.OK.getCode(), | ||
| SuccessStatus.OK.getMessage(), | ||
| null, | ||
| null | ||
| ); | ||
| } | ||
|
|
||
| // 실패 응답 | ||
| public static <T> ApiResponse<T> onFailure( | ||
| String code, | ||
| String message, | ||
| T data, | ||
| String requestUri | ||
| ) { | ||
| return new ApiResponse<>( | ||
| false, | ||
| code, | ||
| message, | ||
| data, | ||
| requestUri | ||
| ); | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
main-modules/common/src/main/java/com/sidework/common/response/ErrorDetail.java
This file contains hidden or 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,15 @@ | ||
| package com.sidework.common.response; | ||
|
|
||
| import com.sidework.common.response.status.BaseStatusCode; | ||
| import org.springframework.http.HttpStatus; | ||
|
|
||
| public record ErrorDetail(HttpStatus httpStatus, String code, String message) { | ||
|
|
||
| public static ErrorDetail from(BaseStatusCode code) { | ||
| return new ErrorDetail( | ||
| code.getHttpStatus(), | ||
| code.getCode(), | ||
| code.getMessage() | ||
| ); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아키텍처 구조 파악하면서 하나 궁금한게
application에는 domain, common
Infrastructure에는 domain, common, application 의존성 추가하는데
bootstrap에는 implementation project(:main-modules:user:infrastructure) 이거 추가 안 해도 되나?
implementation project(':main-modules:common')은 추가되어 있길래
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 넣는 게 맞음.
왜 뺐냐면 헥사고날 아키텍쳐에서는 bootstrap에서 컨트롤러도 포함하는데 모듈리스에서는 도메인 별로 모듈을 갖추니까 어댑터의 일종인 컨트롤러를 bootstrap에 넣는 게 모호하더라고. 그래서 도메인 모듈로 뺐는데 넣는 게 맞는 듯.