Skip to content
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: 개발질문 게시판의 해시태그 기능 구현 완료 #629

Merged
merged 27 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
443535b
feat(Hashtag): Hashtag와 BoardHashtag 관련 entity와 domain 객체 설계
mingmingmon Dec 14, 2024
2c83f45
feat(HashtagRegister): 해시태그 등록 api 작성
mingmingmon Dec 14, 2024
6480448
feat(BoardRegister): 게시글 생성 시 개발질문 카테고리인 경우 해시태그 저장 로직 추가
mingmingmon Dec 14, 2024
3f32633
refactor(BoardDtoMapper): 게시판 관련 응답 시 해시태그 정보를 포함하도록 수정
mingmingmon Dec 14, 2024
1ca7590
feat(BoardUpdate): 게시글 수정 시 해시태그의 변경 로직 추가
mingmingmon Dec 14, 2024
6b2a81e
feat(BoardsByHashtagRetrievalController): 해시태그로 게시글 조회하는 API 작성
mingmingmon Dec 14, 2024
4c4a70d
fix(BoardsByHashtagRetrievalService): 잘못된 페이지네이션 수정
mingmingmon Dec 14, 2024
8496bd4
refactor(BoardRegisterController): 개발질문 게시판이 아닌 게시판에 해시태그 등록할 경우 예외발생…
mingmingmon Dec 14, 2024
c85f96b
fix(BoardRegisterService, BoardUpdateService): 개발질문 카테고리가 아닌 경우 해시태그 …
mingmingmon Dec 15, 2024
1527242
refactor(BoardHashtagPersistenceAdapter): repository 변수명 앞에 도메인명 삭제
mingmingmon Dec 22, 2024
0a53dd5
refactor(BoardHashtagRepository): SQL문에 개행추가, customRepository에서 JPQL…
mingmingmon Dec 22, 2024
991b9a1
refactor(ExternalBoardHashtag): external 패키지 아래에 위치했던 boardHashtag 관련…
mingmingmon Dec 22, 2024
32fe799
refactor(BoardRegisterService): 게시글 등록 시 해시태그를 표현할 수 있는 카테고리인지 검증하는 로…
mingmingmon Dec 22, 2024
8198678
refactor(BoardHashtagRegisterService): 존재하는 hashtag인지 판단하는 로직 메소드로 표현
mingmingmon Dec 22, 2024
2538b6a
refactor(BoardUpdateService): 복잡한 로직 메소드 추출 및 board update API에서 해시태그…
mingmingmon Dec 22, 2024
b01237d
refactor: 코드 컨벤션 준수하도록 수정
mingmingmon Dec 22, 2024
35f0975
refactor(HashtagRegisterController): 해시태그 등록 권한 수정, 응답 형식 수정 및 도메인 제약…
mingmingmon Dec 22, 2024
7fd88ae
refactor(BoardUpdateService): 사용하지 않는 로깅 코드 삭제
mingmingmon Dec 22, 2024
56b7c5e
feat(HashtagRetrievalController): 존재하는 해시태그 정보 조회하는 API 작성
mingmingmon Dec 22, 2024
b0103cf
refactor(BoardUpdateService): boardHashtag의 변화에 따른 hashtag의 boardUsag…
mingmingmon Dec 22, 2024
d92d201
refactor(HashtagPersistenceAdapter): 이름으로 해시태그를 찾을 때 없는 경우 notfound 예…
mingmingmon Dec 22, 2024
c682599
refactor(HashtagRetrievlaController): 권한 수정
mingmingmon Dec 22, 2024
7d925d3
refactor: 통일된 import문 정렬과 코드 정리 방식을 활용한 정리
mingmingmon Dec 22, 2024
df6ac3a
Merge branch 'develop' into feat/#609
mingmingmon Dec 22, 2024
be6d91d
refactor(HotBoardRetrievalService): 핫 게시글 응답에 HashtagInfo 필드 추가
mingmingmon Dec 22, 2024
fb49e64
refactor(BoardRegisterService): 중복된 해시태그 등록 가능 검사 삭제 및 코드컨벤션 준수
mingmingmon Dec 24, 2024
c33240f
refactor(BoardHashtagRepository): group by와 distinct 동시 사용 대신 group b…
mingmingmon Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,18 @@ public String registerBoard(BoardRequestDto requestDto) throws PermissionDeniedE
List<UploadedFile> uploadedFiles = uploadedFileService.getUploadedFilesByUrls(requestDto.getFileUrlList());
Board board = boardDtoMapper.fromDto(requestDto, currentMemberInfo.getMemberId(), uploadedFiles);
board.validateAccessPermissionForCreation(currentMemberInfo);
board.validateBoardHashtagRegistration(requestDto.getHashtagIdList());

if (board.shouldNotifyForNewBoard(currentMemberInfo)) {
externalSendNotificationUseCase.sendNotificationToMember(currentMemberInfo.getMemberId(),
"[" + board.getTitle() + "] 새로운 공지사항이 등록되었습니다.");
}

BoardNotificationInfo boardInfo = BoardNotificationInfo.create(board, currentMemberInfo);
eventPublisher.publishEvent(new NotificationEvent(this, ExecutivesAlertType.NEW_BOARD, null,
boardInfo));

Board savedBoard = registerBoardPort.save(board);

if (!savedBoard.isDevelopmentQna() && (requestDto.getHashtagIdList() != null && !requestDto.getHashtagIdList().isEmpty())) {
throw new InvalidBoardCategoryHashtagException("개발질문 게시판에만 해시태그를 등록할 수 있습니다.");
}
if (savedBoard.isDevelopmentQna() && requestDto.getHashtagIdList() != null) {
SongJaeHoonn marked this conversation as resolved.
Show resolved Hide resolved
registerBoardHashtagUseCase.registerBoardHashtag(boardHashtagDtoMapper.toDto(savedBoard.getId(), requestDto.getHashtagIdList()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.NoArgsConstructor;
import lombok.Setter;
import page.clab.api.domain.community.board.application.dto.request.BoardUpdateRequestDto;
import page.clab.api.domain.community.board.application.exception.InvalidBoardCategoryHashtagException;
import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto;
import page.clab.api.global.common.file.domain.UploadedFile;
import page.clab.api.global.exception.PermissionDeniedException;
Expand Down Expand Up @@ -74,4 +75,10 @@ public void validateAccessPermissionForCreation(MemberDetailedInfoDto currentMem
throw new PermissionDeniedException("공지사항은 관리자만 작성할 수 있습니다.");
}
}

public void validateBoardHashtagRegistration(List<Long> hashtagIdList) {
SongJaeHoonn marked this conversation as resolved.
Show resolved Hide resolved
if (!isDevelopmentQna() && (hashtagIdList != null && !hashtagIdList.isEmpty())) {
throw new InvalidBoardCategoryHashtagException("개발질문 게시판에만 해시태그를 등록할 수 있습니다.");
}
}
}