add(IConversationService):添加会话服务接口

This commit is contained in:
西街长安 2025-11-04 16:17:23 +08:00
parent e9feb6e036
commit 45dc14d77b
2 changed files with 47 additions and 0 deletions

View File

@ -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
}
}

View File

@ -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);
}
}