using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using GxPress.Common.Page;
using GxPress.Request.App.Group;
using GxPress.Result.App.Group;
using GxPress.Result.App.GroupUser;
using Datory;
using GxPress.Entity;
using GxPress.Request.App.Topic;
using GxPress.Result.Job;

namespace GxPress.Repository.Interface
{
    public interface IGroupRepository : IRepository
    {
        Task<int> InsertAsync(GroupInRequest request);
        Task<bool> UpdateAsync(GroupUpRequest request);
        Task<bool> DeleteAsync(int id);
        Task<bool> DeleteAsync(SqlKata.Query query);
        Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request);

        Task<GroupDetailResult> GroupDetailAsync(GroupDetailRequest request);

        /// <summary>
        /// 获取用户未读取话题数量
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="groupId"></param>
        /// <returns></returns>
        Task<int> GetUReadCountAsync(int userId, int groupId);

        /// <summary>
        /// 获取小组的共享话题数量
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        Task<int> SharingCountAsync(int groupId);


        Task<Entity.Group> GetAsync(int id);

        /// <summary>
        /// 是否免打扰
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>

        Task<bool> SetGroupIsAdminAsync(int groupId);



        /// <summary>
        /// 是否禁言
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
       Task<bool> SetGroupIsWordsAsync(int groupId);

        /// <summary>
        /// 获取小组详情
        /// </summary>
        /// <param name="guId"></param>
        /// <returns></returns>
        Task<GroupDetailResult> GroupDetailByGuIdAsync(string guId,int userId);


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


        /// <summary>
        /// 搜索小组成员
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<IEnumerable<GroupUserListResult>> SearchGroupUserAsync(TopicDetailListRequest request);

        Task<List<JobGroupResult>> ElasticSearchGroup();
    }
}
