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; /// /// 用户租户 /// [Authorize(Roles = "admin")] [Route("api/[controller]")] [ApiController] public class UserTenantsController : ControllerBase { private readonly IUserTenantService _userTenantService; public UserTenantsController(IUserTenantService userTenantService) { _userTenantService = userTenantService; } /// /// 获取用户的基地配置 /// /// /// [HttpGet] public async Task> GetUserTenantsByIdAsync(int userId) { return await _userTenantService.GetUserTenantsByIdAsync(userId); } /// /// 保存 /// /// [HttpPost("save")] public async Task SaveUserTenantsAsync(UserTenantSaveRequest request) { await _userTenantService.SaveUserTenantsAsync(request); } }