You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
3.0 KiB
C#

using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Mvc;
10 months ago
using SqlSugar;
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);
}
10 months ago
/// <summary>
/// 获取租户表差异
/// </summary>
/// <param name="id">租户Id</param>
/// <returns></returns>
[HttpGet]
9 months ago
[Obsolete]
10 months ago
[Route("GetSaasTableDifference")]
public DataResult<List<TableDifferenceInfo>> GetSaasTableDifference([FromQuery] string id)
10 months ago
{
var res = _invokeService.GetSaasTableDifference(id);
return res;
}
/// <summary>
/// 更新租户表差异
/// </summary>
/// <param name="req">主键id</param>
/// <returns></returns>
[HttpPost]
9 months ago
[Obsolete]
10 months ago
[Route("UpdateSaasTableInfo")]
public DataResult UpdateSaasTableInfo([FromBody] IdModel req)
{
return _invokeService.UpdateSaasTableInfo(req);
}
}