72 lines
1.6 KiB
Go
72 lines
1.6 KiB
Go
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"`
|
|
}
|
|
|
|
type Pagination struct {
|
|
Total int `json:"total"`
|
|
Offset int `json:"offset"`
|
|
Limit int `json:"limit"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type Slice[T any] struct {
|
|
Pagination Pagination `json:"pagination"`
|
|
Data []T `json:"data"`
|
|
}
|