-
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.
#551 [feat] MoimPopularInfo 자료구조 Set으로 변경 및 n+1 문제 해결
- Loading branch information
Showing
5 changed files
with
24 additions
and
15 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
11 changes: 7 additions & 4 deletions
11
...omain/src/main/java/com/mile/moim/service/dto/response/MoimMostCuriousWriterResponse.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,19 +1,22 @@ | ||
package com.mile.moim.service.dto.response; | ||
|
||
import com.mile.moim.domain.popular.MoimCuriousWriter; | ||
import com.mile.writername.domain.WriterName; | ||
|
||
import com.mile.writername.service.dto.response.PopularWriterResponse; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
public record MoimMostCuriousWriterResponse(List<PopularWriterResponse> popularWriters) { | ||
|
||
public static MoimMostCuriousWriterResponse of(final List<MoimCuriousWriter> writers) { | ||
public static MoimMostCuriousWriterResponse of(final Set<MoimCuriousWriter> writers) { | ||
return new MoimMostCuriousWriterResponse( | ||
writers | ||
.stream() | ||
.map(PopularWriterResponse::of) | ||
.collect(Collectors.toList())); | ||
.stream() | ||
.map(PopularWriterResponse::of) | ||
.collect(Collectors.toList())); | ||
} | ||
|
||
} |
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