Skip to content

Commit

Permalink
refactor: 변경 도메인이 상단에 존재하도록 request 파일 명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
llddang committed Jan 18, 2025
1 parent 00e11b7 commit dc9848e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions backend/src/main/java/sw_css/member/api/MemberController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.springframework.web.bind.annotation.RestController;
import sw_css.member.application.MemberCommandService;
import sw_css.member.application.MemberQueryService;
import sw_css.member.application.dto.request.ChangePasswordRequest;
import sw_css.member.application.dto.request.MemberChangePasswordRequest;
import sw_css.member.application.dto.request.MemberChangeInfoRequest;
import sw_css.member.application.dto.response.StudentMemberResponse;
import sw_css.member.domain.Member;
Expand All @@ -35,7 +35,7 @@ public ResponseEntity<StudentMemberResponse> findStudent(@PathVariable final Lon

@PatchMapping("/change-password")
public ResponseEntity<Void> changeMemberPassword(@MemberInterface Member me,
@RequestBody @Valid ChangePasswordRequest request) {
@RequestBody @Valid MemberChangePasswordRequest request) {
memberCommandService.changePassword(me, request.oldPassword(), request.newPassword());
return ResponseEntity.noContent().build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import jakarta.validation.constraints.Pattern;
import sw_css.member.domain.embedded.Password;

public record ChangePasswordRequest(
public record MemberChangePasswordRequest(
@NotBlank(message = "이전 비밀번호 값을 입력해주세요.")
String oldPassword,
@Pattern(regexp = Password.PASSWORD_REGEX, message = Password.PASSWORD_INVALID)
String newPassword) {

public static ChangePasswordRequest from(String oldPassword, String newPassword) {
return new ChangePasswordRequest(oldPassword, newPassword);
public static MemberChangePasswordRequest from(String oldPassword, String newPassword) {
return new MemberChangePasswordRequest(oldPassword, newPassword);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.restdocs.payload.ResponseFieldsSnippet;
import org.springframework.restdocs.request.PathParametersSnippet;
import sw_css.member.api.MemberController;
import sw_css.member.application.dto.request.ChangePasswordRequest;
import sw_css.member.application.dto.request.MemberChangePasswordRequest;
import sw_css.member.application.dto.request.MemberChangeInfoRequest;
import sw_css.member.application.dto.response.StudentMemberResponse;
import sw_css.member.domain.Member;
Expand Down Expand Up @@ -78,7 +78,7 @@ public void changePassword() throws Exception {
final String newPassword = "asdf1234!";
final String token = "Bearer AccessToken";

final ChangePasswordRequest request = new ChangePasswordRequest(oldPassword, newPassword);
final MemberChangePasswordRequest request = new MemberChangePasswordRequest(oldPassword, newPassword);

// when
doNothing().when(memberCommandService).changePassword(me, oldPassword, newPassword);
Expand Down

0 comments on commit dc9848e

Please sign in to comment.