Conversation
added 3 commits
March 28, 2025 22:26
- 자유 게시판 조회 기능 추가
# Conflicts: # src/main/java/com/retrip/crew/application/in/CrewService.java # src/main/java/com/retrip/crew/application/out/repository/CrewQueryRepository.java # src/main/java/com/retrip/crew/domain/entity/Crew.java # src/main/java/com/retrip/crew/domain/entity/CrewMember.java # src/main/java/com/retrip/crew/domain/exception/common/ErrorCode.java # src/main/java/com/retrip/crew/infra/adapter/out/persistence/mysql/query/CrewQuerydslRepository.java # src/test/java/com/retrip/crew/common/config/QuerydslConfig.java
mandykr
reviewed
Apr 28, 2025
src/main/java/com/retrip/crew/infra/adapter/in/presentation/rest/PostController.java
Outdated
Show resolved
Hide resolved
src/main/java/com/retrip/crew/infra/adapter/in/presentation/rest/PostController.java
Show resolved
Hide resolved
Comment on lines
+100
to
+110
| public void addPost(Post post) { | ||
| this.posts.getValues().add(post); | ||
| } | ||
|
|
||
| public Post updatePost(UUID postId, String title, String content, UUID userId) { | ||
| return this.posts.updatePost(postId, title, content, userId); | ||
| } | ||
|
|
||
| public UUID deletePost(UUID postId, CrewMember crewMember) { | ||
| return this.posts.deletePost(postId, crewMember); | ||
| } |
Contributor
There was a problem hiding this comment.
DDD에서는 애그리거트 루트를 통해서만 하위 엔티티 변경이 되어야 하지만 무의미하게 한번 더 호출되는 메서드는 생성하지 않고 서비스 계층에서 바로 호출하는것도 괜찮을것 같아요.
crew.getPosts().add(post);
Comment on lines
+43
to
+46
|
|
||
| public boolean isCreatedByMe(UUID postCreatedBy) { | ||
| return postCreatedBy == memberId; | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
@mandykr 님
해당 메서드는 추후 시큐리티 연동하면, 본인 게시판만 삭제할 수 있도록 미리 작성한 메서드입니다.!
현재는 필요 없으니 지우는게 좋을까요?
| import com.retrip.crew.domain.exception.common.EntityNotFoundException; | ||
| import com.retrip.crew.domain.exception.common.ErrorCode; | ||
|
|
||
| public class PostDeleteException extends BusinessException { |
Contributor
There was a problem hiding this comment.
의미상 PostDeleteFailedException 으로 이름 변경하는게 맞을것 같아요
| import com.retrip.crew.domain.exception.common.BusinessException; | ||
| import com.retrip.crew.domain.exception.common.ErrorCode; | ||
|
|
||
| public class PostUpdateException extends BusinessException { |
Contributor
There was a problem hiding this comment.
의미상 PostUpdateFailedException 으로 이름 변경하는게 맞을것 같아요
| crewTitleContains(keyword) | ||
| ) | ||
| .fetchOne(); | ||
| return query.select(crew.count()).from(crew).where(crewTitleContains(keyword)).fetchOne(); |
- 자유 게시판 PR 수정
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🔍 PR 타입 선택
아래 타입 중 해당하는 하나를 선택해 주세요. 반드시 하나만 선택해 주세요.
feat: 새로운 기능 추가📝 변경 사항 요약
변경 사항을 간단히 요약해 주세요.
🛠 관련 이슈
Resolves: #11
추가 설명 (선택 사항)