fix 获取餐别增加基地信息
This commit is contained in:
@@ -39,4 +39,16 @@ public class TenantsController : ControllerBase
|
||||
{
|
||||
return await _tenantService.GetListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取租户
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet("single")]
|
||||
public async Task<TenantResponse> GetTenantByCode(string code)
|
||||
{
|
||||
return await _tenantService.GetTenantByCode(code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,4 +9,6 @@ public interface ITenantService : IScopeDependency
|
||||
Task<Pagination<TenantResponse>> GetPageAsync(TenantPageRequest request);
|
||||
|
||||
Task<List<TenantResponse>> GetListAsync();
|
||||
|
||||
Task<TenantResponse> GetTenantByCode(string code);
|
||||
}
|
||||
|
||||
@@ -31,4 +31,12 @@ public class TenantService : ITenantService
|
||||
.Select<TenantResponse>()
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<TenantResponse> GetTenantByCode(string code)
|
||||
{
|
||||
return await _dbContext.Queryable<TenantEntity>()
|
||||
.Where(x => x.Code == code)
|
||||
.Select<TenantResponse>()
|
||||
.FirstAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user