Joke Collection Website - Talk about mood - How to imitate the private message function of CSDN space with JavaWeb?

How to imitate the private message function of CSDN space with JavaWeb?

To put it bluntly, it is to establish a correct table in the database.

The attributes of the information in this table

Id, sender, recipient, title, content, sending time, whether it has been read.

Then just operate the database. It's like making a website.

Message reminder If this is a real-time reminder, you can visit the database every once in a while to see if there are unread emails under this account.

If it is not a real-time reminder, just check the database once when the user logs in.

To put it better, inbox and outbox are both searching the database, but one condition is the recipient and the other condition is the sender.