From 5d28f5d0eb352369c73e3908c7d00d868676c304 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 30 Apr 2021 17:00:45 +0800 Subject: refactor: ... --- BackEnd/Timeline/Models/Http/CommonPutResponse.cs | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 BackEnd/Timeline/Models/Http/CommonPutResponse.cs (limited to 'BackEnd/Timeline/Models/Http/CommonPutResponse.cs') 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 + { + 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); + } + } +} -- cgit v1.2.3