aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-25 19:30:12 +0800
committercrupest <crupest@outlook.com>2021-04-25 19:30:12 +0800
commitb64806226723df9a9deb64e80defc93860896f50 (patch)
tree51614aa0e229abd3acd423a31eed34756db15f69 /BackEnd/Timeline
parent33925a52d53f95f450a41fdf2b30906ed5ea2a4e (diff)
downloadtimeline-b64806226723df9a9deb64e80defc93860896f50.tar.gz
timeline-b64806226723df9a9deb64e80defc93860896f50.tar.bz2
timeline-b64806226723df9a9deb64e80defc93860896f50.zip
refactor: Remove splitted error code project.
Diffstat (limited to 'BackEnd/Timeline')
-rw-r--r--BackEnd/Timeline/ErrorCodes.cs88
-rw-r--r--BackEnd/Timeline/Timeline.csproj4
2 files changed, 88 insertions, 4 deletions
diff --git a/BackEnd/Timeline/ErrorCodes.cs b/BackEnd/Timeline/ErrorCodes.cs
new file mode 100644
index 00000000..87d451f2
--- /dev/null
+++ b/BackEnd/Timeline/ErrorCodes.cs
@@ -0,0 +1,88 @@
+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 const int Unauthorized = 1_000_0004;
+
+ public static class Header
+ {
+ public const int IfNonMatch_BadFormat = 1_000_01_01;
+ public const int IfModifiedSince_BadFormat = 1_000_01_02;
+ }
+
+ public static class Content
+ {
+ public const int TooBig = 1_000_11_01;
+ }
+
+ public static class Token
+ {
+ public const int TimeExpired = 1_000_21_01;
+ public const int VersionExpired = 1_000_21_02;
+ public const int BadFormat = 1_000_21_03;
+ public const int UserNotExist = 1_000_21_04;
+ public const int Unknown = 1_000_21_05;
+ }
+ }
+
+ 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 const int ChangePermission_RootUser = 1_102_03_01;
+ public const int Delete_RootUser = 1_102_04_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 QueryRelateNotExist = 1_104_04_01;
+ public const int PostNotExist = 1_104_05_01;
+ public const int PostDataNotExist = 1_104_05_02;
+ }
+
+ public static class HighlightTimelineController
+ {
+ public const int NonHighlight = 1_105_01_01;
+ }
+
+ public static class BookmarkTimelineController
+ {
+ public const int NonBookmark = 1_106_01_01;
+ }
+ }
+}
+
diff --git a/BackEnd/Timeline/Timeline.csproj b/BackEnd/Timeline/Timeline.csproj
index 0365d0fd..08441c85 100644
--- a/BackEnd/Timeline/Timeline.csproj
+++ b/BackEnd/Timeline/Timeline.csproj
@@ -48,10 +48,6 @@
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\Timeline.ErrorCodes\Timeline.ErrorCodes.csproj" />
- </ItemGroup>
-
- <ItemGroup>
<Compile Update="Auth\Resource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>