2020-05-18 22:18:58 +02:00
|
|
|
package entity
|
|
|
|
|
|
|
|
type DetailsMap map[string]Details
|
|
|
|
|
|
|
|
func (m DetailsMap) Get(name string, photoId uint) Details {
|
|
|
|
if result, ok := m[name]; ok {
|
|
|
|
result.PhotoID = photoId
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
return Details{PhotoID: photoId}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m DetailsMap) Pointer(name string, photoId uint) *Details {
|
|
|
|
if result, ok := m[name]; ok {
|
|
|
|
result.PhotoID = photoId
|
|
|
|
return &result
|
|
|
|
}
|
|
|
|
|
|
|
|
return &Details{PhotoID: photoId}
|
|
|
|
}
|
|
|
|
|
|
|
|
var DetailsFixtures = DetailsMap{
|
|
|
|
"lake": {
|
2021-07-22 18:31:56 +02:00
|
|
|
PhotoID: 1000000,
|
|
|
|
Keywords: "nature, frog",
|
|
|
|
Notes: "notes",
|
|
|
|
Subject: "Lake",
|
|
|
|
Artist: "Hans",
|
|
|
|
Copyright: "copy",
|
|
|
|
License: "MIT",
|
2021-07-22 15:05:23 +02:00
|
|
|
CreatedAt: Timestamp(),
|
|
|
|
UpdatedAt: Timestamp(),
|
2021-07-22 18:31:56 +02:00
|
|
|
KeywordsSrc: "meta",
|
|
|
|
NotesSrc: "manual",
|
|
|
|
SubjectSrc: "meta",
|
|
|
|
ArtistSrc: "meta",
|
2021-07-22 15:05:23 +02:00
|
|
|
CopyrightSrc: "manual",
|
2021-07-22 18:31:56 +02:00
|
|
|
LicenseSrc: "manual",
|
2020-05-18 22:18:58 +02:00
|
|
|
},
|
|
|
|
"blacklist": {
|
2021-07-22 18:31:56 +02:00
|
|
|
PhotoID: 1000001,
|
|
|
|
Keywords: "screenshot, info",
|
|
|
|
Notes: "notes",
|
|
|
|
Subject: "Blacklist",
|
|
|
|
Artist: "Hans",
|
|
|
|
Copyright: "copy",
|
|
|
|
License: "MIT",
|
2021-07-22 15:05:23 +02:00
|
|
|
CreatedAt: Timestamp(),
|
|
|
|
UpdatedAt: Timestamp(),
|
2021-07-22 18:31:56 +02:00
|
|
|
KeywordsSrc: "",
|
|
|
|
NotesSrc: "",
|
|
|
|
SubjectSrc: "meta",
|
|
|
|
ArtistSrc: "meta",
|
2021-07-22 15:05:23 +02:00
|
|
|
CopyrightSrc: "manual",
|
2021-07-22 18:31:56 +02:00
|
|
|
LicenseSrc: "manual",
|
2020-05-18 22:18:58 +02:00
|
|
|
},
|
2020-05-25 19:10:44 +02:00
|
|
|
"bridge": {
|
2021-07-22 18:31:56 +02:00
|
|
|
PhotoID: 1000003,
|
|
|
|
Keywords: "bridge, nature",
|
|
|
|
Notes: "Some Notes!@#$",
|
|
|
|
Subject: "Bridge",
|
|
|
|
Artist: "Jens Mander",
|
|
|
|
Copyright: "Copyright 2020",
|
|
|
|
License: "n/a",
|
2021-07-22 15:05:23 +02:00
|
|
|
CreatedAt: Timestamp(),
|
|
|
|
UpdatedAt: Timestamp(),
|
2021-07-22 18:31:56 +02:00
|
|
|
KeywordsSrc: "meta",
|
|
|
|
NotesSrc: "manual",
|
|
|
|
SubjectSrc: "meta",
|
|
|
|
ArtistSrc: "meta",
|
2021-07-22 15:05:23 +02:00
|
|
|
CopyrightSrc: "manual",
|
2021-07-22 18:31:56 +02:00
|
|
|
LicenseSrc: "manual",
|
2020-05-25 19:10:44 +02:00
|
|
|
},
|
2020-05-18 22:18:58 +02:00
|
|
|
}
|