feat(subscription): add JPA implementation for SkillSubscriptionRepository

This commit is contained in:
dongmucat 2026-04-27 16:43:34 +08:00
parent 1567a67bdd
commit 7da8ffdb1b

View file

@ -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<SkillSubscription, Long>, SkillSubscriptionRepository {
Optional<SkillSubscription> findBySkillIdAndUserId(Long skillId, String userId);
void deleteBySkillId(Long skillId);
Page<SkillSubscription> findByUserId(String userId, Pageable pageable);
List<SkillSubscription> findAllBySkillId(Long skillId);
long countBySkillId(Long skillId);
}