feat: keep compatible with ServerChan (close #63)

This commit is contained in:
JustSong
2023-05-06 12:06:53 +08:00
parent 581d9d62dc
commit 39da3f9771
2 changed files with 24 additions and 13 deletions
+3 -1
View File
@@ -11,7 +11,6 @@ type Message struct {
UserId int `json:"user_id" gorm:"index"`
Title string `json:"title"`
Description string `json:"description"`
Desp string `json:"desp" gorm:"-:all"` // alias for description
Content string `json:"content"`
URL string `json:"url" gorm:"column:url"`
Channel string `json:"channel"`
@@ -21,6 +20,9 @@ type Message struct {
Link string `json:"link" gorm:"unique;index"`
To string `json:"to" gorm:"column:to"` // if specified, will send to this user(s)
Status int `json:"status" gorm:"default:0"` // pending, sent, failed
OpenId string `json:"openid" gorm:"-:all"` // alias for to
Desp string `json:"desp" gorm:"-:all"` // alias for content
Short string `json:"short" gorm:"-:all"` // alias for description
}
func GetMessageById(id int, userId int) (*Message, error) {