-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] #282 - 소셜 API 구현 #283
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9369982
[Chore] #282 - History 관련 ResponseDTO 패키징 변경
0lynny 37d4959
[Feat] #282 - Social 관련 ResponseDTO 추가
0lynny f023bfd
[Fix] #282 - OKRResponseDto 변경
0lynny 40872ac
[Feat] #282 - Social 관련 Repository코드 작성
0lynny c52ab19
[Feat] #282 - Social API 구현
0lynny b2d9a68
[Fix] #282 - 사용하지 않는 코드 삭제
0lynny 772e2c7
[Feat] #282 - Social API Swagger 문서 추가
0lynny 192c895
[Fix] #282 - 데이터 정렬 조건 변경
0lynny c769667
[Fix] #282 - 데이터 정렬 조건 기획 결정 사항 반영
0lynny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion
2
...ive/dto/response/HistoryKeyResultDto.java → ...response/history/HistoryKeyResultDto.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
3 changes: 2 additions & 1 deletion
3
...dto/response/HistoryObjectiveListDto.java → ...onse/history/HistoryObjectiveListDto.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
2 changes: 1 addition & 1 deletion
2
...tive/dto/response/HistoryResponseDto.java → .../response/history/HistoryResponseDto.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
2 changes: 1 addition & 1 deletion
2
...bjective/dto/response/HistoryTaskDto.java → .../dto/response/history/HistoryTaskDto.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
3 changes: 2 additions & 1 deletion
3
...dto/response/ObjectiveGroupByYearDto.java → ...onse/history/ObjectiveGroupByYearDto.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
2 changes: 1 addition & 1 deletion
2
...nshot/objective/dto/response/YearDto.java → ...jective/dto/response/history/YearDto.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
35 changes: 35 additions & 0 deletions
35
...shot-api/src/main/java/org/moonshot/objective/dto/response/social/SocialKeyResultDto.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,35 @@ | ||
package org.moonshot.objective.dto.response.social; | ||
|
||
import org.moonshot.keyresult.model.KeyResult; | ||
|
||
import java.time.format.DateTimeFormatter; | ||
import java.util.List; | ||
|
||
public record SocialKeyResultDto( | ||
String krTitle, | ||
String krStartAt, | ||
String krExpireAt, | ||
Long keyResultId, | ||
Integer krIdx, | ||
Long krTarget, | ||
String krMetric, | ||
List<SocialTaskDto> taskList | ||
) { | ||
public static SocialKeyResultDto of(KeyResult keyResult) { | ||
return getSocialKeyResultDto(keyResult); | ||
} | ||
|
||
private static SocialKeyResultDto getSocialKeyResultDto(KeyResult keyResult) { | ||
return new SocialKeyResultDto( | ||
keyResult.getTitle(), | ||
keyResult.getPeriod().getStartAt().format(DateTimeFormatter.ISO_LOCAL_DATE), | ||
keyResult.getPeriod().getExpireAt().format(DateTimeFormatter.ISO_LOCAL_DATE), | ||
keyResult.getId(), | ||
keyResult.getIdx(), | ||
keyResult.getTarget(), | ||
keyResult.getMetric(), | ||
keyResult.getTaskList().stream().map(SocialTaskDto::of).toList() | ||
); | ||
} | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
...ot-api/src/main/java/org/moonshot/objective/dto/response/social/SocialOKRResponseDto.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,26 @@ | ||
package org.moonshot.objective.dto.response.social; | ||
|
||
import org.moonshot.objective.model.Objective; | ||
import org.moonshot.user.model.User; | ||
|
||
public record SocialOKRResponseDto( | ||
String category, | ||
String userName, | ||
String userImg, | ||
Long like, | ||
String userIntro, | ||
SocialObjectiveDto okrTreeData | ||
) { | ||
public static SocialOKRResponseDto of(Objective objective) { | ||
return new SocialOKRResponseDto( | ||
objective.getCategory().getValue(), | ||
objective.getUser().getNickname(), | ||
objective.getUser().getImageUrl(), | ||
objective.getHeartCount(), | ||
objective.getUser().getDescription(), | ||
SocialObjectiveDto.of(objective) | ||
); | ||
} | ||
|
||
} | ||
|
26 changes: 26 additions & 0 deletions
26
...shot-api/src/main/java/org/moonshot/objective/dto/response/social/SocialObjectiveDto.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,26 @@ | ||
package org.moonshot.objective.dto.response.social; | ||
|
||
import org.moonshot.objective.model.Objective; | ||
|
||
import java.time.format.DateTimeFormatter; | ||
import java.util.List; | ||
|
||
public record SocialObjectiveDto( | ||
String objTitle, | ||
String objCategory, | ||
String objContent, | ||
String objStartAt, | ||
String objExpireAt, | ||
List<SocialKeyResultDto> krList | ||
) { | ||
public static SocialObjectiveDto of(Objective objective) { | ||
return new SocialObjectiveDto( | ||
objective.getTitle(), | ||
objective.getCategory().getValue(), | ||
objective.getContent(), | ||
objective.getPeriod().getStartAt().format(DateTimeFormatter.ISO_LOCAL_DATE), | ||
objective.getPeriod().getExpireAt().format(DateTimeFormatter.ISO_LOCAL_DATE), | ||
objective.getKeyResultList().stream().map(SocialKeyResultDto::of).toList() | ||
); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
moonshot-api/src/main/java/org/moonshot/objective/dto/response/social/SocialTaskDto.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,15 @@ | ||
package org.moonshot.objective.dto.response.social; | ||
|
||
import org.moonshot.task.model.Task; | ||
|
||
public record SocialTaskDto( | ||
String taskTitle, | ||
Integer taskIdx | ||
) { | ||
public static SocialTaskDto of(Task task) { | ||
return new SocialTaskDto( | ||
task.getTitle(), | ||
task.getIdx() | ||
); | ||
} | ||
} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p4;
이러면 만약 특정 Objective가 인기가 좋아서 하트를 많이 받았다는 상황을 가정해보겠습니다.
그러면 하트를 많이 받았던 Objective는 지속적으로 상단에 노출되는 문제가 있는데요.
이부분에 대해서는 어떻게 생각하실까요?
지금은 임시적이지만 답변 부탁드립니다 :)
저는 개인적으로 heartCount가 중요 factor라는 것에는 동의하지만 aging을 통해 우선순위를 낮춰줄 필요도 있다고 생각합니다 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그렇네요 ... 그 부분까지는 고려못했던 것 같습니다.. 일단 최신순 정렬로 다시 수정해두겠습니다 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
192c895
수정하였습니다 ~