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.

101 lines
2.5 KiB
C#

1 year ago
using DS.Module.Core;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
1 year 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>
/// 获取角色权限树-客户端
1 year ago
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetClientRolePermissionTree")]
public DataResult<RolePermissionTreeViewModel> GetClientRolePermissionTree()
1 year ago
{
var res = _invokeService.GetClientRolePermissionTree();
1 year ago
return res;
}
/// <summary>
/// 获取角色权限
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetRolePermission")]
11 months ago
public DataResult<long?[]> GetRolePermission([FromQuery] string id)
1 year ago
{
var res = _invokeService.GetRolePermission(id);
return res;
}
/// <summary>
/// 更新角色权限-客户端
1 year ago
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("UpdateClientRolePermission")]
public DataResult UpdateClientRolePermission([FromBody] RolePermissionInput model)
1 year ago
{
var res = _invokeService.UpdateClientRolePermission(model);
1 year ago
return res;
}
}