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 @@ -38,7 +38,7 @@ public List<BoardHashtag> getAllIncludingDeletedByBoardId(Long boardId) {
.collect(Collectors.toList());
}

public List<Long> getBoardIdsByHashTagId(List<Long> hashtagIds, Pageable pageable) {
return repository.getBoardIdsByHashTagId(hashtagIds, pageable);
public List<Long> getBoardIdsByHashTagId(List<Long> hashtagIds) {
return repository.getBoardIdsByHashTagId(hashtagIds, (long)hashtagIds.size());
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
package page.clab.api.domain.community.board.adapter.out.persistence;

import java.util.List;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface BoardHashtagRepository extends JpaRepository<BoardHashtagJpaEntity, Long>, BoardHashtagRepositoryCustom, QuerydslPredicateExecutor<BoardHashtagJpaEntity> {
public interface BoardHashtagRepository extends JpaRepository<BoardHashtagJpaEntity, Long>{

List<BoardHashtagJpaEntity> findAllByBoardId(Long boardId);

@Query(value = "SELECT b.* FROM board_hashtag b WHERE b.board_id = :boardId", nativeQuery = true)
@Query(value = "SELECT b.* " +
"FROM board_hashtag b " +
"WHERE b.board_id = :boardId",
nativeQuery = true)
List<BoardHashtagJpaEntity> findAllIncludingDeletedByBoardId(Long boardId);
mingmingmon marked this conversation as resolved.
Show resolved Hide resolved

@Query("SELECT DISTINCT b.boardId " +
"FROM BoardHashtagJpaEntity b " +
"WHERE b.hashtagId IN :hashtagIds " +
"AND b.isDeleted = false " +
"GROUP BY b.boardId " +
SongJaeHoonn marked this conversation as resolved.
Show resolved Hide resolved
"HAVING COUNT(b.hashtagId) = :size")
SongJaeHoonn marked this conversation as resolved.
Show resolved Hide resolved
List<Long> getBoardIdsByHashTagId(@Param("hashtagIds") List<Long> hashtagIds, @Param("size") Long size);
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public interface RetrieveBoardHashtagPort {

List<BoardHashtag> getAllIncludingDeletedByBoardId(Long boardId);

List<Long> getBoardIdsByHashTagId(List<Long> hashtagIds, Pageable pageable);
List<Long> getBoardIdsByHashTagId(List<Long> hashtagIds);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public PagedResponseDto<BoardOverviewResponseDto> retrieveBoardsByHashtag(List<S
hashtagIds.add(externalRetrieveHashtagUseCase.getByName(hashtag).getId());
}

List<Long> boardIds = externalRetrieveBoardHashtagUseCase.getBoardIdsByHashTagId(hashtagIds, pageable);
List<Long> boardIds = externalRetrieveBoardHashtagUseCase.getBoardIdsByHashTagId(hashtagIds);

List<Board> boards = boardIds.stream()
.map(externalRetrieveBoardUseCase::getById)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public interface ExternalRetrieveBoardHashtagUseCase {

List<BoardHashtag> getAllIncludingDeletedByBoardId(Long boardId);

List<Long> getBoardIdsByHashTagId(List<Long> hashtagIds, Pageable pageable);
List<Long> getBoardIdsByHashTagId(List<Long> hashtagIds);
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public List<BoardHashtag> getAllIncludingDeletedByBoardId(Long boardId) {
}

@Override
public List<Long> getBoardIdsByHashTagId(List<Long> hashtagIds, Pageable pageable) {
return retrieveBoardHashtagPort.getBoardIdsByHashTagId(hashtagIds, pageable);
public List<Long> getBoardIdsByHashTagId(List<Long> hashtagIds) {
return retrieveBoardHashtagPort.getBoardIdsByHashTagId(hashtagIds);
}
}