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<(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)
{
return await douyinCollectCateRepository.Sync(cates, ckId);
}
///
/// 打开或关闭同步
///
///
///
public async Task BatchSwitchSync(List dto)
{
return await douyinCollectCateRepository.SwitchBatchAsync(dto);
}
///
/// 获取需要同步的合集、短剧、收藏夹
///
///
public async Task> GetSyncCates(string cookieId,int cateType)
{
return await douyinCollectCateRepository.GetListAsync(x => x.CookieId == cookieId && x.CateType == cateType);
}
}
}