aboutsummaryrefslogtreecommitdiff
path: root/Backend
diff options
context:
space:
mode:
authorOgnjen Cirkovic <ciraboxkg@gmail.com>2022-11-02 22:39:46 +0100
committerOgnjen Cirkovic <ciraboxkg@gmail.com>2022-11-02 22:39:46 +0100
commitdf6852bf7b47835a31dd0ffeb5cfddccbf70aeba (patch)
treedea8fb5473a7ada3049e05b413e11869acf32945 /Backend
parent57c4dac678cd1cc21e772d2f753a417ca31be616 (diff)
Napravljeni modeli za File, Location, Post, PostReceive i PostSend
Diffstat (limited to 'Backend')
-rw-r--r--Backend/Api/Api/Models/File.cs13
-rw-r--r--Backend/Api/Api/Models/Location.cs29
-rw-r--r--Backend/Api/Api/Models/Post.cs56
3 files changed, 98 insertions, 0 deletions
diff --git a/Backend/Api/Api/Models/File.cs b/Backend/Api/Api/Models/File.cs
new file mode 100644
index 0000000..c3a1e1b
--- /dev/null
+++ b/Backend/Api/Api/Models/File.cs
@@ -0,0 +1,13 @@
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson;
+
+namespace Api.Models
+{
+ public class File
+ {
+ [BsonId]
+ [BsonRepresentation(BsonType.ObjectId)]
+ public string _id { get; set; }
+ public String path { get; set; }
+ }
+}
diff --git a/Backend/Api/Api/Models/Location.cs b/Backend/Api/Api/Models/Location.cs
new file mode 100644
index 0000000..5e723e4
--- /dev/null
+++ b/Backend/Api/Api/Models/Location.cs
@@ -0,0 +1,29 @@
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson;
+
+namespace Api.Models
+{
+ public class Location
+ {
+ [BsonId]
+ [BsonRepresentation(BsonType.ObjectId)]
+ public String _id { get; set; }
+ public String name { get; set; }
+ public String city { get; set; }
+ public String country { get; set; }
+ public String adress { get; set; }
+ public double latitude { get; set; }
+ public double longitude { get; set; }
+ public LocationType type { get; set; }
+
+ }
+
+
+ public enum LocationType
+ {
+ Plaza,
+ Grad,
+ Zgrada,
+ Itd
+ }
+}
diff --git a/Backend/Api/Api/Models/Post.cs b/Backend/Api/Api/Models/Post.cs
new file mode 100644
index 0000000..456fcea
--- /dev/null
+++ b/Backend/Api/Api/Models/Post.cs
@@ -0,0 +1,56 @@
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson;
+
+namespace Api.Models
+{
+ public class Post
+ {
+ [BsonId]
+ [BsonRepresentation(BsonType.ObjectId)]
+ public string _id { get; set; }
+ public string ownerId { get; set; }
+ public Location location { get; set; }
+ public string description { get; set; }
+ public List<string> views { get; set; }
+ public List<string> reports { get; set; }
+ public List<Rating> ratings { get; set; }
+ public List<Comment> comments { get; set; }
+ public List<File> images { get; set; }
+ }
+ public class PostReceive
+ {
+ [BsonId]
+ [BsonRepresentation(BsonType.ObjectId)]
+ public string _id { get; set; }
+ public Location location { get; set; }
+ public string description { get; set; }
+ public List<IFormFile> images { get; set; }
+
+
+ }
+ public class PostSend
+ {
+ [BsonId]
+ [BsonRepresentation(BsonType.ObjectId)]
+ public string _id { get; set; }
+ public string ownerId { get; set; }
+ public Location location { get; set; }
+ public string description { get; set; }
+ public int views { get; set; }
+ public float ratings { get; set; }
+ public List<Comment> comments { get; set; }
+ public List<File> images { get; set; }
+ }
+ public class Rating
+ {
+ public string userId { get; set; }
+ public int rating { get; set; }
+ }
+ public class Comment
+ {
+ public string userId { get; set; }
+ public string comment { get; set; }
+ public Comment parent { get; set; }
+ public DateTime timestamp { get; set; }
+ }
+}