mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 17:15:31 +00:00
Search Index Build
This commit is contained in:
@@ -3,6 +3,11 @@ package xmlmodels
|
||||
import (
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
CATEGORY_TYPE = "category"
|
||||
)
|
||||
|
||||
type Category struct {
|
||||
@@ -21,3 +26,20 @@ func (c Category) String() string {
|
||||
data, _ := json.MarshalIndent(c, "", " ")
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func (c Category) Readable(_ *Library) map[string]interface{} {
|
||||
ret := map[string]interface{}{
|
||||
"ID": c.ID,
|
||||
"Names": strings.Join(c.Names, "; "),
|
||||
}
|
||||
|
||||
for k, v := range c.AnnotationNote.Readable() {
|
||||
ret[k] = v
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (c Category) Type() string {
|
||||
return CATEGORY_TYPE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user