mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-06 02:48:28 +00:00
feat(subscription): add JPA implementation for SkillSubscriptionRepository
This commit is contained in:
parent
1567a67bdd
commit
7da8ffdb1b
1 changed files with 20 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue