diff --git a/backend/services/PostService/src/PostService.Domain/Entities/Comment.cs b/backend/services/PostService/src/PostService.Domain/Entities/Comment.cs new file mode 100644 index 0000000..5e8a5e1 --- /dev/null +++ b/backend/services/PostService/src/PostService.Domain/Entities/Comment.cs @@ -0,0 +1,19 @@ +namespace PostService.Domain.Entities; + +public class Comment +{ + public Guid CommentId { get; private set; } + public Guid PostId { get; private set; } + public Guid UserId { get; private set; } + public string Content { get; private set; } + public DateTime CreatedAt { get; private set; } + + public Comment(Guid commentId, Guid postId, Guid userId, string content) + { + CommentId = commentId; + PostId = postId; + UserId = userId; + Content = content; + CreatedAt = DateTime.UtcNow; + } +} \ No newline at end of file diff --git a/backend/services/PostService/src/PostService.Domain/Entities/Like.cs b/backend/services/PostService/src/PostService.Domain/Entities/Like.cs new file mode 100644 index 0000000..5cf838b --- /dev/null +++ b/backend/services/PostService/src/PostService.Domain/Entities/Like.cs @@ -0,0 +1,17 @@ +namespace PostService.Domain.Entities; + +public class Like +{ + public Guid LikeId { get; private set; } + public Guid PostId { get; private set; } + public Guid UserId { get; private set; } + public DateTime CreatedAt { get; private set; } + + public Like(Guid likeId, Guid postId, Guid userId) + { + LikeId = likeId; + PostId = postId; + UserId = userId; + CreatedAt = DateTime.UtcNow; + } +} \ No newline at end of file diff --git a/backend/services/PostService/src/PostService.Domain/Entities/Post.cs b/backend/services/PostService/src/PostService.Domain/Entities/Post.cs new file mode 100644 index 0000000..4bab090 --- /dev/null +++ b/backend/services/PostService/src/PostService.Domain/Entities/Post.cs @@ -0,0 +1,29 @@ +namespace PostService.Domain.Entities; + +public class Post +{ + public Guid PostId { get; private set; } + public Guid UserId { get; private set; } + public string Title { get; private set; } + public string Content { get; private set; } + public string ImageUrl { get; private set; } + public int LikeCount { get; private set; } + public int CommentCount { get; private set; } + public DateTime CreatedAt { get; private set; } + + public Post(Guid postId, Guid userId, string title, string content, string imageUrl) + { + PostId = postId; + UserId = userId; + Title = title; + Content = content; + ImageUrl = imageUrl; + LikeCount = 0; + CommentCount = 0; + CreatedAt = DateTime.UtcNow; + } + + public void IncrementCommentCount() => CommentCount++; + + public void IncrementLikeCount() => LikeCount++; +} diff --git a/backend/services/PostService/src/PostService.Domain/Entities/User.cs b/backend/services/PostService/src/PostService.Domain/Entities/User.cs new file mode 100644 index 0000000..a3b0fc2 --- /dev/null +++ b/backend/services/PostService/src/PostService.Domain/Entities/User.cs @@ -0,0 +1,21 @@ +namespace PostService.Domain.Entities; + +public class User +{ + public Guid UserId { get; private set; } + public string FirstName { get; private set; } + public string LastName { get; private set; } + public string Username { get; private set; } + public string ImageUrl { get; private set; } + public DateTime CreatedAt { get; private set; } + + public User(Guid userId, string firstName, string lastName, string username, string imageUrl) + { + UserId = userId; + FirstName = firstName; + LastName = lastName; + Username = username; + ImageUrl = imageUrl; + CreatedAt = DateTime.UtcNow; + } +} \ No newline at end of file