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