|
@@ -2,7 +2,9 @@
|
|
|
using MySqlX.XDevAPI.Common;
|
|
|
using OASystem.Domain.Dtos;
|
|
|
using OASystem.Domain.Entities.System;
|
|
|
+using OASystem.Domain.ResponseEntities.System;
|
|
|
using OASystem.Domain.ViewModels.System;
|
|
|
+using OASystem.Infrastructure.Repositories.Login;
|
|
|
using OASystem.Infrastructure.Repositories.System;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
@@ -10,19 +12,38 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
- [Route("[controller]/[action]")]
|
|
|
+ [Route("api/[controller]/[action]")]
|
|
|
public class SystemController : ControllerBase
|
|
|
{
|
|
|
- readonly Sys_DepartmentRepository _sysDepRep;
|
|
|
- readonly IMapper _mapper;
|
|
|
+ private readonly Sys_DepartmentRepository _sysDepRep;
|
|
|
+ private readonly UsersRepository _userRep;
|
|
|
+ private readonly IMapper _mapper;
|
|
|
|
|
|
- public SystemController(Sys_DepartmentRepository sysDepRep, IMapper mapper)
|
|
|
+ public SystemController(Sys_DepartmentRepository sysDepRep, IMapper mapper, UsersRepository userRep)
|
|
|
{
|
|
|
_sysDepRep = sysDepRep;
|
|
|
+ _userRep = userRep;
|
|
|
_mapper = mapper;
|
|
|
}
|
|
|
|
|
|
+ #region user 操作
|
|
|
|
|
|
+ [Authorize]
|
|
|
+ [HttpGet]
|
|
|
+ [ProducesResponseType(typeof(LoginView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> GetUserList()
|
|
|
+ {
|
|
|
+ var userList = _userRep.GetUserList(_userRep);
|
|
|
+
|
|
|
+ if (userList.Result.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, userList.Result.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(userList.Result.Data));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(LoginView), StatusCodes.Status200OK)]
|