feat(P3): 私信 + #话题标签 + @提及 完成

This commit is contained in:
Sisyphus
2026-04-25 20:10:50 +08:00
parent 41454de49f
commit 18245c06bf
10 changed files with 438 additions and 185 deletions

View File

@@ -0,0 +1,25 @@
package message
import "time"
type Message struct {
ID uint `gorm:"primaryKey" json:"id"`
FromID uint `gorm:"index:idx_message_from;not null" json:"from_id"`
ToID uint `gorm:"index:idx_message_to;not null" json:"to_id"`
Content string `gorm:"type:text;not null" json:"content"`
IsRead bool `gorm:"default:false" json:"is_read"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
}
type SendRequest struct {
ToID uint `json:"to_id"`
Content string `json:"content"`
}
type ListRequest struct {
PeerID uint `json:"peer_id"`
}
type ListResponse struct {
Messages []Message `json:"messages"`
}