|
|
|
@ -21,12 +21,12 @@ public interface UserRepository extends Neo4jRepository<User, Long> { |
|
|
|
|
@Query("match (u:User), (p:POST)\n" + |
|
|
|
|
"WHERE id(u) = $nameId AND id(p) = $postId\n" + |
|
|
|
|
"create (u) - [:LIKE] -> (p)") |
|
|
|
|
void createLike(@Param("nameId") Long nameId, @Param("postId") Long postId); |
|
|
|
|
void createLike(@Param("nameId") Long nameId, @Param("postId*") Long postId); |
|
|
|
|
|
|
|
|
|
@Query("match (a:User)-[r:LIKE]-> (b:POST)" + |
|
|
|
|
"WHERE id(a) = $id AND id(b) = $idd" + |
|
|
|
|
@Query("match (a:User)-[r:LIKE]-> (b:POST)\n" + |
|
|
|
|
"WHERE id(a) = $id AND id(b) = $idd\n" + |
|
|
|
|
"RETURN COUNT(r) > 0 AS Relationship") |
|
|
|
|
boolean checkLike(Long userId, Long postId); |
|
|
|
|
boolean checkLike(@Param("id") Long userId,@Param("idd") Long postId); |
|
|
|
|
|
|
|
|
|
// @Query("MATCH (user:User), (course:Course) WHERE user.username = $username AND course.identifier = $identifier " +
|
|
|
|
|
// "CREATE (user)-[:ENROLLED_IN]->(course) RETURN user, course")
|
|
|
|
|