实施通知系统

发布于 2025-01-03 13:16:31 字数 232 浏览 0 评论 0原文

http://pastebin.com/Fja8S7nm

在我的项目中,用户可以发布他们的消息,其他人可以添加评论)到他们的帖子。我只是想让他们收到有关此类事件的通知,这样他们就不需要检查他们的每一篇帖子和之前的评论来看看是否有新内容。

很抱歉这个通用问题,但我只想知道“如何为此目的实施适当的方法?”

http://pastebin.com/Fja8S7nm

In my project, users can post their messages and others can add comment(s) to their posts. I just want them to be notified on such events, so that there is no need for them to check each one of their posts and previous comments to see if there is something new.

Sorry for this generic question but I just want to know "how to implement an appropriate approach for this purpose?"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

厌倦 2025-01-10 13:16:31

创建另一个名为“Notifcations”的表,其中包含用户 ID 和要向用户显示的文本。您可能还想添加通知的链接。

当用户对帖子发表评论时,只需弄清楚应该通知哪些用户并将他们的消息放入“通知”表中即可。

注意:不要忘记清理您的通知表,因为它可能会增长得非常快,而且您实际上并不希望在很长一段时间内存档它(从我的角度来看)。

Create another table called Notifcations, with a user ID and the text to show to the user. You might also want to add a link to the notification.

When a user comments on a post, just figure out what users should be notified and put their messages in the Notifications table.

Note: don't forget to clean up your Notifications table, as it might grow pretty quick and it's not really something you would like to archive over a very long period (from my point of view).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文