using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Common.Page;
using GxPress.Entity;
using GxPress.Request.Admin;
using GxPress.Result.Admin;
using SqlKata;
using Datory;

namespace GxPress.Repository.Interface
{
    public interface IAdminRepository : IRepository
    {
        Task<Admin> GetByAccountAsync(string account);

        Task<bool> ExistsAsync(string account);

        Task<Admin> GetAsync(int id);

        Task<int> InsertAsync(Admin admin);

        Task<bool> UpdateAsync(Admin admin);

        Task<IEnumerable<Admin>> GetPageListAsync(int page, int perPage);

        Task<int> GetCountAsync();

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<AdminSignInResult> SignInAsync(AdminSignInRequest request);

        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<int> SignUpAsync(AdminSignUpRequest request);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(int id);

        /// <summary>
        /// 分页列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<PagedList<AdminPageResult>> GetPagedList(AdminPageSearchRequest request);

        /// <summary>
        /// 获取详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<AdminDetailResult> GetDetailAsync(int id);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="id"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> UpdateAsync(int id, Admin request);

        Task<bool> UpdateQAsync(Admin request);
        /// <summary>
        /// 修改管理员密码
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> UpdatePassWord(AdminUpdatePassWordRequest request);

        Task<bool> AdminUpdatePassWord(AdminUpdatePassWordRequest request);
    }
}