add(IConversationService):添加会话服务接口
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
namespace IM_API.Dtos
|
||||||
|
{
|
||||||
|
public class ClearConversationsDto
|
||||||
|
{
|
||||||
|
public int UserId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 聊天类型
|
||||||
|
/// </summary>
|
||||||
|
public ChatType ChatType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 目标ID,聊天类型为群则为群id,私聊为用户id
|
||||||
|
/// </summary>
|
||||||
|
public int TargetId { get; set; }
|
||||||
|
}
|
||||||
|
public enum ChatType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 私聊
|
||||||
|
/// </summary>
|
||||||
|
single = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// 私聊
|
||||||
|
/// </summary>
|
||||||
|
group = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using IM_API.Dtos;
|
||||||
|
using IM_API.Models;
|
||||||
|
|
||||||
|
namespace IM_API.Interface.Services
|
||||||
|
{
|
||||||
|
public interface IConversationService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 清除消息会话
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="clearConversationsDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> ClearConversationsAsync(ClearConversationsDto clearConversationsDto);
|
||||||
|
/// <summary>
|
||||||
|
/// 获取用户当前消息会话
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId">用户id</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Conversation> GetConversationsAsync(int userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user