init(backend): add models
This commit is contained in:
parent
3e5bff2cb5
commit
b8c3ed8e0f
29
backend/models/models.go
Normal file
29
backend/models/models.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Role string
|
||||||
|
|
||||||
|
const (
|
||||||
|
Admin Role = "admin"
|
||||||
|
Editor Role = "editor"
|
||||||
|
Viewer Role = "viewer"
|
||||||
|
)
|
||||||
|
|
||||||
|
type User struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Login string `json:"login"`
|
||||||
|
Role Role `json:"role"`
|
||||||
|
TelegramID int64 `json:"telegram_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Quote struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Text string `json:"text"`
|
||||||
|
Author string `json:"author"`
|
||||||
|
Datetime time.Time `json:"datetime"`
|
||||||
|
Creator User `json:"creator"`
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user