using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Common.Page;
using GxPress.Request.App.Topic;
using GxPress.Result.App.Topic;
using Datory;
using GxPress.Result.Job;

namespace GxPress.Repository.Interface
{
    public interface ITopicRepository : IRepository
    {

        /// <summary>
        /// 通知查询
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<PagedList<Entity.Topic.Topic>> GetTopicByUserIdAsync(TopicPageSearchRequest request);

        /// <summary>
        /// 根据GroupId获取通知
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<PagedList<TopicListPageResult>> FindTopicByGroupIdAsync(TopicDetailListRequest request);

        Task<int> GetGroupTopicCountAsync(int groupId);

        /// <summary>
        /// 根据ID获取话题
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Entity.Topic.Topic> GetAsync(int id);

        Task<int> CountAsync(SqlKata.Query query);

        Task<IEnumerable<Entity.Topic.Topic>> GetAllAsync(SqlKata.Query query);

        Task<int> InsertAsync(Entity.Topic.Topic topic);

        Task<bool> DeleteAsync(int id);

        Task<bool> UpdateAsync(Entity.Topic.Topic topic);
         /// <summary>
        /// 执行话题
        /// </summary>
        /// <returns></returns>
        Task<List<JobTopicResult>> ExecuteTopic();

        Task<PagedList<TopicListPageResult>> GetTopicPage(TopicPageSearchRequest request);
    }
}
