mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 09:05:30 +00:00
Search Index Build
This commit is contained in:
@@ -6,6 +6,10 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const (
|
||||
ISSUE_TYPE = "issue"
|
||||
)
|
||||
|
||||
type Issue struct {
|
||||
XMLName xml.Name `xml:"stueck"`
|
||||
Number Nummer `xml:"nummer"`
|
||||
@@ -57,3 +61,22 @@ func (i Issue) String() string {
|
||||
data, _ := json.MarshalIndent(i, "", " ")
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func (i Issue) Readable(_ *Library) map[string]interface{} {
|
||||
ret := map[string]interface{}{
|
||||
"ID": i.ID,
|
||||
"Number": i.Number.No,
|
||||
"Year": i.Datum.When.Year,
|
||||
"Date": i.Datum.When.String(),
|
||||
}
|
||||
|
||||
for k, v := range i.AnnotationNote.Readable() {
|
||||
ret[k] = v
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (i Issue) Type() string {
|
||||
return ISSUE_TYPE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user