From 9f81ec1d4a54239ae9456923115f4a1e379d9e71 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 30 Apr 2021 17:00:45 +0800 Subject: refactor: ... --- BackEnd/Timeline/Models/Http/CommonResponse.cs | 111 ------------------------- 1 file changed, 111 deletions(-) (limited to 'BackEnd/Timeline/Models/Http/CommonResponse.cs') diff --git a/BackEnd/Timeline/Models/Http/CommonResponse.cs b/BackEnd/Timeline/Models/Http/CommonResponse.cs index 3d0ed509..3666ea47 100644 --- a/BackEnd/Timeline/Models/Http/CommonResponse.cs +++ b/BackEnd/Timeline/Models/Http/CommonResponse.cs @@ -1,5 +1,3 @@ -using static Timeline.Resources.Models.Http.Common; - namespace Timeline.Models.Http { public class CommonResponse @@ -18,113 +16,4 @@ namespace Timeline.Models.Http public int Code { get; set; } public string? Message { get; set; } } - - public class CommonDataResponse : CommonResponse - { - public CommonDataResponse() - { - - } - - public CommonDataResponse(int code, string message, T data) - : base(code, message) - { - Data = data; - } - - public T Data { get; set; } = default!; - } - - 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 new CommonPutResponse(0, MessagePutCreate, create); - } - - internal static CommonPutResponse Create() - { - return new CommonPutResponse(0, MessagePutCreate, true); - } - - internal static CommonPutResponse Modify() - { - return new CommonPutResponse(0, MessagePutModify, false); - } - } - - /// - /// Common response for delete method. - /// - public class CommonDeleteResponse : CommonDataResponse - { - /// - public class ResponseData - { - /// - public ResponseData() { } - - /// - public ResponseData(bool delete) - { - Delete = delete; - } - - /// - /// True if the entry is deleted. False if the entry does not exist. - /// - public bool Delete { get; set; } - } - - /// - public CommonDeleteResponse() - { - - } - - /// - public CommonDeleteResponse(int code, string message, bool delete) - : base(code, message, new ResponseData(delete)) - { - - } - - internal static CommonDeleteResponse Create(bool delete) - { - return new CommonDeleteResponse(0, MessageDeleteDelete, delete); - } - - internal static CommonDeleteResponse Delete() - { - return new CommonDeleteResponse(0, MessageDeleteDelete, true); - } - - internal static CommonDeleteResponse NotExist() - { - return new CommonDeleteResponse(0, MessageDeleteNotExist, false); - } - } } -- cgit v1.2.3