-
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.
* test: 사용자 계정 api 내부 클래스로 분리 * test: 사용자 이름 수정 controller unit pre-condition 작성 * test: 이름 수정 요청 controller unit test case 작성 * fix: 일반 회원가입 계정이 아닌 예외 상수 추가 : 4004 * feat: 이름 변경 요청 dto 정의 * feat: put_name() controller 메서드 추가 * feat: update_name() usecase 추가 및 void 타입에 맞게 테스트 코드 given 수정 * test: 422 예상 에러 코드 수정 * test: 사용자 계정 usecase 기존 test 내부 클래스로 분리 * test: 일반 회원가입 유저 pre-condition 제거 * test: 이름 수정 usecase test case 작성 * feat: 사용자 이름 수정 로직 구현 * feat: user 도메인 이름 수정 메서드 추가 * test: user_account_use_case_test 순서 지정 * fix: 디바이스 비활성화 em.create_query() -> 메서드 호출 (기존 방식 에러 발생) * test: 사용자 닉네임 수정 controller unit test 작성 * feat: 사용자 아이디 변경 요청 dto 작성 * feat: 사용자 아이디 변경 요청 api 작성 * feat: 사용자 아이디 변경 요청 usecase 작성 * feat: 사용자 아이디 변경 service 로직 구현 * test: nickname -> username * test: 테스트 코드에서 entitymanager 주입 제거 * refactor: user account use case 사용자 조회 메서드 분리 * fix: 이름 및 아이디 수정 요청 메서드 put -> patch * test: put 요청 patch로 변경
- Loading branch information
1 parent
f000034
commit b267155
Showing
9 changed files
with
545 additions
and
226 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
25 changes: 25 additions & 0 deletions
25
...pp-external-api/src/main/java/kr/co/pennyway/api/apis/users/dto/UserProfileUpdateDto.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,25 @@ | ||
package kr.co.pennyway.api.apis.users.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.Pattern; | ||
|
||
public class UserProfileUpdateDto { | ||
@Schema(title = "이름 변경 요청 DTO") | ||
public record NameReq( | ||
@Schema(description = "이름", example = "페니웨이") | ||
@NotBlank(message = "이름을 입력해주세요") | ||
@Pattern(regexp = "^[가-힣a-z]{2,8}$", message = "2~8자의 한글, 영문 소문자만 사용 가능합니다.") | ||
String name | ||
) { | ||
} | ||
|
||
@Schema(title = "아이디 변경 요청 DTO") | ||
public record UsernameReq( | ||
@Schema(description = "아이디", example = "pennyway") | ||
@NotBlank(message = "아이디를 입력해주세요") | ||
@Pattern(regexp = "^[a-z-_.]{5,20}$", message = "5~20자의 영문 소문자, -, _, . 만 사용 가능합니다.") | ||
String username | ||
) { | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...nal-api/src/main/java/kr/co/pennyway/api/apis/users/service/UserProfileUpdateService.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 kr.co.pennyway.api.apis.users.service; | ||
|
||
import kr.co.pennyway.domain.domains.user.domain.User; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Slf4j | ||
@Service | ||
@RequiredArgsConstructor | ||
public class UserProfileUpdateService { | ||
@Transactional | ||
public void updateName(User user, String newName) { | ||
user.updateName(newName); | ||
} | ||
|
||
@Transactional | ||
public void updateUsername(User user, String newUsername) { | ||
user.updateUsername(newUsername); | ||
} | ||
} |
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.