diff --git a/backend/IM_API/Dtos/ClearConversationsDto.cs b/backend/IM_API/Dtos/ClearConversationsDto.cs new file mode 100644 index 0000000..0d8c5c9 --- /dev/null +++ b/backend/IM_API/Dtos/ClearConversationsDto.cs @@ -0,0 +1,26 @@ +namespace IM_API.Dtos +{ + public class ClearConversationsDto + { + public int UserId { get; set; } + /// + /// 聊天类型 + /// + public ChatType ChatType { get; set; } + /// + /// 目标ID,聊天类型为群则为群id,私聊为用户id + /// + public int TargetId { get; set; } + } + public enum ChatType + { + /// + /// 私聊 + /// + single = 0, + /// + /// 私聊 + /// + group = 1 + } +} diff --git a/backend/IM_API/Interface/Services/IConversationService.cs b/backend/IM_API/Interface/Services/IConversationService.cs new file mode 100644 index 0000000..9c4bf63 --- /dev/null +++ b/backend/IM_API/Interface/Services/IConversationService.cs @@ -0,0 +1,21 @@ +using IM_API.Dtos; +using IM_API.Models; + +namespace IM_API.Interface.Services +{ + public interface IConversationService + { + /// + /// 清除消息会话 + /// + /// + /// + Task ClearConversationsAsync(ClearConversationsDto clearConversationsDto); + /// + /// 获取用户当前消息会话 + /// + /// 用户id + /// + Task GetConversationsAsync(int userId); + } +}