-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- CSRF 공격 방어는 고려하지 않음 - Auction 도메인 쪽 테스트의 인덴트 정렬 - 로그인을 완료하면 식별자와 역할 정보를 세션에 담습니다.
- Loading branch information
Showing
11 changed files
with
208 additions
and
103 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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/wootecam/luckyvickyauction/core/member/dto/SignInInfo.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,24 @@ | ||
package com.wootecam.luckyvickyauction.core.member.dto; | ||
|
||
import com.wootecam.luckyvickyauction.core.member.domain.Role; | ||
import com.wootecam.luckyvickyauction.global.exception.BadRequestException; | ||
import com.wootecam.luckyvickyauction.global.exception.ErrorCode; | ||
import java.util.Objects; | ||
|
||
public record SignInInfo( | ||
Long id, | ||
Role role | ||
) { | ||
private static final String ERROR_NULL_VALUE = "%s는 Null일 수 없습니다."; | ||
|
||
public SignInInfo { | ||
validateNotNull(id, "로그인한 사용자의 식별자"); | ||
validateNotNull(role, "로그인한 사용자의 역할"); | ||
} | ||
|
||
private void validateNotNull(Object value, String fieldName) { | ||
if (Objects.isNull(value)) { | ||
throw new BadRequestException(String.format(ERROR_NULL_VALUE, fieldName), ErrorCode.G000); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/wootecam/luckyvickyauction/core/member/dto/SignInRequestInfo.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,24 @@ | ||
package com.wootecam.luckyvickyauction.core.member.dto; | ||
|
||
import com.wootecam.luckyvickyauction.global.exception.BadRequestException; | ||
import com.wootecam.luckyvickyauction.global.exception.ErrorCode; | ||
import java.util.Objects; | ||
|
||
public record SignInRequestInfo( | ||
String signInId, | ||
String password | ||
) { | ||
|
||
private static final String ERROR_NULL_VALUE = "%s는 Null일 수 없습니다."; | ||
|
||
public SignInRequestInfo { | ||
validateNotNull(signInId, "로그인 ID"); | ||
validateNotNull(password, "로그인 패스워드"); | ||
} | ||
|
||
private void validateNotNull(Object value, String fieldName) { | ||
if (Objects.isNull(value)) { | ||
throw new BadRequestException(String.format(ERROR_NULL_VALUE, fieldName), ErrorCode.G000); | ||
} | ||
} | ||
} |
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
7 changes: 0 additions & 7 deletions
7
src/test/java/com/wootecam/luckyvickyauction/core/auction/domain/ProductTest.java
This file was deleted.
Oops, something went wrong.
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.