-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] 호스트 승인 신청 내역 조회 API 구현
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/pickple/server/api/submitter/dto/response/SubmitterListGetResponse.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,29 @@ | ||
package com.pickple.server.api.submitter.dto.response; | ||
|
||
import com.pickple.server.api.submitter.domain.SubmitterCategoryInfo; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record SubmitterListGetResponse( | ||
String guestNickname, | ||
Long guestId, | ||
|
||
Long submitterId, | ||
|
||
String intro, | ||
|
||
String goal, | ||
|
||
String link, | ||
|
||
String nickname, | ||
|
||
SubmitterCategoryInfo categoryList, | ||
|
||
String plan, | ||
|
||
String email, | ||
|
||
String submitterState | ||
) { | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/pickple/server/api/submitter/service/SubmitterQueryService.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,39 @@ | ||
package com.pickple.server.api.submitter.service; | ||
|
||
|
||
import com.pickple.server.api.submitter.domain.Submitter; | ||
import com.pickple.server.api.submitter.dto.response.SubmitterListGetResponse; | ||
import com.pickple.server.api.submitter.repository.SubmitterRepository; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
public class SubmitterQueryService { | ||
|
||
private final SubmitterRepository submitterRepository; | ||
|
||
public List<SubmitterListGetResponse> getSubmitterList() { | ||
List<Submitter> submitterList = submitterRepository.findAll(); | ||
|
||
return submitterList.stream() | ||
.map(submitter -> SubmitterListGetResponse.builder() | ||
.guestNickname(submitter.getGuest().getNickname()) | ||
.guestId(submitter.getGuest().getId()) | ||
.submitterId(submitter.getId()) | ||
.intro(submitter.getIntro()) | ||
.goal(submitter.getGoal()) | ||
.link(submitter.getLink()) | ||
.nickname(submitter.getNickname()) | ||
.categoryList(submitter.getCategoryList()) | ||
.plan(submitter.getPlan()) | ||
.email(submitter.getEmail()) | ||
.submitterState(submitter.getSubmitterState()) | ||
.build()) | ||
.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