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 | 9f81ec1d4a54239ae9456923115f4a1e379d9e71 (patch) | |
tree | 8737e2ab17d227a21e3ac6c590b45fb6dcf522b1 /BackEnd/Timeline/Models/Http/CommonPutResponse.cs | |
parent | a672e10faad434899d81ef9d0d0d5adbbc7841da (diff) | |
download | timeline-9f81ec1d4a54239ae9456923115f4a1e379d9e71.tar.gz timeline-9f81ec1d4a54239ae9456923115f4a1e379d9e71.tar.bz2 timeline-9f81ec1d4a54239ae9456923115f4a1e379d9e71.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);
+ }
+ }
+}
|