Skip to content

Commit

Permalink
Merge pull request #155 from CSID-DGU/backend/feature/crew
Browse files Browse the repository at this point in the history
BE: [feat] 반환값 추가 #83
  • Loading branch information
Seoyoung2222 authored Dec 3, 2024
2 parents 02425db + 3688228 commit cd4ab7d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@AllArgsConstructor
public class CrewResponseDto {

private Long crewId;
private String profileImageUrl;
private String title;
private int memberCount;
Expand All @@ -21,6 +22,7 @@ public static CrewResponseDto from(Crew crew) {
.profileImageUrl(crew.getImages() != null ? crew.getImages().getImageUrl() : "")
.title(crew.getTitle())
.memberCount(crew.getCrewUsers().size())
.crewId(crew.getId())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
public class GallerySimpleResponseDto {
private Long postId;
private String imageUrl;
private String content;
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public GalleryPreviewResponseDto getGalleryPreview(Long crewId) {
.map(post -> GallerySimpleResponseDto.builder()
.postId(post.getId())
.imageUrl(post.getImages().get(0).getImageUrl())
.content(post.getContent() != null && post.getContent().length() > 30
? post.getContent().substring(0, 20) + "..."
: post.getContent())
.build())
.collect(Collectors.toList());

Expand Down

0 comments on commit cd4ab7d

Please sign in to comment.