using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.AdminApi.Controllers;
///
/// 权限模块
///
public class PermissionController : ApiController
{
private readonly IPermissionService _invokeService;
///
/// 构造函数
///
///
public PermissionController(IPermissionService invokeService)
{
_invokeService = invokeService;
}
///
/// 权限列表
///
///
///
[HttpPost]
[Route("GetSysPermissionList")]
public DataResult> GetSysPermissionList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
///
///
///
///
[HttpGet]
[Route("GetPermissionList")]
public DataResult> GetPermissionList()
{
var res = _invokeService.GetPermissionList();
return res;
}
///
/// 获取权限树列表
///
///
[HttpGet]
[Route("GetPermissionTreeList")]
public DataResult> GetPermissionTreeList()
{
var res = _invokeService.GetPermissionTreeList();
return res;
}
///
/// 编辑权限
///
///
///
[HttpPost]
[Route("EditPermission")]
public DataResult EditPermission([FromBody] PermissionReq model)
{
var res = _invokeService.EditPermission(model);
return res;
}
///
/// 获取权限详情
///
///
///
[HttpGet]
[Route("GetPermissionInfo")]
public DataResult GetPermissionInfo([FromQuery] string id)
{
var res = _invokeService.GetPermissionInfo(id);
return res;
}
///
/// 获取权限树
///
///
[HttpGet]
[Route("GetPermissionTree")]
public DataResult> GetPermissionTree()
{
var res = _invokeService.GetPermissionTree();
return res;
}
///
/// 更新角色权限
///
///
///
[HttpPost]
[Route("UpdateRolePermission")]
public DataResult UpdateRolePermission([FromBody] RolePermissionInput model)
{
var res = _invokeService.UpdateRolePermission(model);
return res;
}
///
/// 更新租户权限信息
///
/// 权限id
///
[HttpPost]
[Route("UpdateTenantPermissionInfo")]
public DataResult UpdateTenantPermissionInfo([FromBody] IdModel req)
{
var res = _invokeService.UpdateTenantPermissionInfo(req);
return res;
}
}