diff --git a/BE/images/3aee7039-34e3-416e-9ba0-087d323533e5_test+img.jpg b/BE/images/3aee7039-34e3-416e-9ba0-087d323533e5_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/3aee7039-34e3-416e-9ba0-087d323533e5_test+img.jpg differ diff --git a/BE/images/4d5ef946-53fb-4755-9c96-b6e9c543b553_test+img.jpg b/BE/images/4d5ef946-53fb-4755-9c96-b6e9c543b553_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/4d5ef946-53fb-4755-9c96-b6e9c543b553_test+img.jpg differ diff --git a/BE/images/55ffabae-ba37-4f98-9128-80a3e688fa91_test+img.jpg b/BE/images/55ffabae-ba37-4f98-9128-80a3e688fa91_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/55ffabae-ba37-4f98-9128-80a3e688fa91_test+img.jpg differ diff --git a/BE/images/5ff906e0-0a82-431e-a18d-dc2d4a73bd9f_test+img.jpg b/BE/images/5ff906e0-0a82-431e-a18d-dc2d4a73bd9f_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/5ff906e0-0a82-431e-a18d-dc2d4a73bd9f_test+img.jpg differ diff --git a/BE/images/6be654bc-8501-4fa6-a1a8-098e474ac1bb_test+img.jpg b/BE/images/6be654bc-8501-4fa6-a1a8-098e474ac1bb_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/6be654bc-8501-4fa6-a1a8-098e474ac1bb_test+img.jpg differ diff --git a/BE/images/a23625b0-6fb8-4767-b446-bdd45db17909_test+img.jpg b/BE/images/a23625b0-6fb8-4767-b446-bdd45db17909_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/a23625b0-6fb8-4767-b446-bdd45db17909_test+img.jpg differ diff --git a/BE/images/a4e3f41f-6597-4a62-b37e-b024da58de56_test+img.jpg b/BE/images/a4e3f41f-6597-4a62-b37e-b024da58de56_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/a4e3f41f-6597-4a62-b37e-b024da58de56_test+img.jpg differ diff --git a/BE/images/a93aa807-f085-4e96-830d-c1b20bb5a788_test+img.jpg b/BE/images/a93aa807-f085-4e96-830d-c1b20bb5a788_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/a93aa807-f085-4e96-830d-c1b20bb5a788_test+img.jpg differ diff --git a/BE/images/ae709eda-77ce-428c-8a90-8f475cf6ccf1_test+img.jpg b/BE/images/ae709eda-77ce-428c-8a90-8f475cf6ccf1_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/ae709eda-77ce-428c-8a90-8f475cf6ccf1_test+img.jpg differ diff --git a/BE/images/af18481e-2d9c-4545-becd-f56072559f9c_test+img.jpg b/BE/images/af18481e-2d9c-4545-becd-f56072559f9c_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/af18481e-2d9c-4545-becd-f56072559f9c_test+img.jpg differ diff --git a/BE/images/b4ab1102-65f7-4294-9bad-2f5cad662366_test+img.jpg b/BE/images/b4ab1102-65f7-4294-9bad-2f5cad662366_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/b4ab1102-65f7-4294-9bad-2f5cad662366_test+img.jpg differ diff --git a/BE/images/b695d708-7b7d-4ec4-bbf6-902cbffd2cdb_test+img.jpg b/BE/images/b695d708-7b7d-4ec4-bbf6-902cbffd2cdb_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/b695d708-7b7d-4ec4-bbf6-902cbffd2cdb_test+img.jpg differ diff --git a/BE/images/d802196a-5df7-4750-bf3e-194c270b7b1c_test+img.jpg b/BE/images/d802196a-5df7-4750-bf3e-194c270b7b1c_test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/d802196a-5df7-4750-bf3e-194c270b7b1c_test+img.jpg differ diff --git a/BE/images/test+img.jpg b/BE/images/test+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/images/test+img.jpg differ diff --git a/BE/imagestest+img.jpg b/BE/imagestest+img.jpg new file mode 100644 index 0000000..586b49d Binary files /dev/null and b/BE/imagestest+img.jpg differ diff --git a/BE/src/main/java/org/example/controllers/PostController.java b/BE/src/main/java/org/example/controllers/PostController.java index 9f93f82..6c918a0 100644 --- a/BE/src/main/java/org/example/controllers/PostController.java +++ b/BE/src/main/java/org/example/controllers/PostController.java @@ -1,6 +1,7 @@ package org.example.controllers; //import org.example.models.Author; +import org.example.models.Image; import org.example.models.Post; import org.example.models.User; import org.example.repositories.PostRepository; @@ -30,6 +31,7 @@ public class PostController { return postService.getAllPost(); } + @PostMapping public Post createPost( diff --git a/BE/src/main/java/org/example/models/Image.java b/BE/src/main/java/org/example/models/Image.java index c9aa7b3..3532594 100644 --- a/BE/src/main/java/org/example/models/Image.java +++ b/BE/src/main/java/org/example/models/Image.java @@ -7,10 +7,20 @@ import org.springframework.data.neo4j.core.schema.Node; @Node public class Image { @Id + @GeneratedValue private Long id; private String filename; private String contentType; + public Image() { + } + + public Image(Long id, String filename, String contentType) { + this.id = id; + this.filename = filename; + this.contentType = contentType; + } + public Long getId() { return id; } diff --git a/BE/src/main/java/org/example/models/Post.java b/BE/src/main/java/org/example/models/Post.java index 542a483..9270ad2 100644 --- a/BE/src/main/java/org/example/models/Post.java +++ b/BE/src/main/java/org/example/models/Post.java @@ -2,6 +2,8 @@ package org.example.models; import lombok.Getter; +import org.example.repositories.PostRepository; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.neo4j.core.schema.GeneratedValue; import org.springframework.data.neo4j.core.schema.Id; import org.springframework.data.neo4j.core.schema.Node; @@ -14,15 +16,33 @@ import java.util.UUID; @Getter @Node public class Post { + @Id @GeneratedValue private Long id; private String title; private String content; + private String author; + private String imgUrl; + public String getImgUrl() { + return imgUrl; + } + + public void setImgUrl(String imgUrl) { + this.imgUrl = imgUrl; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } @Relationship(type = "HAS_IMAGE", direction = Relationship.Direction.OUTGOING) - private List images = new ArrayList<>(); + private Image images = new Image(); @Relationship(type = "HAS_VIDEO", direction = Relationship.Direction.OUTGOING) private List