获取租户下的所有用户

booking_auth_dev
wet 2 years ago
parent 56bb38cab8
commit b72ea8f6d3

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Myshipping.Core.Entity;
using System.Collections.Generic;
using System.Threading.Tasks;
@ -30,4 +31,5 @@ public interface ISysUserService
Task<List<long>> GetDataScopeIdUserList(long userId = 0);
void CheckDataScopeByUserId(long userId);
void CheckDataScope(long orgId);
Task<List<SysUser>> GetTenantUser(string name);
}

@ -536,4 +536,14 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
throw Oops.Oh(ErrorCode.D1013);
}
}
/// <summary>
/// 获取租户下的用户
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
[HttpGet("/sysUser/GetTenantUser")]
public Task<List<SysUser>> GetTenantUser(string name)
{
return _sysUserRep.AsQueryable().Where(x => x.TenantId == Convert.ToInt64(UserManager.TENANT_ID)).WhereIF(!string.IsNullOrWhiteSpace(name), x => x.Name.Contains(name)).ToListAsync();
}
}

Loading…
Cancel
Save