diff options
Diffstat (limited to 'src/DevHive.Web/Models/Post')
| -rw-r--r-- | src/DevHive.Web/Models/Post/Comment/BaseCommentWebModel.cs | 21 | ||||
| -rw-r--r-- | src/DevHive.Web/Models/Post/Comment/CommentWebModel.cs | 25 | ||||
| -rw-r--r-- | src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs | 15 | ||||
| -rw-r--r-- | src/DevHive.Web/Models/Post/Post/PostWebModel.cs | 39 | ||||
| -rw-r--r-- | src/DevHive.Web/Models/Post/Post/ReadPostWebModel.cs | 25 | ||||
| -rw-r--r-- | src/DevHive.Web/Models/Post/Post/UpdatePostModel.cs | 7 | ||||
| -rw-r--r-- | src/DevHive.Web/Models/Post/Post/UpdatePostWebModel.cs (renamed from src/DevHive.Web/Models/Post/Post/BasePostWebModel.cs) | 6 |
7 files changed, 40 insertions, 98 deletions
diff --git a/src/DevHive.Web/Models/Post/Comment/BaseCommentWebModel.cs b/src/DevHive.Web/Models/Post/Comment/BaseCommentWebModel.cs deleted file mode 100644 index 9ba0b87..0000000 --- a/src/DevHive.Web/Models/Post/Comment/BaseCommentWebModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; - -namespace DevHive.Web.Models.Post.Comment -{ - public class BaseCommentWebModel - { - [NotNull] - [Required] - public Guid PostId { get; set; } - - [NotNull] - [Required] - public Guid CommentId { get; set; } - - [NotNull] - [Required] - public string Message { get; set; } - } -} diff --git a/src/DevHive.Web/Models/Post/Comment/CommentWebModel.cs b/src/DevHive.Web/Models/Post/Comment/CommentWebModel.cs deleted file mode 100644 index 590851d..0000000 --- a/src/DevHive.Web/Models/Post/Comment/CommentWebModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; - -namespace DevHive.Web.Models.Post.Comment -{ - public class CommentWebModel - { - [NotNull] - [Required] - public Guid IssuerId { get; set; } - - [NotNull] - [Required] - public Guid PostId { get; set; } - - [NotNull] - [Required] - public string Message { get; set; } - - [NotNull] - [Required] - public DateTime TimeCreated { get; set; } - } -} diff --git a/src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs b/src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs index 389ff9e..647b30e 100644 --- a/src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs +++ b/src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs @@ -1,6 +1,19 @@ using System; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; namespace DevHive.Web.Models.Post.Post { - public class CreatePostWebModel : BasePostWebModel { } + public class CreatePostWebModel + { + [NotNull] + [Required] + public Guid CreatorId { get; set; } + + [NotNull] + [Required] + public string Message { get; set; } + + // public List<IFormFile> Files { get; set; } + } } diff --git a/src/DevHive.Web/Models/Post/Post/PostWebModel.cs b/src/DevHive.Web/Models/Post/Post/PostWebModel.cs deleted file mode 100644 index fe35cee..0000000 --- a/src/DevHive.Web/Models/Post/Post/PostWebModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using DevHive.Web.Attributes; -using DevHive.Web.Models.Post.Comment; - -namespace DevHive.Web.Models.Post.Post -{ - public class PostWebModel - { - //public string Picture { get; set; } - - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - public string IssuerFirstName { get; set; } - - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - public string IssuerLastName { get; set; } - - [NotNull] - [Required] - [MinLength(3)] - [MaxLength(50)] - [OnlyAlphanumerics(ErrorMessage = "Username can only contain letters and digits!")] - public string IssuerUsername { get; set; } - - [NotNull] - [Required] - public string Message { get; set; } - - //public Files[] Files { get; set; } - - public CommentWebModel[] Comments { get; set; } - } -} diff --git a/src/DevHive.Web/Models/Post/Post/ReadPostWebModel.cs b/src/DevHive.Web/Models/Post/Post/ReadPostWebModel.cs new file mode 100644 index 0000000..04c6275 --- /dev/null +++ b/src/DevHive.Web/Models/Post/Post/ReadPostWebModel.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using DevHive.Web.Models.Post.Comment; + +namespace DevHive.Web.Models.Post.Post +{ + public class ReadPostWebModel + { + public Guid PostId { get; set; } + + public string CreatorFirstName { get; set; } + + public string CreatorLastName { get; set; } + + public string CreatorUsername { get; set; } + + public string Message { get; set; } + + public DateTime TimeCreated { get; set; } + + public List<ReadCommentWebModel> Comments { get; set; } + + //public Files[] Files { get; set; } + } +} diff --git a/src/DevHive.Web/Models/Post/Post/UpdatePostModel.cs b/src/DevHive.Web/Models/Post/Post/UpdatePostModel.cs deleted file mode 100644 index c774900..0000000 --- a/src/DevHive.Web/Models/Post/Post/UpdatePostModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace DevHive.Web.Models.Post.Post -{ - public class UpdatePostWebModel : BasePostWebModel - { - //public Files[] Files { get; set; } - } -}
\ No newline at end of file diff --git a/src/DevHive.Web/Models/Post/Post/BasePostWebModel.cs b/src/DevHive.Web/Models/Post/Post/UpdatePostWebModel.cs index 35ddd34..5b66436 100644 --- a/src/DevHive.Web/Models/Post/Post/BasePostWebModel.cs +++ b/src/DevHive.Web/Models/Post/Post/UpdatePostWebModel.cs @@ -4,14 +4,10 @@ using System.Diagnostics.CodeAnalysis; namespace DevHive.Web.Models.Post.Post { - public class BasePostWebModel + public class UpdatePostWebModel { [NotNull] [Required] - public Guid IssuerId { get; set; } - - [NotNull] - [Required] public string Message { get; set; } } } |
