forked from PoolC/Mincho
-
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 #1 from PoolC/dev
production
- Loading branch information
Showing
9 changed files
with
142 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,3 +61,4 @@ jobs: | |
# cd dockercompose/palkia | ||
# docker compose down | ||
# docker compose up -d --build | ||
|
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
46 changes: 46 additions & 0 deletions
46
src/main/java/org/poolc/api/activity/dto/GetActivitiesResponse.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,46 @@ | ||
package org.poolc.api.activity.dto; | ||
|
||
import lombok.Getter; | ||
import org.poolc.api.activity.domain.Activity; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
public class GetActivitiesResponse { | ||
private final Long id; | ||
private final String title; | ||
private final HostResponse host; | ||
private final LocalDate startDate; | ||
private final boolean available; | ||
private final List<TagResponse> tags; | ||
private final Long capacity; | ||
private final boolean isSeminar; | ||
private final Long hour; | ||
private final List<String> memberLoginIds; | ||
|
||
public GetActivitiesResponse(Long id, String title, HostResponse host, LocalDate startDate, boolean available, List<TagResponse> tags, Long capacity, boolean isSeminar, Long hour,List<String> memberLoginIds) { | ||
this.id = id; | ||
this.title = title; | ||
this.host = host; | ||
this.startDate = startDate; | ||
this.available = available; | ||
this.tags = tags; | ||
this.capacity = capacity; | ||
this.isSeminar = isSeminar; | ||
this.hour = hour; | ||
this.memberLoginIds = memberLoginIds; | ||
} | ||
|
||
public static GetActivitiesResponse of(Activity activity) { | ||
List<TagResponse> tags = activity.getTags().stream() | ||
.map(t -> new TagResponse(t)) | ||
.collect(Collectors.toList()); | ||
HostResponse host = HostResponse.of(activity.getHost()); | ||
return new GetActivitiesResponse(activity.getId(), activity.getTitle(), host, | ||
activity.getStartDate(), activity.getAvailable(), | ||
tags, activity.getCapacity(), activity.getIsSeminar(), activity.getHour(), activity.getMemberLoginIDs() | ||
); | ||
} | ||
} |
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
64 changes: 64 additions & 0 deletions
64
src/main/java/org/poolc/api/post/dto/GetPostsResponse.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,64 @@ | ||
package org.poolc.api.post.dto; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.poolc.api.badge.domain.Badge; | ||
import org.poolc.api.comment.dto.CommentResponse; | ||
import org.poolc.api.post.domain.BoardType; | ||
import org.poolc.api.post.domain.JobType; | ||
import org.poolc.api.post.domain.Post; | ||
import org.poolc.api.post.domain.PostType; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@Setter | ||
public class GetPostsResponse { | ||
private Long postId; | ||
private BoardType boardType; | ||
private String writerLoginId; | ||
private String writerName; | ||
private String postProfileImageUrl; | ||
private Badge badge; | ||
private String title; | ||
private String body; | ||
private LocalDateTime createdAt; | ||
private PostType postType; | ||
private Boolean isQuestion; | ||
private Long likeCount; | ||
private Long scrapCount; | ||
private Long commentCount; | ||
private JobType position; | ||
private String region; | ||
private String field; | ||
private LocalDate deadline; | ||
|
||
public static GetPostsResponse of(Post post) { | ||
GetPostsResponse response = new GetPostsResponse(); | ||
|
||
if (post.getIsDeleted()) return null; | ||
if (!post.getAnonymous()) { | ||
response.setWriterName(post.getMember().getName()); | ||
response.setWriterLoginId(post.getMember().getLoginID()); | ||
response.setPostProfileImageUrl(post.getMember().getProfileImageURL()); | ||
response.setBadge(post.getMember().getBadge()); | ||
} | ||
if (post.getPostType() == PostType.GENERAL_POST) response.setIsQuestion(post.getIsQuestion()); | ||
|
||
response.setPostId(post.getId()); | ||
response.setBoardType(post.getBoardType()); | ||
response.setTitle(post.getTitle()); | ||
response.setBody(post.getBody()); | ||
response.setCreatedAt(post.getCreatedAt()); | ||
response.setCommentCount(post.getCommentCount()); | ||
response.setPostType(post.getPostType()); | ||
response.setPosition(post.getPosition()); | ||
response.setRegion(post.getRegion()); | ||
response.setField(post.getField()); | ||
response.setDeadline(post.getDeadline()); | ||
return response; | ||
} | ||
} |
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