diff options
author | crupest <crupest@outlook.com> | 2019-04-22 15:47:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-22 15:47:52 +0800 |
commit | 58edbb6661c8f7d147f438716b286aa84c6bcb14 (patch) | |
tree | 5285f03bbc10efe6319e9487bc1de453a8efd859 /Timeline/Entities/Http/User.cs | |
parent | a2d8695d1e46d271bab40ea192afffee65f7538f (diff) | |
download | timeline-58edbb6661c8f7d147f438716b286aa84c6bcb14.tar.gz timeline-58edbb6661c8f7d147f438716b286aa84c6bcb14.tar.bz2 timeline-58edbb6661c8f7d147f438716b286aa84c6bcb14.zip |
Add change password api.
Diffstat (limited to 'Timeline/Entities/Http/User.cs')
-rw-r--r-- | Timeline/Entities/Http/User.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Timeline/Entities/Http/User.cs b/Timeline/Entities/Http/User.cs index 24952ac7..d42ca088 100644 --- a/Timeline/Entities/Http/User.cs +++ b/Timeline/Entities/Http/User.cs @@ -23,4 +23,21 @@ public static ReturnCodeMessageResponse Deleted { get; } = new ReturnCodeMessageResponse(DeletedCode, "A existing user is deleted."); public static ReturnCodeMessageResponse NotExists { get; } = new ReturnCodeMessageResponse(NotExistsCode, "User with given name does not exists."); } + + public class ChangePasswordRequest + { + public string OldPassword { get; set; } + public string NewPassword { get; set; } + } + + public static class ChangePasswordResponse + { + public const int SuccessCode = 0; + public const int BadOldPasswordCode = 1; + public const int NotExistsCode = 2; + + public static ReturnCodeMessageResponse Success { get; } = new ReturnCodeMessageResponse(SuccessCode, "Success to change password."); + public static ReturnCodeMessageResponse BadOldPassword { get; } = new ReturnCodeMessageResponse(BadOldPasswordCode, "Old password is wrong."); + public static ReturnCodeMessageResponse NotExists { get; } = new ReturnCodeMessageResponse(NotExistsCode, "Username does not exists, please update token."); + } } |