init(backend/models): add objects models
This commit is contained in:
parent
b1587f05cc
commit
d543101054
59
backend/models/objects.go
Normal file
59
backend/models/objects.go
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
type User struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
IsAdmin bool `json:"is_admin"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MIME struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Extension string `json:"extension"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Category struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Color string `json:"color"`
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
Creator User `json:"creator"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type File struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
MIME MIME `json:"mime"`
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
Creator User `json:"creator"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Tag struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Color string `json:"color"`
|
||||||
|
Category Category `json:"category"`
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
Creator User `json:"creator"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Autotag struct {
|
||||||
|
TriggerTag Tag `json:"trigger_tag"`
|
||||||
|
AddTag Tag `json:"add_tag"`
|
||||||
|
IsActive bool `json:"is_active"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Pool struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
Creator User `json:"creator"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Session struct {
|
||||||
|
ID int `json:"id"`
|
||||||
|
UserAgent string `json:"user_agent"`
|
||||||
|
StartedAt time.Time `json:"started_at"`
|
||||||
|
ExpiresAt time.Time `json:"expires_at"`
|
||||||
|
LastActivity time.Time `json:"last_activity"`
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user