aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-04-22 17:15:06 +0800
committercrupest <crupest@outlook.com>2019-04-22 17:15:06 +0800
commitc288638f3805ef3d8028c75cb248f641a91c835d (patch)
treedf8ffa6162d41c748b14c44a76c4859eca529fee /Timeline/Controllers
parent6a73b71e4af6aa30cf6fca301d954bc01927a8c9 (diff)
downloadtimeline-c288638f3805ef3d8028c75cb248f641a91c835d.tar.gz
timeline-c288638f3805ef3d8028c75cb248f641a91c835d.tar.bz2
timeline-c288638f3805ef3d8028c75cb248f641a91c835d.zip
Fix a bug in cos service. Add avatar api.
Diffstat (limited to 'Timeline/Controllers')
-rw-r--r--Timeline/Controllers/UserController.cs8
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)
{