using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
///
/// 用户模块
///
public class UserController : ApiController
{
private readonly IUserService _invokeService;
///
/// 构造函数
///
///
public UserController(IUserService invokeService)
{
_invokeService = invokeService;
}
///
/// 用户列表
///
///
///
[HttpPost]
[Route("GetUserList")]
public DataResult> GetUserList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
///
/// 获取用户信息
///
///
///
[HttpGet]
[Route("GetUserInfo")]
public DataResult GetUserInfo([FromQuery] string id)
{
var res = _invokeService.GetUserInfo(id);
return res;
}
///
/// 编辑
///
///
///
[HttpPost]
[Route("EditUser")]
public DataResult EditUser([FromBody] UserReq model)
{
var res = _invokeService.EditUser(model);
return res;
}
///
/// 用户唯一码检测
///
///
///
[HttpGet]
[Route("CheckUserCode")]
public async Task CheckUserCode([FromQuery] string code)
{
var res = await _invokeService.CheckUserCode(code);
return res;
}
///
/// 批量删除用户
///
///
///
[HttpPost]
[Route("BatchDelUser")]
public async Task BatchDelUser([FromBody] IdModel req)
{
var res =await _invokeService.BatchDelUser(req);
return res;
}
///
/// 按Excel导入用户信息
///
/// Excel文件
///
[HttpPost]
[Route("ImportUserByExcel")]
public async Task> ImportUserByExcel(IFormFile file)
{
var res = await _invokeService.ImportUserByExcel(file);
return res;
}
}