Files
kgpz_web/xmlmodels/places.go
2025-02-18 00:33:30 +01:00

42 lines
654 B
Go

package xmlmodels
import (
"encoding/json"
"encoding/xml"
)
const (
PLACE_TYPE = "place"
)
type Place struct {
XMLName xml.Name `xml:"ort"`
Names []string `xml:"name"`
SortName string `xml:"sortiername"`
Geo string `xml:"geonames"`
Identifier
AnnotationNote
}
func (p Place) String() string {
data, _ := json.MarshalIndent(p, "", " ")
return string(data)
}
func (p Place) Readable(_ *Library) map[string]interface{} {
ret := map[string]interface{}{
"ID": p.ID,
"Names": p.Names,
}
for k, v := range p.AnnotationNote.Readable() {
ret[k] = v
}
return ret
}
func (p Place) Type() string {
return PLACE_TYPE
}