许多网站都有从用户到用户发送消息的概念。当你向其他用户发送消息时,该消息将显示在其收件箱中。你可以对该消息作出回应,并在该消息线程中显示为新条目。
你应该能够看到你是否已经阅读了给定的消息,并且已经得到新响应的消息应该能够在最上面。
你如何设计类(或表或什么)来支持这样一个系统?
发布于 2018-06-26 17:01:58
你可能希望扩展欧文的模式,以支持只存储一次消息的大容量消息。
user
id
name
message
id
recipient_id
content_id
date_time_sent
date_time_read
response_to_message_id (refers to the email this one is in response to - threading)
expires
importance
flags (read, read reply, etc)
content
id
message_id
sender_id
title
message
当然,还有很多其他功能可以添加,但是大多数人在想到“电子邮件”时都会想到上面的功能。
发布于 2018-06-26 17:40:17
user
id
name
messages
id
to_user_id
from_user_id
title
date
message_post
id
message_id
user_id
message
date
类将反映这种模式。
https://stackoverflow.com/questions/-100000354
复制相似问题