TenantBusinessService.cs 966 B

12345678910111213141516171819202122232425262728293031323334
  1. namespace Admin.NET.Application.Service;
  2. /// <summary>
  3. /// 租户业务服务
  4. /// </summary>
  5. [ApiDescriptionSettings("租户业务服务", Order = 200)]
  6. public class TenantBusinessService : IDynamicApiController, ITransient
  7. {
  8. private readonly SqlSugarRepository<TenantBusiness> _tenantBusinessRep;
  9. public TenantBusinessService(SqlSugarRepository<TenantBusiness> businessRep)
  10. {
  11. _tenantBusinessRep = businessRep;
  12. }
  13. /// <summary>
  14. /// 增加租户业务数据
  15. /// </summary>
  16. /// <returns></returns>
  17. public async Task<bool> AddBusiness()
  18. {
  19. var tenantBusiness = new TenantBusiness() { Name = "zuohuaijun" };
  20. return await _tenantBusinessRep.InsertAsync(tenantBusiness);
  21. }
  22. /// <summary>
  23. /// 查询租户业务数据
  24. /// </summary>
  25. /// <returns></returns>
  26. public async Task<List<TenantBusiness>> GetBusinessList()
  27. {
  28. return await _tenantBusinessRep.GetListAsync();
  29. }
  30. }