-
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 #15 from Mojacknong/feature_6/farmclub-기본-api
Feature 6/farmclub 기본 api
- Loading branch information
Showing
19 changed files
with
298 additions
and
12 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
7 changes: 7 additions & 0 deletions
7
...modernfarmer/farmusspring/domain/farmclub/dto/req/CreateMissionPostCommentRequestDto.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,7 @@ | ||
package com.modernfarmer.farmusspring.domain.farmclub.dto.req; | ||
|
||
public record CreateMissionPostCommentRequestDto( | ||
Long missionPostId, | ||
String content | ||
) { | ||
} |
7 changes: 7 additions & 0 deletions
7
...om/modernfarmer/farmusspring/domain/farmclub/dto/req/CreateMissionPostLikeRequestDto.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,7 @@ | ||
package com.modernfarmer.farmusspring.domain.farmclub.dto.req; | ||
|
||
public record CreateMissionPostLikeRequestDto( | ||
Long missionPostId, | ||
Long userId | ||
) { | ||
} |
16 changes: 16 additions & 0 deletions
16
...odernfarmer/farmusspring/domain/farmclub/dto/res/CreateMissionPostCommentResponseDto.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,16 @@ | ||
package com.modernfarmer.farmusspring.domain.farmclub.dto.res; | ||
|
||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record CreateMissionPostCommentResponseDto( | ||
Long missionPostCommentId | ||
) { | ||
|
||
public static CreateMissionPostCommentResponseDto of(Long missionPostCommentId) { | ||
return CreateMissionPostCommentResponseDto.builder() | ||
.missionPostCommentId(missionPostCommentId) | ||
.build(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...m/modernfarmer/farmusspring/domain/farmclub/dto/res/CreateMissionPostLikeResponseDto.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 com.modernfarmer.farmusspring.domain.farmclub.dto.res; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record CreateMissionPostLikeResponseDto( | ||
Long missionPostLikeId | ||
) { | ||
|
||
public static CreateMissionPostLikeResponseDto of(Long missionPostLikeId) { | ||
return CreateMissionPostLikeResponseDto.builder() | ||
.missionPostLikeId(missionPostLikeId) | ||
.build(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...m/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMissionPostCommentResponseDto.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 com.modernfarmer.farmusspring.domain.farmclub.dto.res; | ||
|
||
import com.modernfarmer.farmusspring.domain.farmclub.vo.MissionPostCommentVo; | ||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
public record GetMissionPostCommentResponseDto( | ||
List<MissionPostCommentVo> comments | ||
) { | ||
public static GetMissionPostCommentResponseDto of(List<MissionPostCommentVo> comments) { | ||
return GetMissionPostCommentResponseDto.builder() | ||
.comments(comments) | ||
.build(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
.../com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetMissionPostListResponseDto.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 com.modernfarmer.farmusspring.domain.farmclub.dto.res; | ||
|
||
import com.modernfarmer.farmusspring.domain.farmclub.vo.MissionPostVo; | ||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
public record GetMissionPostListResponseDto( | ||
List<MissionPostVo> missionPosts | ||
) { | ||
public static GetMissionPostListResponseDto of(List<MissionPostVo> missionPosts) { | ||
return GetMissionPostListResponseDto.builder() | ||
.missionPosts(missionPosts) | ||
.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
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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/MissionPostHelper.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 |
---|---|---|
@@ -1,9 +1,20 @@ | ||
package com.modernfarmer.farmusspring.domain.farmclub.helper; | ||
|
||
import com.modernfarmer.farmusspring.domain.farmclub.entity.MissionPost; | ||
import com.modernfarmer.farmusspring.domain.farmclub.exception.FarmClubErrorCode; | ||
import com.modernfarmer.farmusspring.domain.farmclub.exception.custom.FarmClubEntityNotFoundException; | ||
import com.modernfarmer.farmusspring.domain.farmclub.repository.MissionPostRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class MissionPostHelper { | ||
|
||
private final MissionPostRepository missionPostRepository; | ||
|
||
public MissionPost getMissionPost(Long missionPostId) { | ||
return missionPostRepository.findById(missionPostId) | ||
.orElseThrow(() -> new FarmClubEntityNotFoundException("존재하지 않는 미션 게시글입니다.", FarmClubErrorCode.MISSION_POST_NOT_FOUND)); | ||
} | ||
} |
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.