using Hotline.Orders; using Hotline.Repository.SqlSugar.DataPermissions; using Hotline.Snapshot; using Hotline.Snapshot.Interfaces; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using XF.Domain.Dependency; namespace Hotline.Repository.SqlSugar.Snapshot; public class IndustryRepository : BaseRepository, IIndustryRepository, IScopeDependency { public IndustryRepository(ISugarUnitOfWork uow, IDataPermissionFilterBuilder dataPermissionFilterBuilder, IServiceProvider serviceProvider) : base(uow, dataPermissionFilterBuilder, serviceProvider) { } public async Task> GetDataBaseAsync() { var result = await Queryable() .Select(m => new { m.Id, m.Name }) .ToListAsync(); return result.Cast().ToList(); } public async Task GetIntervalTimeAsync(string industryId, double defaultValue, CancellationToken cancellationToken) { var time = await Queryable().Where(m => m.Id == industryId).Select(m => m.IntervalTime).FirstAsync(cancellationToken); if (time <= 0) return defaultValue; return time; } }