-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0a9680
commit 40c5cf2
Showing
12 changed files
with
150 additions
and
56 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
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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/offer/review/application/response/ReviewInfoResponses.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,18 @@ | ||
package com.offer.review.application.response; | ||
|
||
import java.util.List; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ReviewInfoResponses { | ||
|
||
private List<ReviewInfoResponse> reviews; | ||
private boolean hasNext; | ||
|
||
@Builder | ||
public ReviewInfoResponses(List<ReviewInfoResponse> reviews, boolean hasNext) { | ||
this.reviews = reviews; | ||
this.hasNext = hasNext; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
package com.offer.review.domain; | ||
|
||
import com.offer.common.response.ResponseMessage; | ||
import com.offer.common.response.exception.BusinessException; | ||
import java.util.Arrays; | ||
|
||
public enum Role { | ||
BUYER, SELLER, ALL | ||
|
||
; | ||
|
||
public static Role of(String roleStr) { | ||
if (roleStr == null) return ALL; | ||
|
||
roleStr = roleStr.trim(); | ||
|
||
if (roleStr.equalsIgnoreCase(BUYER.name())) { | ||
return BUYER; | ||
} else if (roleStr.equalsIgnoreCase(SELLER.name())) { | ||
return SELLER; | ||
} else { | ||
throw new BusinessException(ResponseMessage.INVALID_ROLE); | ||
} | ||
public static Role of(String role) { | ||
return Arrays.stream(values()) | ||
.filter(it -> it.name().equalsIgnoreCase(role)) | ||
.findAny() | ||
.orElse(ALL); | ||
} | ||
} |
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.