diff options
author | crupest <crupest@outlook.com> | 2021-05-05 15:58:40 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-05-05 15:58:40 +0800 |
commit | 4b413d32ef7b21bc2e35086ae0e695438eec6d43 (patch) | |
tree | a5e99c70ca24e827730b15f3ea3aa8664badc24d /BackEnd/Timeline/Controllers/UserAvatarController.cs | |
parent | cc6d33511a6a4c43630a36b13d03db57f432520c (diff) | |
download | timeline-4b413d32ef7b21bc2e35086ae0e695438eec6d43.tar.gz timeline-4b413d32ef7b21bc2e35086ae0e695438eec6d43.tar.bz2 timeline-4b413d32ef7b21bc2e35086ae0e695438eec6d43.zip |
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Controllers/UserAvatarController.cs')
-rw-r--r-- | BackEnd/Timeline/Controllers/UserAvatarController.cs | 10 |
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);
|