From df6852bf7b47835a31dd0ffeb5cfddccbf70aeba Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Wed, 2 Nov 2022 22:39:46 +0100 Subject: Napravljeni modeli za File, Location, Post, PostReceive i PostSend --- Backend/Api/Api/Models/File.cs | 13 +++++++++ Backend/Api/Api/Models/Location.cs | 29 ++++++++++++++++++++ Backend/Api/Api/Models/Post.cs | 56 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 Backend/Api/Api/Models/File.cs create mode 100644 Backend/Api/Api/Models/Location.cs create mode 100644 Backend/Api/Api/Models/Post.cs (limited to 'Backend') 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 views { get; set; } + public List reports { get; set; } + public List ratings { get; set; } + public List comments { get; set; } + public List 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 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 comments { get; set; } + public List 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; } + } +} -- cgit v1.2.3