2020-05-08 14:18:11 +02:00
|
|
|
package entity
|
|
|
|
|
2020-05-10 19:43:49 +02:00
|
|
|
type DescriptionMap map[string]Description
|
|
|
|
|
|
|
|
func (m DescriptionMap) Get(name string, photoId uint) Description {
|
|
|
|
if result, ok := m[name]; ok {
|
|
|
|
result.PhotoID = photoId
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
return Description{PhotoID: photoId}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m DescriptionMap) Pointer(name string, photoId uint) *Description {
|
|
|
|
if result, ok := m[name]; ok {
|
|
|
|
result.PhotoID = photoId
|
|
|
|
return &result
|
|
|
|
}
|
|
|
|
|
|
|
|
return &Description{PhotoID: photoId}
|
|
|
|
}
|
|
|
|
|
|
|
|
var DescriptionFixtures = DescriptionMap{
|
2020-05-08 14:18:11 +02:00
|
|
|
"lake": {
|
|
|
|
PhotoID: 1000000,
|
2020-05-12 11:51:28 +02:00
|
|
|
PhotoDescription: "photo description lake",
|
2020-05-08 14:18:11 +02:00
|
|
|
PhotoKeywords: "nature, frog",
|
|
|
|
PhotoNotes: "notes",
|
|
|
|
PhotoSubject: "Lake",
|
|
|
|
PhotoArtist: "Hans",
|
|
|
|
PhotoCopyright: "copy",
|
|
|
|
PhotoLicense: "MIT",
|
|
|
|
},
|
|
|
|
}
|