Skip to content

Commit

Permalink
fix(docs): DocsRepository에서 JpaRepository와 CustomDocsRepository 이중 상속…
Browse files Browse the repository at this point in the history
…하는 부분 분리
  • Loading branch information
jacobhboy committed Apr 16, 2024
1 parent ca2e71d commit 1ce5173
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.project.bumawiki.global.error.exception.BumawikiException;
import com.project.bumawiki.global.error.exception.ErrorCode;

public interface DocsRepository extends JpaRepository<Docs, Long>, CustomDocsRepository {
public interface DocsRepository extends JpaRepository<Docs, Long> {

@Query("select d from Docs d where d.docsType = :docsType order by d.enroll")
List<Docs> findByDocsType(@Param("docsType") DocsType docsType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

import com.project.bumawiki.domain.docs.domain.Docs;
import com.project.bumawiki.domain.docs.domain.VersionDocs;
import com.project.bumawiki.domain.docs.domain.repository.CustomDocsRepository;
import com.project.bumawiki.domain.docs.domain.repository.DocsRepository;
import com.project.bumawiki.domain.docs.domain.repository.VersionDocsRepository;
import com.project.bumawiki.domain.docs.domain.type.DocsType;
import com.project.bumawiki.domain.docs.implementation.DocsReader;
import com.project.bumawiki.domain.docs.implementation.DocsValidator;
import com.project.bumawiki.domain.docs.presentation.dto.response.ClubResponseDto;
import com.project.bumawiki.domain.docs.presentation.dto.response.DocsPopularResponseDto;
import com.project.bumawiki.domain.docs.presentation.dto.response.DocsResponseDto;
Expand All @@ -39,7 +39,7 @@ public class QueryDocsService {
private final DocsRepository docsRepository;
private final VersionDocsRepository versionDocsRepository;
private final DocsReader docsReader;
private final DocsValidator docsValidator;
private final CustomDocsRepository customDocsRepository;

public List<Docs> findAllByTitle(String title) {
List<Docs> docs = docsRepository.findAllByTitle(title);
Expand All @@ -64,7 +64,7 @@ public DocsResponseDto findDocs(String title) {

public VersionResponseDto findDocsVersion(String title) {
Docs docs = docsRepository.getByTitle(title);
return docsRepository.getDocsVersion(docs);
return customDocsRepository.getDocsVersion(docs);
}

public List<Docs> showDocsModifiedAtDesc(Pageable pageable) {
Expand Down Expand Up @@ -150,6 +150,6 @@ public MergeConflictDataResponseDto getMergeConflict(String title, String conten
}

public List<DocsPopularResponseDto> readByThumbsUpsDesc() {
return docsRepository.findByThumbsUpsDesc();
return customDocsRepository.findByThumbsUpsDesc();
}
}

0 comments on commit 1ce5173

Please sign in to comment.