45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using Dlhis.Sys.Identity.Request;
|
|
using Dlhis.Sys.Identity.Response;
|
|
using Dlhis.Sys.Identity.Services;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Dlhis.Sys.Identity.Controllers;
|
|
|
|
/// <summary>
|
|
/// 用户租户
|
|
/// </summary>
|
|
[Authorize]
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class UserTenantsController : ControllerBase
|
|
{
|
|
private readonly IUserTenantService _userTenantService;
|
|
|
|
public UserTenantsController(IUserTenantService userTenantService)
|
|
{
|
|
_userTenantService = userTenantService;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取用户的基地配置
|
|
/// </summary>
|
|
/// <param name="userId"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public async Task<List<UserTenantResponse>> GetUserTenantsByIdAsync(int userId)
|
|
{
|
|
return await _userTenantService.GetUserTenantsByIdAsync(userId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
[HttpPost("save")]
|
|
public async Task SaveUserTenantsAsync(UserTenantSaveRequest request)
|
|
{
|
|
await _userTenantService.SaveUserTenantsAsync(request);
|
|
}
|
|
} |