Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -1,9 +1,13 @@
package com.example.green.domain.certification.domain;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Repository interface should not reside in the domain package.

Spring Data repositories are infrastructure/persistence concerns and conventionally belong in a repository or infrastructure package. The domain package should contain domain models (entities, value objects, domain services), not data-access interfaces. This placement violates separation of concerns and standard Spring Boot/DDD architecture patterns.

Consider moving this interface back to com.example.green.domain.certification.repository:

-package com.example.green.domain.certification.domain;
+package com.example.green.domain.certification.repository;

And update the import in WeeklyRankingService accordingly.

Also applies to: 12-12


import java.time.LocalDate;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.example.green.domain.certification.infra.projections.MemberCertifiedCountProjection;

public interface ChallengeCertificationRepository extends JpaRepository<ChallengeCertification, Long> {

Expand All @@ -28,4 +32,12 @@ SELECT COUNT(cc) > 0
boolean existsByPersonalChallenge(Long challengeId, LocalDate challengeDate, Long memberId);

int countChallengeCertificationByMemberMemberId(Long memberId);

//여러 회원 인증 수 (한번에 조회)
@Query("SELECT c.member.memberId AS memberId, COUNT(c) AS certifiedCount " +
"FROM ChallengeCertification c " +
"WHERE c.member.memberId IN :memberIds " +
"GROUP BY c.member.memberId")
List<MemberCertifiedCountProjection> findCertifiedCountByMemberIds(@Param("memberIds") List<Long> memberIds);

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.example.green.domain.certification.domain.ChallengeCertificationRepository;
import com.example.green.domain.certification.infra.projections.MemberCertifiedCountProjection;
import com.example.green.domain.certification.repository.ChallengeCertificationRepository;
import com.example.green.domain.dashboard.rankingmodule.dto.response.MemberPointResponse;
import com.example.green.domain.dashboard.rankingmodule.dto.response.TopMemberPointResponse;
import com.example.green.domain.dashboard.rankingmodule.entity.WeeklyRanking;
Expand Down