From ff91162eb83dcf19402240ae8fa06f70cbf2b9e0 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 30 Jan 2021 11:31:21 +0200 Subject: Separated comment models, controler and service from post's --- .../Models/Comment/CreateCommentWebModel.cs | 17 ++++++++++++++ .../Models/Comment/ReadCommentWebModel.cs | 21 +++++++++++++++++ .../Models/Comment/UpdateCommentWebModel.cs | 13 +++++++++++ src/DevHive.Web/Models/Feed/ReadPageWebModel.cs | 2 +- .../Models/Post/Comment/CreateCommentWebModel.cs | 17 -------------- .../Models/Post/Comment/ReadCommentWebModel.cs | 21 ----------------- .../Models/Post/Comment/UpdateCommentWebModel.cs | 13 ----------- src/DevHive.Web/Models/Post/CreatePostWebModel.cs | 16 +++++++++++++ .../Models/Post/Post/CreatePostWebModel.cs | 17 -------------- .../Models/Post/Post/ReadPostWebModel.cs | 26 ---------------------- .../Models/Post/Post/UpdatePostWebModel.cs | 21 ----------------- src/DevHive.Web/Models/Post/ReadPostWebModel.cs | 26 ++++++++++++++++++++++ src/DevHive.Web/Models/Post/UpdatePostWebModel.cs | 21 +++++++++++++++++ 13 files changed, 115 insertions(+), 116 deletions(-) create mode 100644 src/DevHive.Web/Models/Comment/CreateCommentWebModel.cs create mode 100644 src/DevHive.Web/Models/Comment/ReadCommentWebModel.cs create mode 100644 src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs delete mode 100644 src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs delete mode 100644 src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs delete mode 100644 src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs create mode 100644 src/DevHive.Web/Models/Post/CreatePostWebModel.cs delete mode 100644 src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs delete mode 100644 src/DevHive.Web/Models/Post/Post/ReadPostWebModel.cs delete mode 100644 src/DevHive.Web/Models/Post/Post/UpdatePostWebModel.cs create mode 100644 src/DevHive.Web/Models/Post/ReadPostWebModel.cs create mode 100644 src/DevHive.Web/Models/Post/UpdatePostWebModel.cs (limited to 'src/DevHive.Web/Models') diff --git a/src/DevHive.Web/Models/Comment/CreateCommentWebModel.cs b/src/DevHive.Web/Models/Comment/CreateCommentWebModel.cs new file mode 100644 index 0000000..8b2bf8d --- /dev/null +++ b/src/DevHive.Web/Models/Comment/CreateCommentWebModel.cs @@ -0,0 +1,17 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; + +namespace DevHive.Web.Models.Comment +{ + public class CreateCommentWebModel + { + [NotNull] + [Required] + public Guid PostId { get; set; } + + [NotNull] + [Required] + public string Message { get; set; } + } +} diff --git a/src/DevHive.Web/Models/Comment/ReadCommentWebModel.cs b/src/DevHive.Web/Models/Comment/ReadCommentWebModel.cs new file mode 100644 index 0000000..4d3aff7 --- /dev/null +++ b/src/DevHive.Web/Models/Comment/ReadCommentWebModel.cs @@ -0,0 +1,21 @@ +using System; + +namespace DevHive.Web.Models.Comment +{ + public class ReadCommentWebModel + { + public Guid CommentId { get; set; } + + public Guid PostId { get; set; } + + public string IssuerFirstName { get; set; } + + public string IssuerLastName { get; set; } + + public string IssuerUsername { get; set; } + + public string Message { get; set; } + + public DateTime TimeCreated { get; set; } + } +} diff --git a/src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs b/src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs new file mode 100644 index 0000000..b5d7970 --- /dev/null +++ b/src/DevHive.Web/Models/Comment/UpdateCommentWebModel.cs @@ -0,0 +1,13 @@ +using System; + +namespace DevHive.Web.Models.Comment +{ + public class UpdateCommentWebModel + { + public Guid CommentId { get; set; } + + public Guid PostId { get; set; } + + public string NewMessage { get; set; } + } +} diff --git a/src/DevHive.Web/Models/Feed/ReadPageWebModel.cs b/src/DevHive.Web/Models/Feed/ReadPageWebModel.cs index 40d29c9..839aaa6 100644 --- a/src/DevHive.Web/Models/Feed/ReadPageWebModel.cs +++ b/src/DevHive.Web/Models/Feed/ReadPageWebModel.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using DevHive.Web.Models.Post.Post; +using DevHive.Web.Models.Post; namespace DevHive.Web.Controllers { diff --git a/src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs b/src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs deleted file mode 100644 index 85c67bf..0000000 --- a/src/DevHive.Web/Models/Post/Comment/CreateCommentWebModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; - -namespace DevHive.Web.Models.Post.Comment -{ - public class CreateCommentWebModel - { - [NotNull] - [Required] - public Guid PostId { get; set; } - - [NotNull] - [Required] - public string Message { get; set; } - } -} diff --git a/src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs b/src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs deleted file mode 100644 index 5320c3c..0000000 --- a/src/DevHive.Web/Models/Post/Comment/ReadCommentWebModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace DevHive.Web.Models.Post.Comment -{ - public class ReadCommentWebModel - { - public Guid CommentId { get; set; } - - public Guid PostId { get; set; } - - public string IssuerFirstName { get; set; } - - public string IssuerLastName { get; set; } - - public string IssuerUsername { get; set; } - - public string Message { get; set; } - - public DateTime TimeCreated { get; set; } - } -} diff --git a/src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs b/src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs deleted file mode 100644 index cb1c60a..0000000 --- a/src/DevHive.Web/Models/Post/Comment/UpdateCommentWebModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace DevHive.Web.Models.Post.Comment -{ - public class UpdateCommentWebModel - { - public Guid CommentId { get; set; } - - public Guid PostId { get; set; } - - public string NewMessage { get; set; } - } -} diff --git a/src/DevHive.Web/Models/Post/CreatePostWebModel.cs b/src/DevHive.Web/Models/Post/CreatePostWebModel.cs new file mode 100644 index 0000000..256055a --- /dev/null +++ b/src/DevHive.Web/Models/Post/CreatePostWebModel.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore.Http; + +namespace DevHive.Web.Models.Post +{ + public class CreatePostWebModel + { + [NotNull] + [Required] + public string Message { get; set; } + + public List Files { get; set; } + } +} diff --git a/src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs b/src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs deleted file mode 100644 index e35a813..0000000 --- a/src/DevHive.Web/Models/Post/Post/CreatePostWebModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using Microsoft.AspNetCore.Http; - -namespace DevHive.Web.Models.Post.Post -{ - public class CreatePostWebModel - { - [NotNull] - [Required] - public string Message { get; set; } - - public List Files { get; set; } - } -} diff --git a/src/DevHive.Web/Models/Post/Post/ReadPostWebModel.cs b/src/DevHive.Web/Models/Post/Post/ReadPostWebModel.cs deleted file mode 100644 index 5d4da31..0000000 --- a/src/DevHive.Web/Models/Post/Post/ReadPostWebModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using DevHive.Web.Models.Post.Comment; -using Microsoft.AspNetCore.Http; - -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 Comments { get; set; } - - public List Files { get; set; } - } -} diff --git a/src/DevHive.Web/Models/Post/Post/UpdatePostWebModel.cs b/src/DevHive.Web/Models/Post/Post/UpdatePostWebModel.cs deleted file mode 100644 index ac84d2c..0000000 --- a/src/DevHive.Web/Models/Post/Post/UpdatePostWebModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using Microsoft.AspNetCore.Http; - -namespace DevHive.Web.Models.Post.Post -{ - public class UpdatePostWebModel - { - [Required] - [NotNull] - public Guid PostId { get; set; } - - [NotNull] - [Required] - public string NewMessage { get; set; } - - public List Files { get; set; } = new(); - } -} diff --git a/src/DevHive.Web/Models/Post/ReadPostWebModel.cs b/src/DevHive.Web/Models/Post/ReadPostWebModel.cs new file mode 100644 index 0000000..1d2669e --- /dev/null +++ b/src/DevHive.Web/Models/Post/ReadPostWebModel.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using DevHive.Web.Models.Comment; +using Microsoft.AspNetCore.Http; + +namespace DevHive.Web.Models.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 Comments { get; set; } + + public List Files { get; set; } + } +} diff --git a/src/DevHive.Web/Models/Post/UpdatePostWebModel.cs b/src/DevHive.Web/Models/Post/UpdatePostWebModel.cs new file mode 100644 index 0000000..a0c9b61 --- /dev/null +++ b/src/DevHive.Web/Models/Post/UpdatePostWebModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore.Http; + +namespace DevHive.Web.Models.Post +{ + public class UpdatePostWebModel + { + [Required] + [NotNull] + public Guid PostId { get; set; } + + [NotNull] + [Required] + public string NewMessage { get; set; } + + public List Files { get; set; } = new(); + } +} -- cgit v1.2.3