|
@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Modifying;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
import javax.transaction.Transactional;
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
|
|
|
public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpecificationExecutor<Collection> {
|
|
public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpecificationExecutor<Collection> {
|
|
@@ -22,4 +23,7 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
|
|
|
@Transactional
|
|
@Transactional
|
|
|
void addLike(Long id, int num);
|
|
void addLike(Long id, int num);
|
|
|
|
|
|
|
|
|
|
+ @Query(value = "select distinct c from Collection c join Like l on l.collectionId = c.id " +
|
|
|
|
|
+ "where l.userId = ?1 and l.del = false and c.del = false")
|
|
|
|
|
+ List<Collection> userLikes(Long userId);
|
|
|
}
|
|
}
|