diff --git a/server/skillhub-infra/src/main/java/com/iflytek/skillhub/infra/jpa/JpaSkillSubscriptionRepository.java b/server/skillhub-infra/src/main/java/com/iflytek/skillhub/infra/jpa/JpaSkillSubscriptionRepository.java new file mode 100644 index 00000000..83d5eb6c --- /dev/null +++ b/server/skillhub-infra/src/main/java/com/iflytek/skillhub/infra/jpa/JpaSkillSubscriptionRepository.java @@ -0,0 +1,20 @@ +package com.iflytek.skillhub.infra.jpa; + +import com.iflytek.skillhub.domain.social.SkillSubscription; +import com.iflytek.skillhub.domain.social.SkillSubscriptionRepository; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Optional; + +@Repository +public interface JpaSkillSubscriptionRepository extends JpaRepository, SkillSubscriptionRepository { + Optional findBySkillIdAndUserId(Long skillId, String userId); + void deleteBySkillId(Long skillId); + Page findByUserId(String userId, Pageable pageable); + List findAllBySkillId(Long skillId); + long countBySkillId(Long skillId); +}