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.

126 lines
3.3 KiB
C#

12 months ago
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Interface;
12 months ago
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.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")]
11 months ago
public DataResult EditUser([FromBody] UserReq model)
12 months ago
{
var res = _invokeService.EditUser(model);
return res;
}
/// <summary>
/// 用户唯一码检测
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[HttpGet]
[Route("CheckUserCode")]
public async Task<DataResult> CheckUserCode([FromQuery] string code)
{
var res = await _invokeService.CheckUserCode(code);
return res;
}
/// <summary>
/// 批量删除用户
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("BatchDelUser")]
public async Task<DataResult> BatchDelUser([FromBody] IdModel req)
{
var res =await _invokeService.BatchDelUser(req);
return res;
}
/// <summary>
/// 按Excel导入用户信息
/// </summary>
/// <param name="file">Excel文件</param>
/// <returns></returns>
[HttpPost]
[Route("ImportUserByExcel")]
public async Task<DataResult<string>> ImportUserByExcel(IFormFile file)
{
var res = await _invokeService.ImportUserByExcel(file);
return res;
}
/// <summary>
/// 查询客户端 用户拥有的菜单权限
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetClientUserPermissions")]
public async Task<DataResult<List<RouteItem>>> GetClientUserPermissions()
{
var res = await _invokeService.GetClientUserPermissions();
return res;
}
/// <summary>
/// 根据权限模块获取数据范围列表
/// </summary>
/// <param name="permissionId"></param>
/// <returns></returns>
[HttpGet]
[Route("GetDataRuleListByPermission")]
public async Task<DataResult<List<DataRuleRes>>> GetDataRuleListByPermission([FromQuery] string permissionId)
{
var res = await _invokeService.GetDataRuleListByPermission(permissionId);
return res;
}
12 months ago
}