You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
3.1 KiB
114 lines
3.1 KiB
package main |
|
|
|
import "database/sql" |
|
|
|
// Pfad für die Ablage der Uploads |
|
var UploadPfad string = "/opt/data/uploads" |
|
|
|
// struct für das Einbinden von Items, die gekauft wurden |
|
type Itemb struct { |
|
Id uint64 `json:"id"` |
|
Bezeichnung string `json:"bezeichnung"` |
|
Kurzbeschreibung string `json:"kurzbeschreibung"` |
|
Groesse string `json:"groesse"` |
|
Farbe string `json:"farbe"` |
|
Type Typ `json:"type"` |
|
Material string `json:"material"` |
|
Abmessungen Measure `json:"abmessungen"` |
|
Frontview Photos `json:"frontview"` |
|
} |
|
|
|
// struct für die Datenbank-Abfrage, analog zu Itemb |
|
type DbIb struct { |
|
Bezeichnung sql.NullString |
|
Kurzbeschreibung sql.NullString |
|
Groesse sql.NullString |
|
Farbe sql.NullString |
|
Material sql.NullString |
|
Abmessungen DbMea |
|
Frontview DbPho |
|
} |
|
|
|
// struct für die Fotos, die im Filesystem abgelegt werden sollen |
|
type Photos struct { |
|
Id uint64 `json:"id"` |
|
Pfad string `json:"pfad"` |
|
ItembId uint64 `json:"itembid"` |
|
ItemextId uint64 `json:"itemextid"` |
|
ImageUrl string `json:"imgurl"` |
|
} |
|
|
|
// struct für die Datenbank-Abfrage von Photos |
|
type DbPho struct { |
|
Pfad sql.NullString |
|
ItembId sql.NullInt64 |
|
ItemextId sql.NullInt64 |
|
} |
|
|
|
// struct für die Typen von Kleidung |
|
type Typ struct { |
|
Id uint `json:"id"` |
|
Bezeichnung string `json:"bezeichnung"` |
|
} |
|
|
|
// struct für die Groessenangaben der Kleidungsstücke |
|
type Measure struct { |
|
Id uint64 `json:"id"` |
|
Kurz string `json:"kurz"` |
|
Brust float64 `json:"brust"` |
|
LaengeT float64 `json:"laenget"` |
|
Schulterbreite float64 `json:"schulterbreite"` |
|
TaillenumfangT float64 `json:"taillenumfangt"` |
|
Hueftumfang float64 `json:"hueftumfang"` |
|
Innennaht float64 `json:"innennaht"` |
|
LaengeB float64 `json:"laengeb"` |
|
TaillenumfangB float64 `json:"taillenumfangb"` |
|
} |
|
|
|
// struct für die Datenbank-Abfrage, analog zu Measure |
|
type DbMea struct { |
|
Kurz sql.NullString |
|
Brust sql.NullFloat64 |
|
LaengeT sql.NullFloat64 |
|
Schulterbreite sql.NullFloat64 |
|
TaillenumfangT sql.NullFloat64 |
|
Hueftumfang sql.NullFloat64 |
|
Innennaht sql.NullFloat64 |
|
LaengeB sql.NullFloat64 |
|
TaillenumfangB sql.NullFloat64 |
|
} |
|
|
|
// struct für die Erweiterung des Items für die Benutzung |
|
// zusätzliche Felder für Bewertung und Favoriten |
|
type ItemExt struct { |
|
Id uint64 `json:"id"` |
|
Zuhause bool `json:"zuhause"` |
|
Draussen bool `json:"draussen"` |
|
Genehmigt bool `json:"genehmigt"` |
|
Bemerkung string `json:"bemerkung"` |
|
Bewertung int `json:"bewertung"` |
|
Favorit bool `json:"favorit"` |
|
ItemB Itemb `json:"itemb"` |
|
Frontview Photos `json:"frontview"` |
|
} |
|
|
|
// struct für die Datenbank-Abrage |
|
type DbIe struct { |
|
Zuhause sql.NullBool |
|
Draussen sql.NullBool |
|
Genehmigt sql.NullBool |
|
Bemerkung sql.NullString |
|
Bewertung sql.NullInt64 |
|
Favorit sql.NullBool |
|
ItemB DbIb |
|
Frontview DbPho |
|
} |
|
|
|
// Upload-struct |
|
|
|
type ImgUpload struct { |
|
ObjUrl string `json:"objectURL"` |
|
Name string `json:"name"` |
|
Size int `json:"size"` |
|
Type string `json:"type"` |
|
}
|
|
|