using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using GxPress.Entity;
using GxPress.Request.App.IM;
using GxPress.Request.GroupChat;
using Datory;
using GxPress.Result.App.GroupChat;

namespace GxPress.Repository.Interface
{
    /// <summary>
    /// 
    /// </summary>
   public interface IGroupChatRepository:IRepository
   {
       /// <summary>
       /// 添加
       /// </summary>
       /// <param name="request"></param>
       /// <returns></returns>
       Task<bool> InsertAsync(GroupChatInRequest request);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
       Task<bool> UpdateAsync(GroupChatUpRequest request);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(int id);
        /// <summary>
        /// 根据UserId查询群
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<IEnumerable<GroupChat>> GetGroupChatByUserIdAsync(GroupChatSearchRequest request);
        /// <summary>
        /// 是否管理员同意
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> UpIsAdminAsync(GroupChatUpIsAdminRequest request);
        /// <summary>
        /// 是否禁言
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> UpIsWordsAsync(GroupChatUpIsWordsRequest request);

        Task<GroupChat> FindGroupChatByIdAsync(int id);

        Task<GroupChat> GetAsync(int id);

        Task<GroupChat> GetGroupChatByImIdAsync(string imId);

        Task<bool> InsertUsersIntoGroupChatAsync(InsertGroupChatUsersRequest request);
        Task<bool> DeleteUsersIntoGroupChatAsync(InsertGroupChatUsersRequest request);

        Task<IEnumerable<GroupChat>> GetAllGroupChatAsync();

        Task<GroupChat> GetGroupChatByGuidAsync(string guid);

        /// <summary>
        /// set群是否开启
        /// </summary>
        /// <param name="groupChatImId"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<bool> SetIsOpenQrCoderAsync(string groupChatImId, int userId);

        Task<GroupChat> GetAsync(SqlKata.Query query);
         /// <summary>
        /// 根据ImId获取群信息
        /// </summary>
        /// <param name="imId"></param>
        /// <returns></returns>
         Task<GroupChatInfoResult> GetGroupChatInfoByImIdAsync(string imId);
   }
}
