add(IConversationService):添加会话服务接口
This commit is contained in:
parent
e9feb6e036
commit
45dc14d77b
26
backend/IM_API/Dtos/ClearConversationsDto.cs
Normal file
26
backend/IM_API/Dtos/ClearConversationsDto.cs
Normal 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
|
||||
}
|
||||
}
|
||||
21
backend/IM_API/Interface/Services/IConversationService.cs
Normal file
21
backend/IM_API/Interface/Services/IConversationService.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user