using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Common.Page;
using GxPress.Entity;
using GxPress.Request.Notice;
using GxPress.Result.Notice;
using Datory;
using GxPress.Result.Job;

namespace GxPress.Repository.Interface
{
    public interface INoticeRepository : IRepository
    {
        Task<Notice> GetAsync(SqlKata.Query query);
        Task<Notice> GetAsync(int id);
        Task<int> InsertAsync(NoticeInRequest request);

        /// <summary>
        /// 通知查询
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<PagedList<Notice>> GetNoticeByUserIdAsync(NoticePageSearchRequest request);

        /// <summary>
        /// 管理员删除通知
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> AdminDeleteAsync(int id);

        /// <summary>
        /// 自己删除
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(NoticeDeRequest request);
        Task<bool> DeleteAsync(SqlKata.Query query);


        /// <summary>
        /// 获取通知列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<PagedList<NoticeListPageResult>> GetNoticeListPageAsync(NoticePageSearchRequest request);

        /// <summary>
        /// 恢复删除的通知
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> RecoverDeleteAsync(NoticeDeRequest request);

        /// <summary>
        /// 修改通知
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        Task<bool> UpdateNoticeAsync(Notice notice);

        Task<PagedList<NoticeListPageResult>> GetAdminNoticeByUserIdAsync(NoticePageSearchRequest request);
        Task<IEnumerable<Notice>> GetAllAsync();
        Task<List<JobNoticeResult>> ElasticSearchNotice();
        /// <summary>
        /// 通知修改
        /// </summary>
        /// <param name="id"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> UpdateAsync(SqlKata.Query query);
    }
}
