add db models, refactor json models, add references in migrations
This commit is contained in:
132
internal/foundry/models/json/template.go
Normal file
132
internal/foundry/models/json/template.go
Normal file
@@ -0,0 +1,132 @@
|
||||
package json
|
||||
|
||||
import "time"
|
||||
|
||||
type DataTemplate struct {
|
||||
Id string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Authors []DataAuthor `json:"authors,omitempty"`
|
||||
Url string `json:"url,omitempty"`
|
||||
Flags Flags `json:"flags,omitempty"`
|
||||
License string `json:"license,omitempty"`
|
||||
Readme string `json:"readme,omitempty"`
|
||||
Bugs string `json:"bugs,omitempty"`
|
||||
Changelog string `json:"changelog,omitempty"`
|
||||
Media []DataMedia `json:"media,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Compatibility Compatibility `json:"compatibility,omitempty"`
|
||||
Scripts []string `json:"scripts"`
|
||||
Esmodules []string `json:"esmodules"`
|
||||
Styles []struct {
|
||||
Src string `json:"src,omitempty"`
|
||||
} `json:"styles,omitempty"`
|
||||
Languages []DataLanguage `json:"languages,omitempty"`
|
||||
Packs []DataPack `json:"packs,omitempty"`
|
||||
PackFolder []DataPackFolder `json:"packFolder,omitempty"`
|
||||
Relationships Relationship `json:"relationships,omitempty"`
|
||||
Socket bool `json:"socket,omitempty"`
|
||||
Manifest string `json:"manifest,omitempty"`
|
||||
Download string `json:"download,omitempty"`
|
||||
Protected bool `json:"protected,omitempty"`
|
||||
Exclusive bool `json:"exclusive,omitempty"`
|
||||
PersistentStorage bool `json:"persistentStorage,omitempty"`
|
||||
Availability int `json:"availability,omitempty"`
|
||||
Locked bool `json:"locked,omitempty"`
|
||||
Owned bool `json:"owned,omitempty"`
|
||||
HasStorage bool `json:"hasStorage,omitempty"`
|
||||
|
||||
//module
|
||||
CoreTranslation bool `json:"coreTranslation,omitempty"`
|
||||
Library bool `json:"library,omitempty"`
|
||||
|
||||
//system
|
||||
Background string `json:"background,omitempty"`
|
||||
Grid DataGrid `json:"grid,omitempty"`
|
||||
PrimaryTokenAttribute string `json:"primaryTokenAttribute,omitempty"`
|
||||
|
||||
//world
|
||||
System string `json:"system,omitempty"`
|
||||
JoinTheme string `json:"joinTheme,omitempty"`
|
||||
CoreVersion string `json:"coreVersion,omitempty"`
|
||||
SystemVersion string `json:"systemVersion,omitempty"`
|
||||
LastPlayed string `json:"lastPlayed,omitempty"`
|
||||
PlayTime int64 `json:"playTime,omitempty"`
|
||||
NextSession time.Time `json:"nextSession,omitempty"`
|
||||
}
|
||||
|
||||
type DataAuthor struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Url string `json:"url,omitempty"`
|
||||
Discord string `json:"discord,omitempty"`
|
||||
flags struct{} `json:"-"`
|
||||
}
|
||||
|
||||
type DataMedia struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
Url string `json:"url,omitempty"`
|
||||
Loop bool `json:"loop,omitempty"`
|
||||
flags struct{} `json:"-"`
|
||||
}
|
||||
|
||||
type DataLanguage struct {
|
||||
Lang string `json:"lang,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
Flags struct{} `json:"-"`
|
||||
}
|
||||
|
||||
type DataPack struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Label string `json:"label,omitempty"`
|
||||
Banner string `json:"banner,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
System string `json:"system,omitempty"`
|
||||
Ownership map[string]string `json:"ownership,omitempty"`
|
||||
flags struct{} `json:"-"`
|
||||
}
|
||||
|
||||
type DataPackFolder struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Sorting string `json:"sorting,omitempty"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Packs []string `json:"packs,omitempty"`
|
||||
Folders []DataPackFolder `json:"folders,omitempty"`
|
||||
}
|
||||
|
||||
type DataGrid struct {
|
||||
Type int `json:"type,omitempty"`
|
||||
Distance int `json:"distance,omitempty"`
|
||||
Units string `json:"units,omitempty"`
|
||||
Diagonals int `json:"diagonals,omitempty"`
|
||||
}
|
||||
|
||||
type Compatibility struct {
|
||||
Minimum string `json:"minimum,omitempty"`
|
||||
Verified string `json:"verified,omitempty"`
|
||||
Maximum string `json:"maximum,omitempty"`
|
||||
}
|
||||
|
||||
type Flags struct {
|
||||
HotReload FlagsHotReload `json:"hotReload"`
|
||||
Styles []string `json:"styles"`
|
||||
}
|
||||
|
||||
type FlagsHotReload struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Extensions []string `json:"extensions"`
|
||||
Paths []string `json:"paths"`
|
||||
}
|
||||
|
||||
type Relationship struct {
|
||||
systems []struct{} `json:"-"`
|
||||
requires []struct{} `json:"-"`
|
||||
Recommends []struct {
|
||||
Id string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
compatibility struct{} `json:"-"`
|
||||
} `json:"recommends"`
|
||||
conflicts []struct{} `json:"-"`
|
||||
flags struct{} `json:"-"`
|
||||
}
|
||||
Reference in New Issue
Block a user