You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.4 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.AdminApi.Controllers;
/// <summary>
/// 用户模块
/// </summary>
public class UserController : ApiController
{
private readonly IUserService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public UserController(IUserService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 用户列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetUserList")]
public DataResult<List<UserViewModel>> GetUserList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 获取用户信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetUserInfo")]
public DataResult<UserViewModel> GetUserInfo([FromQuery] string id)
{
var res = _invokeService.GetUserInfo(id);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditUser")]
public DataResult EditUser([FromBody] UserReq model)
{
var res = _invokeService.EditUser(model);
return res;
}
}