-
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 #27 from kusitms-28th-Meetup-E/14-mainpage-api
feat(#14):이슈 검색 API
- Loading branch information
Showing
7 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/java/gwangjang/server/domain/Issue/application/dto/res/SearchListRes.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,20 @@ | ||
package gwangjang.server.domain.Issue.application.dto.res; | ||
|
||
import gwangjang.server.domain.Issue.domain.entity.Topic; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Builder | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class SearchListRes { | ||
private Long issueId; | ||
private String issueTitle; | ||
private String issueDetail; | ||
private String imgUrl; | ||
private String topicTitle; | ||
private String topicId; | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/gwangjang/server/domain/Issue/application/dto/res/SearchRes.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,17 @@ | ||
package gwangjang.server.domain.Issue.application.dto.res; | ||
|
||
import lombok.*; | ||
|
||
import java.util.List; | ||
@Getter | ||
@Builder | ||
@Setter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class SearchRes { | ||
|
||
String searchKeyword; | ||
String searchCount; | ||
|
||
List<SearchListRes> issueResList; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/gwangjang/server/domain/Issue/application/mapper/IssueMapper.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 gwangjang.server.domain.Issue.application.mapper; | ||
|
||
import gwangjang.server.domain.Issue.application.dto.res.SearchListRes; | ||
import gwangjang.server.domain.Issue.domain.entity.Issue; | ||
import gwangjang.server.global.annotation.Mapper; | ||
|
||
@Mapper | ||
public class IssueMapper { | ||
public SearchListRes mapToSearchListRes(Issue issue) { | ||
SearchListRes searchListRes = new SearchListRes(); | ||
searchListRes.setIssueId(issue.getId()); | ||
searchListRes.setIssueTitle(issue.getIssueTitle()); | ||
searchListRes.setIssueDetail(issue.getIssueDetail()); | ||
searchListRes.setImgUrl(issue.getImgUrl()); | ||
|
||
// Topic이 null이 아닌 경우에만 매핑 | ||
if (issue.getTopic() != null) { | ||
searchListRes.setTopicTitle(issue.getTopic().getTopicTitle()); | ||
searchListRes.setTopicId(String.valueOf(issue.getTopic().getId())); | ||
} | ||
|
||
return searchListRes; | ||
} | ||
} |
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