using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using YuanXuan.IM.Common.Entities; using YuanXuan.IM.Common.Request; namespace YuanXuan.IM.Core.Interfaces { public interface IBaseService where TEntity : BaseEntity, new() { Task CreateAsync(TEntity entity); Task CreateAsync(List entity); Task InsertReturnBigIdentityAsync(TEntity entity); Task CreateReturnSnowflakeIdAsync(TEntity entity); Task> CreateReturnSnowflakeIdAsync(List entity); Task DeleteByIdsAsync(params dynamic[] ids); Task DeleteByIdsAsync(params long[] ids); Task GetByIdAsync(long id); Task GetFirstAsync(System.Linq.Expressions.Expression> whereExpression); Task> GetListAsync(System.Linq.Expressions.Expression> whereExpression = null); Task> GetPageListAsync(PageRequest pagination, Expression> whereExpression = null); Task> GetPageListAsync(PageRequest pagination, Expression> whereExpression, Expression> orderByExpression = null, OrderByType orderByType = OrderByType.Asc); Task> GetPageListAsync(PageRequest pagination, Expression> whereExpression = null); Task GetSingleAsync(System.Linq.Expressions.Expression> whereExpression); Task UpdateAsync(TEntity entity); Task UpdateAsync(List entity); Task UpdateColumsAsync(Expression> columns, Expression> whereExpression); Task AnyAsync(Expression> whereExpression); } }