using DS.Module.Core;
using DS.WMS.Core.System.Dtos;
using DS.WMS.Core.System.Entity;
using DS.WMS.Core.System.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.AdminApi.Controllers;
///
/// 角色模块
///
public class RoleController : ApiController
{
private readonly ISysRoleService _invokeService;
///
/// 构造函数
///
///
public RoleController(ISysRoleService invokeService)
{
_invokeService = invokeService;
}
///
/// 列表
///
///
///
[HttpPost]
[Route("GetRoleList")]
public DataResult> GetRoleList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
///
/// 编辑
///
///
///
[HttpPost]
[Route("EditRole")]
public DataResult EditRole([FromBody] RoleInput model)
{
var res = _invokeService.EditRole(model);
return res;
}
///
/// 详情
///
///
///
[HttpGet]
[Route("GetRoleInfo")]
public DataResult GetRoleInfo([FromQuery] string id)
{
var res = _invokeService.GetRoleInfo(id);
return res;
}
///
/// 获取角色权限树
///
///
[HttpGet]
[Route("GetRolePermissionTree")]
public DataResult GetRolePermissionTree()
{
var res = _invokeService.GetRolePermissionTree();
return res;
}
///
/// 获取角色权限
///
///
///
[HttpGet]
[Route("GetRolePermission")]
public DataResult GetRolePermission([FromQuery] string id)
{
var res = _invokeService.GetRolePermission(id);
return res;
}
///
/// 更新角色权限
///
///
///
[HttpPost]
[Route("UpdateRolePermission")]
public DataResult UpdateRolePermission([FromBody] RolePermissionInput model)
{
var res = _invokeService.UpdateRolePermission(model);
return res;
}
}