2024-12-28 16:30:48 +01:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import "bamort/database"
|
2024-12-21 07:26:27 +01:00
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
|
UserID uint `gorm:"primaryKey"`
|
|
|
|
|
Username string `gorm:"unique"`
|
|
|
|
|
PasswordHash string
|
|
|
|
|
Email string `gorm:"unique"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-28 16:30:48 +01:00
|
|
|
type Char struct {
|
|
|
|
|
ID uint `gorm:"primaryKey" json:"dbid"`
|
|
|
|
|
ImportID string `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Rasse string `json:"rasse"`
|
|
|
|
|
Typ string `json:"typ"`
|
|
|
|
|
Alter int `json:"alter"`
|
|
|
|
|
Anrede string `json:"anrede"`
|
|
|
|
|
Grad int `json:"grad"`
|
|
|
|
|
Groesse int `json:"groesse"`
|
|
|
|
|
Gewicht int `json:"gewicht"`
|
|
|
|
|
Glaube string `json:"glaube"`
|
|
|
|
|
Hand string `json:"hand"`
|
|
|
|
|
Fertigkeiten []Fertigkeit `gorm:"foreignKey:CharacterID" json:"fertigkeiten"`
|
|
|
|
|
Zauber []Zauber `gorm:"foreignKey:CharacterID" json:"zauber"`
|
|
|
|
|
Lp Lp `gorm:"foreignKey:CharacterID" json:"lp"`
|
|
|
|
|
Eigenschaften []Eigenschaft `gorm:"foreignKey:CharacterID" json:"eigenschaften"`
|
|
|
|
|
Merkmale Merkmale `gorm:"foreignKey:CharacterID" json:"merkmale"`
|
|
|
|
|
Bennies Bennies `gorm:"foreignKey:CharacterID" json:"bennies"`
|
|
|
|
|
Gestalt Gestalt `gorm:"foreignKey:CharacterID" json:"gestalt"`
|
|
|
|
|
Ap Ap `gorm:"foreignKey:CharacterID" json:"ap"`
|
|
|
|
|
B B `gorm:"foreignKey:CharacterID" json:"b"`
|
|
|
|
|
Erfahrungsschatz Erfahrungsschatz `gorm:"foreignKey:CharacterID" json:"erfahrungsschatz"`
|
|
|
|
|
Transportmittel []Transportation `gorm:"foreignKey:CharacterID" json:"transportmittel"`
|
|
|
|
|
Ausruestung []Ausruestung `gorm:"foreignKey:CharacterID" json:"ausruestung"`
|
|
|
|
|
Behaeltnisse []Behaeltniss `gorm:"foreignKey:CharacterID" json:"behaeltnisse"`
|
|
|
|
|
Waffen []Waffe `gorm:"foreignKey:CharacterID" json:"waffen"`
|
|
|
|
|
Waffenfertigkeiten []Waffenfertigkeit `gorm:"foreignKey:CharacterID" json:"waffenfertigkeiten"`
|
|
|
|
|
Spezialisierung database.StringArray `gorm:"type:TEXT" json:"spezialisierung"`
|
|
|
|
|
Image string `json:"image,omitempty"`
|
2024-12-21 07:26:27 +01:00
|
|
|
}
|
|
|
|
|
|
2024-12-21 22:06:33 +01:00
|
|
|
type Eigenschaft struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Value int `json:"value"`
|
2024-12-21 07:26:27 +01:00
|
|
|
}
|
|
|
|
|
|
2024-12-21 07:42:20 +01:00
|
|
|
type Ausruestung struct {
|
2024-12-28 06:52:18 +01:00
|
|
|
ID uint `gorm:"primaryKey" json:"dbid"`
|
2024-12-24 23:38:53 +01:00
|
|
|
ImportID string `json:"id"`
|
2024-12-24 19:05:01 +01:00
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Beschreibung string `json:"beschreibung"`
|
|
|
|
|
Anzahl int `json:"anzahl"`
|
|
|
|
|
BeinhaltetIn *string `json:"beinhaltet_in"`
|
|
|
|
|
Bonus int `json:"bonus,omitempty"`
|
|
|
|
|
Gewicht float64 `json:"gewicht"`
|
|
|
|
|
Magisch MagischAusruestung `gorm:"foreignKey:AusruestungID" json:"magisch"`
|
|
|
|
|
Wert float64 `json:"wert"`
|
2024-12-21 22:06:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Fertigkeit struct {
|
2024-12-28 06:52:18 +01:00
|
|
|
ID uint `gorm:"primaryKey" json:"dbid"`
|
2024-12-24 23:38:53 +01:00
|
|
|
ImportID string `json:"id"`
|
2024-12-21 22:06:33 +01:00
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Name string `json:"name"`
|
2024-12-24 07:54:27 +01:00
|
|
|
Beschreibung string `json:"beschreibung"`
|
2024-12-21 22:06:33 +01:00
|
|
|
Fertigkeitswert int `json:"fertigkeitswert"`
|
2024-12-24 07:54:27 +01:00
|
|
|
Bonus int `json:"bonus,omitempty"`
|
|
|
|
|
Pp int `json:"pp,omitempty"`
|
|
|
|
|
Quelle string `json:"quelle"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Zauber struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Beschreibung string `json:"beschreibung"`
|
|
|
|
|
Bonus int `json:"bonus"`
|
|
|
|
|
Quelle string `json:"quelle"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Waffenfertigkeit struct {
|
2024-12-28 06:52:18 +01:00
|
|
|
ID uint `gorm:"primaryKey" json:"dbid"`
|
2024-12-24 23:38:53 +01:00
|
|
|
ImportID string `json:"id"`
|
2024-12-24 07:54:27 +01:00
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Name string `json:"name"`
|
2024-12-21 22:06:33 +01:00
|
|
|
Beschreibung string `json:"beschreibung"`
|
2024-12-24 07:54:27 +01:00
|
|
|
Bonus int `json:"bonus"`
|
|
|
|
|
Fertigkeitswert int `json:"fertigkeitswert"`
|
|
|
|
|
Pp int `json:"pp"`
|
|
|
|
|
Quelle string `json:"quelle"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Waffe struct {
|
2024-12-28 06:52:18 +01:00
|
|
|
ID uint `gorm:"primaryKey" json:"dbid"`
|
2024-12-24 23:38:53 +01:00
|
|
|
ImportID string `json:"id"`
|
2024-12-24 19:05:01 +01:00
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Beschreibung string `json:"beschreibung"`
|
|
|
|
|
Abwb int `json:"abwb"`
|
|
|
|
|
Anb int `json:"anb"`
|
|
|
|
|
Anzahl int `json:"anzahl"`
|
|
|
|
|
BeinhaltetIn *string `json:"beinhaltet_in"`
|
|
|
|
|
Gewicht float64 `json:"gewicht"`
|
|
|
|
|
Magisch MagischWaffe `gorm:"foreignKey:WaffenID" json:"magisch"`
|
|
|
|
|
NameFuerSpezialisierung string `json:"nameFuerSpezialisierung"`
|
|
|
|
|
Schb int `json:"schb"`
|
|
|
|
|
Wert float64 `json:"wert"`
|
2024-12-24 07:54:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Merkmale struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Augenfarbe string `json:"augenfarbe"`
|
|
|
|
|
Haarfarbe string `json:"haarfarbe"`
|
|
|
|
|
Sonstige string `json:"sonstige"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Lp struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Max int `json:"max"`
|
|
|
|
|
Value int `json:"value"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Gestalt struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Breite string `json:"breite"`
|
|
|
|
|
Groesse string `json:"groesse"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Erfahrungsschatz struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Value int `json:"value"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Eigenschaften struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Au int `json:"au"`
|
|
|
|
|
Gs int `json:"gs"`
|
|
|
|
|
Gw int `json:"gw"`
|
|
|
|
|
In int `json:"in"`
|
|
|
|
|
Ko int `json:"ko"`
|
|
|
|
|
Pa int `json:"pa"`
|
|
|
|
|
St int `json:"st"`
|
|
|
|
|
Wk int `json:"wk"`
|
|
|
|
|
Zt int `json:"zt"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Bennies struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Gg int `json:"gg"`
|
|
|
|
|
Gp int `json:"gp"`
|
|
|
|
|
Sg int `json:"sg"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Behaeltniss struct {
|
2024-12-28 06:52:18 +01:00
|
|
|
ID uint `gorm:"primaryKey" json:"dbid"`
|
2024-12-24 23:38:53 +01:00
|
|
|
ImportID string `json:"id"`
|
2024-12-24 19:05:01 +01:00
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Beschreibung string `json:"beschreibung"`
|
|
|
|
|
//BeinhaltetIn any `json:"beinhaltet_in"`
|
|
|
|
|
Gewicht float64 `json:"gewicht"`
|
|
|
|
|
Magisch MagischBehaelter `gorm:"foreignKey:BehaeltnissID" json:"magisch"`
|
2024-12-28 23:28:19 +01:00
|
|
|
Wert float64 `json:"wert"`
|
2024-12-24 19:05:01 +01:00
|
|
|
Tragkraft float64 `json:"tragkraft"`
|
|
|
|
|
Volumen float64 `json:"volumen"`
|
2024-12-24 07:54:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Ap struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Max int `json:"max"`
|
|
|
|
|
Value int `json:"value"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type B struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Max int `json:"max"`
|
|
|
|
|
Value int `json:"value"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-24 19:05:01 +01:00
|
|
|
type Transportation struct {
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
CharacterID uint `gorm:"index" json:"character_id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Beschreibung string `json:"beschreibung"`
|
|
|
|
|
//BeinhaltetIn any `json:"beinhaltet_in"`
|
|
|
|
|
Gewicht int `json:"gewicht"`
|
|
|
|
|
Tragkraft float64 `json:"tragkraft"`
|
|
|
|
|
Wert float64 `json:"wert"`
|
|
|
|
|
Magisch MagischTransport `gorm:"foreignKey:TransportationID" json:"magisch"`
|
|
|
|
|
//Magisch Magisch `gorm:"polymorphic:Item;polymorphicValue:Transportmittel" json:"magisch"`
|
|
|
|
|
}
|
2024-12-24 22:36:03 +01:00
|
|
|
|
2024-12-24 19:05:01 +01:00
|
|
|
type MagischAusruestung struct {
|
|
|
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
|
|
|
//ItemType string `gorm:"index" json:"item_type"` // Type of the referenced item (e.g., "Ausruestung")
|
|
|
|
|
//ItemID uint `gorm:"index" json:"item_id"` // ID of the referenced item
|
|
|
|
|
AusruestungID int `gorm:"index" json:"ausruestung_id"`
|
|
|
|
|
Abw int `json:"abw"`
|
|
|
|
|
Ausgebrannt bool `json:"ausgebrannt"`
|
|
|
|
|
IstMagisch bool `json:"ist_magisch"`
|
|
|
|
|
}
|
2024-12-24 22:36:03 +01:00
|
|
|
|
2024-12-24 19:05:01 +01:00
|
|
|
type MagischWaffe struct {
|
|
|
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
|
|
|
//ItemType string `gorm:"index" json:"item_type"` // Type of the referenced item (e.g., "Ausruestung")
|
|
|
|
|
//ItemID uint `gorm:"index" json:"item_id"` // ID of the referenced item
|
|
|
|
|
WaffenID int `gorm:"index" json:"waffen_id"`
|
|
|
|
|
Abw int `json:"abw"`
|
|
|
|
|
Ausgebrannt bool `json:"ausgebrannt"`
|
|
|
|
|
IstMagisch bool `json:"ist_magisch"`
|
|
|
|
|
}
|
2024-12-24 22:36:03 +01:00
|
|
|
|
2024-12-24 19:05:01 +01:00
|
|
|
type MagischBehaelter struct {
|
|
|
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
|
|
|
//ItemType string `gorm:"index" json:"item_type"` // Type of the referenced item (e.g., "Ausruestung")
|
|
|
|
|
//ItemID uint `gorm:"index" json:"item_id"` // ID of the referenced item
|
|
|
|
|
BehaeltnissID int `gorm:"index" json:"behaeltniss_id"`
|
|
|
|
|
Abw int `json:"abw"`
|
|
|
|
|
Ausgebrannt bool `json:"ausgebrannt"`
|
|
|
|
|
IstMagisch bool `json:"ist_magisch"`
|
|
|
|
|
}
|
2024-12-24 22:36:03 +01:00
|
|
|
|
2024-12-24 19:05:01 +01:00
|
|
|
type MagischTransport struct {
|
|
|
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
|
|
|
//ItemType string `gorm:"index" json:"item_type"` // Type of the referenced item (e.g., "Ausruestung")
|
|
|
|
|
//ItemID uint `gorm:"index" json:"item_id"` // ID of the referenced item
|
|
|
|
|
TransportationID int `gorm:"index" json:"transportation_id"`
|
|
|
|
|
Abw int `json:"abw"`
|
|
|
|
|
Ausgebrannt bool `json:"ausgebrannt"`
|
|
|
|
|
IstMagisch bool `json:"ist_magisch"`
|
2024-12-21 07:42:20 +01:00
|
|
|
}
|