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 | 80d686a8b875cce854e4291cbe4a53e7a03e3eff (patch) | |
tree | 5285f03bbc10efe6319e9487bc1de453a8efd859 /Timeline/Entities | |
parent | 407f97db0be86aa071802b67bfdeadc7703528c9 (diff) | |
download | timeline-80d686a8b875cce854e4291cbe4a53e7a03e3eff.tar.gz timeline-80d686a8b875cce854e4291cbe4a53e7a03e3eff.tar.bz2 timeline-80d686a8b875cce854e4291cbe4a53e7a03e3eff.zip |
Add change password api.
Diffstat (limited to 'Timeline/Entities')
-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."); + } } |