add db models, refactor json models, add references in migrations
This commit is contained in:
45
internal/foundry/models/json/users.go
Normal file
45
internal/foundry/models/json/users.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package json
|
||||
|
||||
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/models/json/modules"
|
||||
|
||||
type User struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Role int `json:"role,omitempty"`
|
||||
Id string `json:"_id,omitempty"`
|
||||
avatar struct{} `json:"-"`
|
||||
Character string `json:"character,omitempty"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Pronouns string `json:"pronouns,omitempty"`
|
||||
Hotbar map[string]string `json:"hotbar,omitempty"`
|
||||
permissions struct{} `json:"-"`
|
||||
Flags UserFlags `json:"flags,omitempty"`
|
||||
Stats UserStats `json:"_stats,omitempty"`
|
||||
}
|
||||
|
||||
type UserFlags struct {
|
||||
World map[string]bool `json:"world,omitempty"`
|
||||
Pf2e modules.Pf2eModule `json:"pf2e,omitempty"`
|
||||
DiceStats modules.DiceStats `json:"diceStats,omitempty"`
|
||||
}
|
||||
|
||||
type UserStats struct {
|
||||
compendiumSource struct{} `json:"-"`
|
||||
duplicateSource struct{} `json:"-"`
|
||||
exportSource struct{} `json:"-"`
|
||||
CoreVersion string `json:"coreVersion,omitempty"`
|
||||
SystemId string `json:"systemId,omitempty"`
|
||||
SystemVersion string `json:"systemVersion,omitempty"`
|
||||
CreatedTime int64 `json:"createdTime,omitempty"`
|
||||
ModifiedTime int64 `json:"modifiedTime,omitempty"`
|
||||
LastModifiedBy string `json:"lastModifiedBy,omitempty"`
|
||||
}
|
||||
|
||||
type Users []User
|
||||
|
||||
func (users Users) GetById(id int) *User {
|
||||
return &users[id]
|
||||
}
|
||||
|
||||
func (state *FoundryState) GetUsers() *Users {
|
||||
return &state.Users
|
||||
}
|
||||
Reference in New Issue
Block a user