aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models/Http/CommonPutResponse.cs
diff options
context:
space:
mode:
Diffstat (limited to 'BackEnd/Timeline/Models/Http/CommonPutResponse.cs')
-rw-r--r--BackEnd/Timeline/Models/Http/CommonPutResponse.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Models/Http/CommonPutResponse.cs b/BackEnd/Timeline/Models/Http/CommonPutResponse.cs
new file mode 100644
index 00000000..06ca0bd2
--- /dev/null
+++ b/BackEnd/Timeline/Models/Http/CommonPutResponse.cs
@@ -0,0 +1,43 @@
+namespace Timeline.Models.Http
+{
+ public class CommonPutResponse : CommonDataResponse<CommonPutResponse.ResponseData>
+ {
+ public class ResponseData
+ {
+ public ResponseData() { }
+
+ public ResponseData(bool create)
+ {
+ Create = create;
+ }
+
+ public bool Create { get; set; }
+ }
+
+ public CommonPutResponse()
+ {
+
+ }
+
+ public CommonPutResponse(int code, string message, bool create)
+ : base(code, message, new ResponseData(create))
+ {
+
+ }
+
+ internal static CommonPutResponse Create(bool create)
+ {
+ return create ? Create() : Modify();
+ }
+
+ internal static CommonPutResponse Create()
+ {
+ return new CommonPutResponse(0, Resource.MessagePutCreate, true);
+ }
+
+ internal static CommonPutResponse Modify()
+ {
+ return new CommonPutResponse(0, Resource.MessagePutModify, false);
+ }
+ }
+}