aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models/Http/TimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-27 00:07:09 +0800
committercrupest <crupest@outlook.com>2020-11-27 00:07:09 +0800
commit3f4e88757f961532b84df85e86d21995655a29d4 (patch)
tree1dbb69aadcd4d3287ae0d2aad913365abc44a18e /BackEnd/Timeline/Models/Http/TimelineController.cs
parentc2ca954fc8bc0f12ad2ece715cb6c4a633a23119 (diff)
downloadtimeline-3f4e88757f961532b84df85e86d21995655a29d4.tar.gz
timeline-3f4e88757f961532b84df85e86d21995655a29d4.tar.bz2
timeline-3f4e88757f961532b84df85e86d21995655a29d4.zip
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Models/Http/TimelineController.cs')
-rw-r--r--BackEnd/Timeline/Models/Http/TimelineController.cs21
1 files changed, 15 insertions, 6 deletions
diff --git a/BackEnd/Timeline/Models/Http/TimelineController.cs b/BackEnd/Timeline/Models/Http/TimelineController.cs
index 7bd141ed..42a926fd 100644
--- a/BackEnd/Timeline/Models/Http/TimelineController.cs
+++ b/BackEnd/Timeline/Models/Http/TimelineController.cs
@@ -1,4 +1,5 @@
-using System;
+using AutoMapper;
+using System;
using System.ComponentModel.DataAnnotations;
using Timeline.Models.Validation;
@@ -7,7 +8,7 @@ namespace Timeline.Models.Http
/// <summary>
/// Content of post create request.
/// </summary>
- public class TimelinePostCreateRequestContent
+ public class HttpTimelinePostCreateRequestContent
{
/// <summary>
/// Type of post content.
@@ -24,13 +25,13 @@ namespace Timeline.Models.Http
public string? Data { get; set; }
}
- public class TimelinePostCreateRequest
+ public class HttpTimelinePostCreateRequest
{
/// <summary>
/// Content of the new post.
/// </summary>
[Required]
- public TimelinePostCreateRequestContent Content { get; set; } = default!;
+ public HttpTimelinePostCreateRequestContent Content { get; set; } = default!;
/// <summary>
/// Time of the post. If not set, current time will be used.
@@ -54,7 +55,7 @@ namespace Timeline.Models.Http
/// <summary>
/// Patch timeline request model.
/// </summary>
- public class TimelinePatchRequest
+ public class HttpTimelinePatchRequest
{
/// <summary>
/// New title. Null for not change.
@@ -75,7 +76,7 @@ namespace Timeline.Models.Http
/// <summary>
/// Change timeline name request model.
/// </summary>
- public class TimelineChangeNameRequest
+ public class HttpTimelineChangeNameRequest
{
/// <summary>
/// Old name of timeline.
@@ -90,4 +91,12 @@ namespace Timeline.Models.Http
[TimelineName]
public string NewName { get; set; } = default!;
}
+
+ public class HttpTimelineControllerAutoMapperProfile : Profile
+ {
+ public HttpTimelineControllerAutoMapperProfile()
+ {
+ CreateMap<HttpTimelinePatchRequest, TimelineChangePropertyRequest>();
+ }
+ }
}