|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 权限模块
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class PermissionController : ApiController
|
|
|
|
|
{
|
|
|
|
|
private readonly IPermissionService _invokeService;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构造函数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="invokeService"></param>
|
|
|
|
|
public PermissionController(IPermissionService invokeService)
|
|
|
|
|
{
|
|
|
|
|
_invokeService = invokeService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 权限列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("GetSysPermissionList")]
|
|
|
|
|
public DataResult<List<SysPermission>> GetSysPermissionList([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetListByPage(request);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetPermissionList")]
|
|
|
|
|
public DataResult<List<SysPermission>> GetPermissionList()
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetPermissionList();
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取权限树列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetPermissionTreeList")]
|
|
|
|
|
public DataResult<List<PermissionTreeList>> GetPermissionTreeList()
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetPermissionTreeList();
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 编辑权限
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("EditPermission")]
|
|
|
|
|
public DataResult EditPermission([FromBody] PermissionReq model)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.EditPermission(model);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取权限详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetPermissionInfo")]
|
|
|
|
|
public DataResult<SysPermission> GetPermissionInfo([FromQuery] string id)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetPermissionInfo(id);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取权限树
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetPermissionTree")]
|
|
|
|
|
public DataResult<List<PermissionTreeViewModel>> GetPermissionTree()
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetPermissionTree();
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新角色权限
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("UpdateRolePermission")]
|
|
|
|
|
public DataResult UpdateRolePermission([FromBody] RolePermissionInput model)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.UpdateRolePermission(model);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新租户权限信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="req">权限id</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("UpdateTenantPermissionInfo")]
|
|
|
|
|
public DataResult UpdateTenantPermissionInfo([FromBody] IdModel req)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.UpdateTenantPermissionInfo(req);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
}
|