aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http/ErrorResponse.cs
blob: d6cb5ca0e615eb2d55d99f52bcaae85ec9bd0202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
using static TimelineApp.Resources.Messages;

namespace TimelineApp.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));
            }

            public static CommonResponse CustomMessage_InvalidModel(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.Common.InvalidModel, string.Format(message, formatArgs));
            }

            public static CommonResponse Forbid(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.Common.Forbid, string.Format(Common_Forbid, formatArgs));
            }

            public static CommonResponse CustomMessage_Forbid(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.Common.Forbid, string.Format(message, formatArgs));
            }

            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));
                }

                public static CommonResponse CustomMessage_IfNonMatch_BadFormat(string message, params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Header.IfNonMatch_BadFormat, string.Format(message, formatArgs));
                }

                public static CommonResponse ContentType_Missing(params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Header.ContentType_Missing, string.Format(Common_Header_ContentType_Missing, formatArgs));
                }

                public static CommonResponse CustomMessage_ContentType_Missing(string message, params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Header.ContentType_Missing, string.Format(message, formatArgs));
                }

                public static CommonResponse ContentLength_Missing(params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Header.ContentLength_Missing, string.Format(Common_Header_ContentLength_Missing, formatArgs));
                }

                public static CommonResponse CustomMessage_ContentLength_Missing(string message, params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Header.ContentLength_Missing, string.Format(message, formatArgs));
                }

                public static CommonResponse ContentLength_Zero(params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Header.ContentLength_Zero, string.Format(Common_Header_ContentLength_Zero, formatArgs));
                }

                public static CommonResponse CustomMessage_ContentLength_Zero(string message, params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Header.ContentLength_Zero, string.Format(message, formatArgs));
                }

            }

            public static class Content
            {

                public static CommonResponse TooBig(params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Content.TooBig, string.Format(Common_Content_TooBig, formatArgs));
                }

                public static CommonResponse CustomMessage_TooBig(string message, params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Content.TooBig, string.Format(message, formatArgs));
                }

                public static CommonResponse UnmatchedLength_Smaller(params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Content.UnmatchedLength_Smaller, string.Format(Common_Content_UnmatchedLength_Smaller, formatArgs));
                }

                public static CommonResponse CustomMessage_UnmatchedLength_Smaller(string message, params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Content.UnmatchedLength_Smaller, string.Format(message, formatArgs));
                }

                public static CommonResponse UnmatchedLength_Bigger(params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Content.UnmatchedLength_Bigger, string.Format(Common_Content_UnmatchedLength_Bigger, formatArgs));
                }

                public static CommonResponse CustomMessage_UnmatchedLength_Bigger(string message, params object?[] formatArgs)
                {
                    return new CommonResponse(ErrorCodes.Common.Content.UnmatchedLength_Bigger, string.Format(message, formatArgs));
                }

            }

        }

        public static class UserCommon
        {

            public static CommonResponse NotExist(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserCommon.NotExist, string.Format(UserCommon_NotExist, formatArgs));
            }

            public static CommonResponse CustomMessage_NotExist(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserCommon.NotExist, string.Format(message, formatArgs));
            }

        }

        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));
            }

            public static CommonResponse CustomMessage_Create_BadCredential(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Create_BadCredential, string.Format(message, formatArgs));
            }

            public static CommonResponse Verify_BadFormat(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Verify_BadFormat, string.Format(TokenController_Verify_BadFormat, formatArgs));
            }

            public static CommonResponse CustomMessage_Verify_BadFormat(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Verify_BadFormat, string.Format(message, formatArgs));
            }

            public static CommonResponse Verify_UserNotExist(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Verify_UserNotExist, string.Format(TokenController_Verify_UserNotExist, formatArgs));
            }

            public static CommonResponse CustomMessage_Verify_UserNotExist(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Verify_UserNotExist, string.Format(message, formatArgs));
            }

            public static CommonResponse Verify_OldVersion(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Verify_OldVersion, string.Format(TokenController_Verify_OldVersion, formatArgs));
            }

            public static CommonResponse CustomMessage_Verify_OldVersion(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Verify_OldVersion, string.Format(message, formatArgs));
            }

            public static CommonResponse Verify_TimeExpired(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Verify_TimeExpired, string.Format(TokenController_Verify_TimeExpired, formatArgs));
            }

            public static CommonResponse CustomMessage_Verify_TimeExpired(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TokenController.Verify_TimeExpired, string.Format(message, formatArgs));
            }

        }

        public static class UserController
        {

            public static CommonResponse UsernameConflict(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserController.UsernameConflict, string.Format(UserController_UsernameConflict, formatArgs));
            }

            public static CommonResponse CustomMessage_UsernameConflict(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserController.UsernameConflict, string.Format(message, formatArgs));
            }

            public static CommonResponse ChangePassword_BadOldPassword(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserController.ChangePassword_BadOldPassword, string.Format(UserController_ChangePassword_BadOldPassword, formatArgs));
            }

            public static CommonResponse CustomMessage_ChangePassword_BadOldPassword(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserController.ChangePassword_BadOldPassword, string.Format(message, formatArgs));
            }

        }

        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));
            }

            public static CommonResponse CustomMessage_BadFormat_CantDecode(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserAvatar.BadFormat_CantDecode, string.Format(message, formatArgs));
            }

            public static CommonResponse BadFormat_UnmatchedFormat(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserAvatar.BadFormat_UnmatchedFormat, string.Format(UserAvatar_BadFormat_UnmatchedFormat, formatArgs));
            }

            public static CommonResponse CustomMessage_BadFormat_UnmatchedFormat(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserAvatar.BadFormat_UnmatchedFormat, string.Format(message, formatArgs));
            }

            public static CommonResponse BadFormat_BadSize(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserAvatar.BadFormat_BadSize, string.Format(UserAvatar_BadFormat_BadSize, formatArgs));
            }

            public static CommonResponse CustomMessage_BadFormat_BadSize(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.UserAvatar.BadFormat_BadSize, string.Format(message, formatArgs));
            }

        }

        public static class TimelineCommon
        {

            public static CommonResponse NameConflict(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TimelineCommon.NameConflict, string.Format(TimelineCommon_NameConflict, formatArgs));
            }

            public static CommonResponse CustomMessage_NameConflict(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TimelineCommon.NameConflict, string.Format(message, formatArgs));
            }

            public static CommonResponse NotExist(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TimelineCommon.NotExist, string.Format(TimelineCommon_NotExist, formatArgs));
            }

            public static CommonResponse CustomMessage_NotExist(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TimelineCommon.NotExist, string.Format(message, formatArgs));
            }

            public static CommonResponse MemberPut_NotExist(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TimelineCommon.MemberPut_NotExist, string.Format(TimelineCommon_MemberPut_NotExist, formatArgs));
            }

            public static CommonResponse CustomMessage_MemberPut_NotExist(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TimelineCommon.MemberPut_NotExist, string.Format(message, formatArgs));
            }

        }

        public static class TimelineController
        {

            public static CommonResponse QueryRelateNotExist(params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TimelineController.QueryRelateNotExist, string.Format(TimelineController_QueryRelateNotExist, formatArgs));
            }

            public static CommonResponse CustomMessage_QueryRelateNotExist(string message, params object?[] formatArgs)
            {
                return new CommonResponse(ErrorCodes.TimelineController.QueryRelateNotExist, string.Format(message, formatArgs));
            }

        }

    }

}