-
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.
Merge pull request #23 from 2024-pre-onboarding-backend-F/feat/store
[merge] ๋ง์ง ์กฐํ API ๊ฐ๋ฐ
- Loading branch information
Showing
10 changed files
with
65 additions
and
32 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
24 changes: 7 additions & 17 deletions
24
src/main/java/wanted/ribbon/store/controller/StoreController.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
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
2 changes: 1 addition & 1 deletion
2
src/main/java/wanted/ribbon/store/dto/CreateReviewResponseDto.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package wanted.ribbon.store.dto; | ||
|
||
public record CreateReviewResponseDto(int score, String content) { | ||
public record CreateReviewResponseDto(String id, int score, String content) { | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/wanted/ribbon/store/dto/ReviewListResponseDto.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package wanted.ribbon.store.dto; | ||
|
||
public record ReviewListResponseDto(int score, String content) { | ||
public record ReviewListResponseDto(String id, int score, String content) { | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/wanted/ribbon/store/dto/StoreListResponseDto.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 wanted.ribbon.store.dto; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import wanted.ribbon.store.domain.Store; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public record StoreListResponseDto(int totalCount, List<StoreResponseDto> stores) { | ||
|
||
public static StoreListResponseDto fromStoreList(List<Store> storeList) { | ||
List<StoreResponseDto> storeResponseDto = storeList.stream() | ||
.map(StoreResponseDto::from) | ||
.collect(Collectors.toList()); | ||
return new StoreListResponseDto(storeList.size(), storeResponseDto); | ||
} | ||
|
||
// record ํ์ ์ ๋ฉ์๋๋ฅผ ์ถ๊ฐํ์ ๋ Jackson ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ record์ ๋ชจ๋ ๋ฉ์๋๋ฅผ ์ง๋ ฌํ ๋์ ํ๋๋ก ๊ฐ์ฃผํ๊ธฐ ๋๋ฌธ์ | ||
@JsonIgnore // ์ง๋ ฌํ ๊ณผ์ ฑ์์ ๋ฌด์ํ๊ธฐ์ํด ์ฌ์ฉํจ | ||
public boolean isEmpty() { | ||
return stores.isEmpty(); | ||
} | ||
} |
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