Skip to content

feat: 크루 자유게시판 관리#38

Merged
xjvmdutl merged 4 commits intodevelopfrom
feature-11-manage-post
May 18, 2025
Merged

feat: 크루 자유게시판 관리#38
xjvmdutl merged 4 commits intodevelopfrom
feature-11-manage-post

Conversation

@xjvmdutl
Copy link
Collaborator

@xjvmdutl xjvmdutl commented Apr 26, 2025

🔍 PR 타입 선택

아래 타입 중 해당하는 하나를 선택해 주세요. 반드시 하나만 선택해 주세요.

  • feat: 새로운 기능 추가

📝 변경 사항 요약

변경 사항을 간단히 요약해 주세요.

  • 자유 게시판 추가

🛠 관련 이슈

Resolves: #11

추가 설명 (선택 사항)

junhokim 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
@xjvmdutl xjvmdutl added this to the Sprint 1 milestone Apr 26, 2025
@xjvmdutl xjvmdutl requested a review from a team April 26, 2025 10:50
@xjvmdutl xjvmdutl requested review from ekfrehd, jisubaek, mandykr and pparkjs and removed request for a team April 26, 2025 10:50
@xjvmdutl xjvmdutl changed the title Feature 11 manage post feat: 크루 자유게시판 관리 Apr 26, 2025
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);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DDD에서는 애그리거트 루트를 통해서만 하위 엔티티 변경이 되어야 하지만 무의미하게 한번 더 호출되는 메서드는 생성하지 않고 서비스 계층에서 바로 호출하는것도 괜찮을것 같아요.

crew.getPosts().add(post);

Comment on lines +43 to +46

public boolean isCreatedByMe(UUID postCreatedBy) {
return postCreatedBy == memberId;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사용되지 않는 메서드네요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mandykr
해당 메서드는 추후 시큐리티 연동하면, 본인 게시판만 삭제할 수 있도록 미리 작성한 메서드입니다.!
현재는 필요 없으니 지우는게 좋을까요?

import com.retrip.crew.domain.exception.common.EntityNotFoundException;
import com.retrip.crew.domain.exception.common.ErrorCode;

public class PostDeleteException extends BusinessException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

의미상 PostDeleteFailedException 으로 이름 변경하는게 맞을것 같아요

import com.retrip.crew.domain.exception.common.BusinessException;
import com.retrip.crew.domain.exception.common.ErrorCode;

public class PostUpdateException extends BusinessException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

의미상 PostUpdateFailedException 으로 이름 변경하는게 맞을것 같아요

crewTitleContains(keyword)
)
.fetchOne();
return query.select(crew.count()).from(crew).where(crewTitleContains(keyword)).fetchOne();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

적절히 개행해주면 가독성이 더 좋겠네요

- 자유 게시판 PR 수정
@xjvmdutl xjvmdutl merged commit f34e08b into develop May 18, 2025
@xjvmdutl xjvmdutl deleted the feature-11-manage-post branch May 18, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

자유 게시판 관리

3 participants