fix 获取餐别增加基地信息

This commit is contained in:
2024-01-10 17:11:36 +08:00
parent 5915264df9
commit c9c2de80b7
6 changed files with 47 additions and 1 deletions

View File

@@ -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);
}
}

View File

@@ -9,4 +9,6 @@ public interface ITenantService : IScopeDependency
Task<Pagination<TenantResponse>> GetPageAsync(TenantPageRequest request);
Task<List<TenantResponse>> GetListAsync();
Task<TenantResponse> GetTenantByCode(string code);
}

View File

@@ -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();
}
}