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.

116 lines
2.8 KiB
C#

12 months ago
using DS.Module.Core;
1 month ago
using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
12 months ago
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
/// <summary>
/// 角色模块
/// </summary>
public class RoleController : ApiController
{
private readonly ISysRoleService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public RoleController(ISysRoleService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetRoleList")]
public DataResult<List<SysRole>> GetRoleList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditRole")]
public DataResult EditRole([FromBody] RoleInput model)
{
var res = _invokeService.EditRole(model);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetRoleInfo")]
public DataResult<SysRole> GetRoleInfo([FromQuery] string id)
{
var res = _invokeService.GetRoleInfo(id);
return res;
}
/// <summary>
/// 获取角色权限树-客户端
12 months ago
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetClientRolePermissionTree")]
public DataResult<RolePermissionTreeViewModel> GetClientRolePermissionTree()
12 months ago
{
var res = _invokeService.GetClientRolePermissionTree();
12 months ago
return res;
}
/// <summary>
/// 获取角色权限
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetRolePermission")]
11 months ago
public DataResult<long?[]> GetRolePermission([FromQuery] string id)
12 months ago
{
var res = _invokeService.GetRolePermission(id);
return res;
}
/// <summary>
/// 更新角色权限-客户端
12 months ago
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("UpdateClientRolePermission")]
public DataResult UpdateClientRolePermission([FromBody] RolePermissionInput model)
12 months ago
{
var res = _invokeService.UpdateClientRolePermission(model);
12 months ago
return res;
}
1 month ago
/// <summary>
/// 单个角色删除
/// </summary>
/// <param name="req">角色Id</param>
/// <returns></returns>
[HttpPost]
[Route("DelRole")]
public async Task<DataResult> DelRole([FromBody] IdModel req)
{
var res = await _invokeService.DelRoleAsync(req.Id);
return res;
}
12 months ago
}