aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/UserController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-04-18 21:23:21 +0800
committercrupest <crupest@outlook.com>2019-04-18 21:23:21 +0800
commit325d4c7dbfba45e9c5a7518279831f54c4690d20 (patch)
tree5b5a3b8d524cfc5f81b5af98de83d5070df4b68c /Timeline/Controllers/UserController.cs
parentae848e311b46a25ec1ed571432d55e800ac7595b (diff)
downloadtimeline-325d4c7dbfba45e9c5a7518279831f54c4690d20.tar.gz
timeline-325d4c7dbfba45e9c5a7518279831f54c4690d20.tar.bz2
timeline-325d4c7dbfba45e9c5a7518279831f54c4690d20.zip
Add user management REST api.
Diffstat (limited to 'Timeline/Controllers/UserController.cs')
-rw-r--r--Timeline/Controllers/UserController.cs17
1 files changed, 0 insertions, 17 deletions
diff --git a/Timeline/Controllers/UserController.cs b/Timeline/Controllers/UserController.cs
index 147724c1..285e0146 100644
--- a/Timeline/Controllers/UserController.cs
+++ b/Timeline/Controllers/UserController.cs
@@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
-using System;
using System.Threading.Tasks;
using Timeline.Entities;
using Timeline.Services;
@@ -71,21 +70,5 @@ namespace Timeline.Controllers
UserInfo = result
});
}
-
- [HttpPost("[action]")]
- [Authorize(Roles = "admin")]
- public async Task<ActionResult<CreateUserResponse>> CreateUser([FromBody] CreateUserRequest request)
- {
- var result = await _userService.CreateUser(request.Username, request.Password, request.Roles);
- switch (result)
- {
- case CreateUserResult.Success:
- return Ok(new CreateUserResponse { ReturnCode = CreateUserResponse.SuccessCode });
- case CreateUserResult.AlreadyExists:
- return Ok(new CreateUserResponse { ReturnCode = CreateUserResponse.AlreadyExistsCode });
- default:
- throw new Exception("Unreachable code.");
- }
- }
}
}