From 0c4caaebe2480e77918d5d7df234f0edaeab74ba Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 27 Oct 2020 15:39:09 +0800 Subject: refactor(back): Refactor error codes code generator. --- Timeline/Models/Http/ErrorResponse.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'Timeline/Models/Http/ErrorResponse.cs') diff --git a/Timeline/Models/Http/ErrorResponse.cs b/Timeline/Models/Http/ErrorResponse.cs index 7ba536f9..ac86481f 100644 --- a/Timeline/Models/Http/ErrorResponse.cs +++ b/Timeline/Models/Http/ErrorResponse.cs @@ -1,15 +1,11 @@ - -using static Timeline.Resources.Messages; +using static Timeline.Resources.Messages; namespace Timeline.Models.Http { - public static class ErrorResponse { - public static class Common { - public static CommonResponse InvalidModel(params object?[] formatArgs) { return new CommonResponse(ErrorCodes.Common.InvalidModel, string.Format(Common_InvalidModel, formatArgs)); @@ -42,7 +38,6 @@ namespace Timeline.Models.Http public static class Header { - public static CommonResponse IfNonMatch_BadFormat(params object?[] formatArgs) { return new CommonResponse(ErrorCodes.Common.Header.IfNonMatch_BadFormat, string.Format(Common_Header_IfNonMatch_BadFormat, formatArgs)); @@ -57,7 +52,6 @@ namespace Timeline.Models.Http public static class Content { - public static CommonResponse TooBig(params object?[] formatArgs) { return new CommonResponse(ErrorCodes.Common.Content.TooBig, string.Format(Common_Content_TooBig, formatArgs)); @@ -74,7 +68,6 @@ namespace Timeline.Models.Http public static class UserCommon { - public static CommonResponse NotExist(params object?[] formatArgs) { return new CommonResponse(ErrorCodes.UserCommon.NotExist, string.Format(UserCommon_NotExist, formatArgs)); @@ -89,7 +82,6 @@ namespace Timeline.Models.Http public static class TokenController { - public static CommonResponse Create_BadCredential(params object?[] formatArgs) { return new CommonResponse(ErrorCodes.TokenController.Create_BadCredential, string.Format(TokenController_Create_BadCredential, formatArgs)); @@ -144,7 +136,6 @@ namespace Timeline.Models.Http public static class UserController { - public static CommonResponse UsernameConflict(params object?[] formatArgs) { return new CommonResponse(ErrorCodes.UserController.UsernameConflict, string.Format(UserController_UsernameConflict, formatArgs)); @@ -169,7 +160,6 @@ namespace Timeline.Models.Http public static class UserAvatar { - public static CommonResponse BadFormat_CantDecode(params object?[] formatArgs) { return new CommonResponse(ErrorCodes.UserAvatar.BadFormat_CantDecode, string.Format(UserAvatar_BadFormat_CantDecode, formatArgs)); @@ -204,7 +194,6 @@ namespace Timeline.Models.Http public static class TimelineController { - public static CommonResponse NameConflict(params object?[] formatArgs) { return new CommonResponse(ErrorCodes.TimelineController.NameConflict, string.Format(TimelineController_NameConflict, formatArgs)); -- cgit v1.2.3