diff options
author | crupest <crupest@outlook.com> | 2019-04-13 13:06:05 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-13 13:06:05 +0800 |
commit | 962ad53360fb559eaed1ee5a45ef361e6f580bd7 (patch) | |
tree | 8ecd711d2b1c97754b321ef0e0bc7de45d303cbd /Timeline/Entities/User.cs | |
parent | 72890735ced2edc8ccecfed811393e951de5c091 (diff) | |
parent | 1d184c3f41da806803c1ee792395eabcd155077d (diff) | |
download | timeline-962ad53360fb559eaed1ee5a45ef361e6f580bd7.tar.gz timeline-962ad53360fb559eaed1ee5a45ef361e6f580bd7.tar.bz2 timeline-962ad53360fb559eaed1ee5a45ef361e6f580bd7.zip |
Merge branch '6-user' into separate
Diffstat (limited to 'Timeline/Entities/User.cs')
-rw-r--r-- | Timeline/Entities/User.cs | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/Timeline/Entities/User.cs b/Timeline/Entities/User.cs index c77e895d..1cb5a894 100644 --- a/Timeline/Entities/User.cs +++ b/Timeline/Entities/User.cs @@ -1,25 +1,41 @@ -namespace Timeline.Entities +namespace Timeline.Entities { - public class User + public class CreateTokenRequest { - public int Id { get; set; } public string Username { get; set; } public string Password { get; set; } - public string[] Roles { get; set; } + } - public UserInfo GetUserInfo() - { - return new UserInfo - { - Username = Username, - Roles = Roles - }; - } + public class CreateTokenResponse + { + public bool Success { get; set; } + public string Token { get; set; } + public UserInfo UserInfo { get; set; } } - public class UserInfo + public class TokenValidationRequest + { + public string Token { get; set; } + } + + public class TokenValidationResponse + { + public bool IsValid { get; set; } + public UserInfo UserInfo { get; set; } + } + + public class CreateUserRequest { public string Username { get; set; } - public string[] Roles { get; set; } + public string Password { get; set; } + public string[] Roles { get; set; } + } + + public class CreateUserResponse + { + public const int SuccessCode = 0; + public const int AlreadyExistsCode = 1; + + public int ReturnCode { get; set; } } } |