aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Entities/User.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-04-21 23:23:49 +0800
committercrupest <crupest@outlook.com>2019-04-21 23:23:49 +0800
commite347b4a4092a24ff7106ffd3aca67d6ca7decca8 (patch)
treee139e794df8cd20c1cf4f60c668dd1d94bf239e1 /Timeline/Entities/User.cs
parentfce9074be199b1c100481f49ccd9e231df2b84c8 (diff)
downloadtimeline-e347b4a4092a24ff7106ffd3aca67d6ca7decca8.tar.gz
timeline-e347b4a4092a24ff7106ffd3aca67d6ca7decca8.tar.bz2
timeline-e347b4a4092a24ff7106ffd3aca67d6ca7decca8.zip
Allow ordinary user to patch his password.
Diffstat (limited to 'Timeline/Entities/User.cs')
-rw-r--r--Timeline/Entities/User.cs30
1 files changed, 17 insertions, 13 deletions
diff --git a/Timeline/Entities/User.cs b/Timeline/Entities/User.cs
index 1b5a469d..eb126165 100644
--- a/Timeline/Entities/User.cs
+++ b/Timeline/Entities/User.cs
@@ -1,26 +1,30 @@
namespace Timeline.Entities
{
- public class CreateTokenRequest
+ public class UserModifyRequest
{
- public string Username { get; set; }
public string Password { get; set; }
+ public string[] Roles { get; set; }
}
- public class CreateTokenResponse
+ public class UserPutResponse
{
- public bool Success { get; set; }
- public string Token { get; set; }
- public UserInfo UserInfo { get; set; }
- }
+ public const int CreatedCode = 0;
+ public const int ModifiedCode = 1;
- public class VerifyTokenRequest
- {
- public string Token { get; set; }
+ public static UserPutResponse Created { get; } = new UserPutResponse { ReturnCode = CreatedCode };
+ public static UserPutResponse Modified { get; } = new UserPutResponse { ReturnCode = ModifiedCode };
+
+ public int ReturnCode { get; set; }
}
- public class VerifyTokenResponse
+ public class UserDeleteResponse
{
- public bool IsValid { get; set; }
- public UserInfo UserInfo { get; set; }
+ public const int SuccessCode = 0;
+ public const int NotExistsCode = 1;
+
+ public static UserDeleteResponse Success { get; } = new UserDeleteResponse { ReturnCode = SuccessCode };
+ public static UserDeleteResponse NotExists { get; } = new UserDeleteResponse { ReturnCode = NotExistsCode };
+
+ public int ReturnCode { get; set; }
}
}