Skip to content

Commit

Permalink
feat: challenge related repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Aug 20, 2024
1 parent 95d13a7 commit 45b6fea
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.foodgo.coremodule.community.repository;

import com.foodgo.coremodule.community.domain.ChallengeDetail;
import org.springframework.data.jpa.repository.JpaRepository;

public interface ChallengeDetailRepository extends JpaRepository<ChallengeDetail, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.foodgo.coremodule.community.repository;

import com.foodgo.coremodule.community.domain.Challenge;
import org.springframework.data.jpa.repository.JpaRepository;

public interface ChallengeRepository extends JpaRepository<Challenge, Long> {

Challenge findTopByFriendshipUserIdOrderByCreatedAtDesc(Long userId);

Boolean existsChallengeByFriendshipId(Long friendshipId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.foodgo.coremodule.community.repository;

import com.foodgo.coremodule.community.domain.Friendship;
import org.springframework.data.jpa.repository.JpaRepository;

public interface FriendShipRepository extends JpaRepository<Friendship, Long> {

Boolean existsFriendshipByUserIdAndFriendId(Long userId, Long friendId);

Friendship findFriendshipByUserIdAndFriendId(Long userId, Long friendId);
}

0 comments on commit 45b6fea

Please sign in to comment.