aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/UserAvatarController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-05-05 15:58:40 +0800
committercrupest <crupest@outlook.com>2021-05-05 15:58:40 +0800
commit0accc9f09d0aaf2292cb94e3c4e438c3f76f89e5 (patch)
tree6877c4815b54eddda828d3d89752ab964d17d1bf /BackEnd/Timeline/Controllers/UserAvatarController.cs
parent1c4be4a43c4acd2ee46e37685e9153d9c5b34233 (diff)
downloadtimeline-0accc9f09d0aaf2292cb94e3c4e438c3f76f89e5.tar.gz
timeline-0accc9f09d0aaf2292cb94e3c4e438c3f76f89e5.tar.bz2
timeline-0accc9f09d0aaf2292cb94e3c4e438c3f76f89e5.zip
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Controllers/UserAvatarController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/UserAvatarController.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/BackEnd/Timeline/Controllers/UserAvatarController.cs b/BackEnd/Timeline/Controllers/UserAvatarController.cs
index 47d46a54..376e1f11 100644
--- a/BackEnd/Timeline/Controllers/UserAvatarController.cs
+++ b/BackEnd/Timeline/Controllers/UserAvatarController.cs
@@ -18,7 +18,7 @@ namespace Timeline.Controllers
/// </summary>
[ApiController]
[ProducesErrorResponseType(typeof(CommonResponse))]
- public class UserAvatarController : Controller
+ public class UserAvatarController : MyControllerBase
{
private readonly IUserService _userService;
private readonly IUserAvatarService _service;
@@ -62,9 +62,9 @@ namespace Timeline.Controllers
[ProducesResponseType(StatusCodes.Status403Forbidden)]
public async Task<IActionResult> Put([FromRoute][Username] string username, [FromBody] ByteData body)
{
- if (!this.UserHasPermission(UserPermission.UserManagement) && User.Identity!.Name != username)
+ if (!UserHasPermission(UserPermission.UserManagement) && User.Identity!.Name != username)
{
- return this.ForbidWithMessage(Resource.MessageForbidNotAdministratorOrOwner);
+ return ForbidWithCommonResponse(Resource.MessageForbidNotAdministratorOrOwner);
}
long id = await _userService.GetUserIdByUsernameAsync(username);
@@ -105,9 +105,9 @@ namespace Timeline.Controllers
[Authorize]
public async Task<IActionResult> Delete([FromRoute][Username] string username)
{
- if (!this.UserHasPermission(UserPermission.UserManagement) && User.Identity!.Name != username)
+ if (!UserHasPermission(UserPermission.UserManagement) && User.Identity!.Name != username)
{
- return this.ForbidWithMessage(Resource.MessageForbidNotAdministratorOrOwner);
+ return ForbidWithCommonResponse(Resource.MessageForbidNotAdministratorOrOwner);
}
long id = await _userService.GetUserIdByUsernameAsync(username);