live-forum/server/webapi/LiveForum/LiveForum.IService/Messages/IMessagePublisher.cs
2026-03-24 11:27:37 +08:00

92 lines
3.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Threading.Tasks;
namespace LiveForum.IService.Messages
{
/// <summary>
/// 消息发布器接口
/// 轻量级门面,只负责发布事件到队列,不查询数据库
/// </summary>
public interface IMessagePublisher
{
/// <summary>
/// 发送系统消息(直接写入数据库,不走队列)
/// </summary>
/// <param name="receiverId">接收者用户ID</param>
/// <param name="title">消息标题</param>
/// <param name="content">消息内容</param>
/// <returns></returns>
Task SendSystemMessageAsync(long receiverId, string title, string content);
/// <summary>
/// 发送回复消息(完整版)
/// </summary>
/// <param name="triggerId">触发者用户ID</param>
/// <param name="receiverId">接收者用户ID</param>
/// <param name="commentId">评论ID</param>
/// <param name="commentContent">评论内容</param>
/// <param name="postId">帖子ID</param>
/// <param name="postTitle">帖子标题</param>
/// <param name="parentCommentId">父评论ID如果是回复评论</param>
/// <param name="myCommentContent">我的评论内容(被回复的内容)</param>
/// <returns></returns>
Task SendReplyMessageAsync(
long triggerId,
long receiverId,
long commentId,
string commentContent,
long postId,
string postTitle,
long? parentCommentId = null,
string myCommentContent = null);
/// <summary>
/// 发送回复消息(简化版)
/// </summary>
/// <param name="triggerId">触发者用户ID</param>
/// <param name="receiverId">接收者用户ID</param>
/// <param name="title">消息标题</param>
/// <param name="content">消息内容</param>
/// <param name="myCommentContent">我的评论内容(可选)</param>
/// <returns></returns>
Task SendReplyMessageSimpleAsync(
long triggerId,
long receiverId,
string title,
string content,
string myCommentContent = null);
/// <summary>
/// 发送点赞消息(完整版)
/// </summary>
/// <param name="triggerId">触发者用户ID</param>
/// <param name="receiverId">接收者用户ID</param>
/// <param name="contentType">内容类型1-帖子2-评论3-送花</param>
/// <param name="contentId">内容ID</param>
/// <param name="postTitle">帖子标题(可选)</param>
/// <param name="commentContent">评论内容(可选)</param>
/// <returns></returns>
Task SendLikeMessageAsync(
long triggerId,
long receiverId,
byte contentType,
long contentId,
string postTitle = null,
string commentContent = null);
/// <summary>
/// 发送点赞消息(简化版)
/// </summary>
/// <param name="triggerId">触发者用户ID</param>
/// <param name="receiverId">接收者用户ID</param>
/// <param name="title">消息标题</param>
/// <param name="content">消息内容</param>
/// <returns></returns>
Task SendLikeMessageSimpleAsync(
long triggerId,
long receiverId,
string title,
string content);
}
}