Add models
This commit is contained in:
parent
55b1508fd7
commit
d76ab85396
|
|
@ -0,0 +1,9 @@
|
|||
package model
|
||||
|
||||
type Message struct {
|
||||
ID uint `gorm:"primary_key" gorm:"AUTO_INCREMENT;primary_key;index"`
|
||||
TokenID string
|
||||
Message string
|
||||
Title string
|
||||
Priority int
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package model
|
||||
|
||||
type Token struct {
|
||||
Name string
|
||||
DefaultTitle string
|
||||
Description string
|
||||
Icon string
|
||||
WriteOnly bool
|
||||
UserID uint `gorm:"index"`
|
||||
Id string `gorm:"primary_key;unique_index"`
|
||||
Messages []Message
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package model
|
||||
|
||||
type User struct {
|
||||
ID uint `gorm:"primary_key;unique_index" gorm:"AUTO_INCREMENT"`
|
||||
Name string
|
||||
Pass []byte
|
||||
Admin bool
|
||||
Tokens []Token
|
||||
}
|
||||
Loading…
Reference in New Issue