|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.WMS.Core.System.Dtos;
|
|
|
|
|
using DS.WMS.Core.System.Interface;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.AdminApi.Controllers;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 企业用户管理模块
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class TenantController : ApiController
|
|
|
|
|
{
|
|
|
|
|
private readonly ITenantService _invokeService;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构造函数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="invokeService"></param>
|
|
|
|
|
public TenantController(ITenantService invokeService)
|
|
|
|
|
{
|
|
|
|
|
_invokeService = invokeService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 企业用户列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("GetTenantList")]
|
|
|
|
|
public DataResult<List<TenantRes>> GetTenantList([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetListByPage(request);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取企业用户信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetTenantInfo")]
|
|
|
|
|
public DataResult<TenantRes> GetTenantInfo([FromQuery] string id)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetTenantInfo(id);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取租户权限
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">租户Id</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetTenantPermission")]
|
|
|
|
|
public DataResult<long[]> GetTenantPermission([FromQuery] string id)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetTenantPermission(id);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取租户权限授权数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">租户Id</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetPermissionAuthList")]
|
|
|
|
|
public DataResult<List<PermissionAuth>> GetPermissionAuthList([FromQuery] string id)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetPermissionAuthList(id);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 租户权限模块授权
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="req"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("UpdateTenantPermission")]
|
|
|
|
|
public DataResult UpdateTenantPermission([FromBody] TenantPermissionReq req)
|
|
|
|
|
{
|
|
|
|
|
return _invokeService.UpdateTenantPermission(req);
|
|
|
|
|
}
|
|
|
|
|
}
|