aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.ErrorCodes
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-27 19:21:35 +0800
committercrupest <crupest@outlook.com>2020-10-27 19:21:35 +0800
commitac769e656b122ff569c3f1534701b71e00fed586 (patch)
tree72966645ff1e25139d3995262e1c4349f2c14733 /BackEnd/Timeline.ErrorCodes
parent14e5848c23c643cea9b5d709770747d98c3d75e2 (diff)
downloadtimeline-ac769e656b122ff569c3f1534701b71e00fed586.tar.gz
timeline-ac769e656b122ff569c3f1534701b71e00fed586.tar.bz2
timeline-ac769e656b122ff569c3f1534701b71e00fed586.zip
Split front and back end.
Diffstat (limited to 'BackEnd/Timeline.ErrorCodes')
-rw-r--r--BackEnd/Timeline.ErrorCodes/ErrorCodes.cs66
-rw-r--r--BackEnd/Timeline.ErrorCodes/Timeline.ErrorCodes.csproj7
-rw-r--r--BackEnd/Timeline.ErrorCodes/packages.lock.json6
3 files changed, 79 insertions, 0 deletions
diff --git a/BackEnd/Timeline.ErrorCodes/ErrorCodes.cs b/BackEnd/Timeline.ErrorCodes/ErrorCodes.cs
new file mode 100644
index 00000000..91e0c1fd
--- /dev/null
+++ b/BackEnd/Timeline.ErrorCodes/ErrorCodes.cs
@@ -0,0 +1,66 @@
+namespace Timeline.Models.Http
+{
+ /// <summary>
+ /// All error code constants.
+ /// </summary>
+ /// <remarks>
+ /// Format: 1bbbccdd
+ /// </remarks>
+ public static class ErrorCodes
+ {
+ public static class Common
+ {
+ public const int InvalidModel = 1_000_0001;
+ public const int Forbid = 1_000_0002;
+ public const int UnknownEndpoint = 1_000_0003;
+
+ public static class Header
+ {
+ public const int IfNonMatch_BadFormat = 1_000_01_01;
+ }
+
+ public static class Content
+ {
+ public const int TooBig = 1_000_11_01;
+ }
+ }
+
+ public static class UserCommon
+ {
+ public const int NotExist = 1_001_0001;
+ }
+
+ public static class TokenController
+ {
+ public const int Create_BadCredential = 1_101_01_01;
+ public const int Verify_BadFormat = 1_101_02_01;
+ public const int Verify_UserNotExist = 1_101_02_02;
+ public const int Verify_OldVersion = 1_101_02_03;
+ public const int Verify_TimeExpired = 1_101_02_04;
+ }
+
+ public static class UserController
+ {
+ public const int UsernameConflict = 1_102_01_01;
+ public const int ChangePassword_BadOldPassword = 1_102_02_01;
+ }
+
+ public static class UserAvatar
+ {
+ public const int BadFormat_CantDecode = 1_103_00_01;
+ public const int BadFormat_UnmatchedFormat = 1_103_00_02;
+ public const int BadFormat_BadSize = 1_103_00_03;
+ }
+
+ public static class TimelineController
+ {
+ public const int NameConflict = 1_104_01_01;
+ public const int NotExist = 1_104_02_01;
+ public const int MemberPut_NotExist = 1_104_03_01;
+ public const int QueryRelateNotExist = 1_104_04_01;
+ public const int PostNotExist = 1_104_05_01;
+ public const int PostNoData = 1_104_05_02;
+ }
+ }
+}
+
diff --git a/BackEnd/Timeline.ErrorCodes/Timeline.ErrorCodes.csproj b/BackEnd/Timeline.ErrorCodes/Timeline.ErrorCodes.csproj
new file mode 100644
index 00000000..01ca2568
--- /dev/null
+++ b/BackEnd/Timeline.ErrorCodes/Timeline.ErrorCodes.csproj
@@ -0,0 +1,7 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>netcoreapp3.1</TargetFramework>
+ </PropertyGroup>
+
+</Project>
diff --git a/BackEnd/Timeline.ErrorCodes/packages.lock.json b/BackEnd/Timeline.ErrorCodes/packages.lock.json
new file mode 100644
index 00000000..dabf86bc
--- /dev/null
+++ b/BackEnd/Timeline.ErrorCodes/packages.lock.json
@@ -0,0 +1,6 @@
+{
+ "version": 1,
+ "dependencies": {
+ ".NETCoreApp,Version=v3.1": {}
+ }
+} \ No newline at end of file