diff options
author | crupest <crupest@outlook.com> | 2021-04-30 17:00:45 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-04-30 17:00:45 +0800 |
commit | 5d28f5d0eb352369c73e3908c7d00d868676c304 (patch) | |
tree | bfb32a79a06495ee5c1fe19cd372985998f35b83 /BackEnd/Timeline/Models/Http/CommonPutResponse.cs | |
parent | 88002173a1155883d1fb46683a9a7ad1f521eb56 (diff) | |
download | timeline-5d28f5d0eb352369c73e3908c7d00d868676c304.tar.gz timeline-5d28f5d0eb352369c73e3908c7d00d868676c304.tar.bz2 timeline-5d28f5d0eb352369c73e3908c7d00d868676c304.zip |
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Models/Http/CommonPutResponse.cs')
-rw-r--r-- | BackEnd/Timeline/Models/Http/CommonPutResponse.cs | 43 |
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);
+ }
+ }
+}
|