From 4249a52c856dcb4a33e8a381076542f563e89ac2 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 22 Apr 2019 17:15:06 +0800 Subject: Fix a bug in cos service. Add avatar api. --- Timeline/Controllers/UserController.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Timeline/Controllers/UserController.cs') 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 GetAvatar([FromRoute] string username) + { + // TODO: test user existence. + var url = await _userService.GetAvatarUrl(username); + return Redirect(url); + } + [HttpPost("userop/changepassword"), Authorize] public async Task ChangePassword([FromBody] ChangePasswordRequest request) { -- cgit v1.2.3