diff options
author | crupest <crupest@outlook.com> | 2019-04-22 17:15:06 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-22 17:15:06 +0800 |
commit | 4249a52c856dcb4a33e8a381076542f563e89ac2 (patch) | |
tree | df8ffa6162d41c748b14c44a76c4859eca529fee /Timeline/Controllers | |
parent | 45c09ace4acee4df9c860395fb7261adb09bc914 (diff) | |
download | timeline-4249a52c856dcb4a33e8a381076542f563e89ac2.tar.gz timeline-4249a52c856dcb4a33e8a381076542f563e89ac2.tar.bz2 timeline-4249a52c856dcb4a33e8a381076542f563e89ac2.zip |
Fix a bug in cos service. Add avatar api.
Diffstat (limited to 'Timeline/Controllers')
-rw-r--r-- | Timeline/Controllers/UserController.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Timeline/Controllers/UserController.cs b/Timeline/Controllers/UserController.cs index 552bfb2f..1231befb 100644 --- a/Timeline/Controllers/UserController.cs +++ b/Timeline/Controllers/UserController.cs @@ -79,6 +79,14 @@ namespace Timeline.Controllers } } + [HttpGet("user/{username}/avatar"), Authorize] + public async Task<IActionResult> GetAvatar([FromRoute] string username) + { + // TODO: test user existence. + var url = await _userService.GetAvatarUrl(username); + return Redirect(url); + } + [HttpPost("userop/changepassword"), Authorize] public async Task<IActionResult> ChangePassword([FromBody] ChangePasswordRequest request) { |