using ClockSnowFlake; using dy.net.model.dto; using dy.net.model.entity; using dy.net.model.response; using dy.net.repository; using SqlSugar; using System.Linq.Expressions; namespace dy.net.service { public class DouyinCollectCateService { private readonly DouyinCollectCateRepository _douyinCollectCateRepository; public DouyinCollectCateService(DouyinCollectCateRepository douyinCollectCateRepository) { _douyinCollectCateRepository = douyinCollectCateRepository; } public async Task AddAsync(DouyinCollectCate cate) { return await _douyinCollectCateRepository.InsertAsync(cate); } /// /// /// /// /// public async Task<(List list, int totalCount)> GetPagedAsync(DouyinCollectCateRequestDto dto) { return await _douyinCollectCateRepository.GetPagedAsync(dto); } /// /// /// /// /// /// /// public async Task<(int add, int update,int delete, bool succ)> Sync(List cates, string ckId,VideoTypeEnum cateType) { return await _douyinCollectCateRepository.Sync(cates, ckId, cateType); } /// /// 打开或关闭同步 /// /// /// public async Task BatchSwitchSync(List dto) { return await _douyinCollectCateRepository.SwitchBatchAsync(dto); } /// /// 获取需要同步的合集、短剧、收藏夹 /// /// public async Task> GetSyncCates(string cookieId, VideoTypeEnum cateType) { return await _douyinCollectCateRepository.GetListAsync(x => x.CookieId == cookieId && x.CateType == cateType && x.Sync && x.Total > 0); } /// /// 完结 /// /// /// public async Task UpdateCate2EndStatus(DouyinCollectCate cate) { return await _douyinCollectCateRepository.UpdateCateEndStatus(cate); } } }