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 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; } }