2020-02-02 03:36:00 +01:00
|
|
|
package form
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/ulule/deepcopier"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Photo represents a photo edit form.
|
|
|
|
type Photo struct {
|
2020-04-18 23:20:54 +02:00
|
|
|
TakenAt time.Time `json:"TakenAt"`
|
|
|
|
TakenAtLocal time.Time `json:"TakenAtLocal"`
|
|
|
|
TakenSrc string `json:"TakenSrc"`
|
|
|
|
TimeZone string `json:"TimeZone"`
|
|
|
|
PhotoTitle string `json:"PhotoTitle"`
|
|
|
|
TitleSrc string `json:"TitleSrc"`
|
|
|
|
Description struct {
|
2020-03-26 09:41:33 +01:00
|
|
|
PhotoID uint `json:"PhotoID" deepcopier:"skip"`
|
|
|
|
PhotoDescription string `json:"PhotoDescription"`
|
|
|
|
PhotoKeywords string `json:"PhotoKeywords"`
|
|
|
|
PhotoNotes string `json:"PhotoNotes"`
|
|
|
|
PhotoSubject string `json:"PhotoSubject"`
|
|
|
|
PhotoArtist string `json:"PhotoArtist"`
|
|
|
|
PhotoCopyright string `json:"PhotoCopyright"`
|
|
|
|
PhotoLicense string `json:"PhotoLicense"`
|
|
|
|
} `json:"Description"`
|
2020-04-18 23:20:54 +02:00
|
|
|
DescriptionSrc string `json:"DescriptionSrc"`
|
|
|
|
PhotoFavorite bool `json:"PhotoFavorite"`
|
|
|
|
PhotoPrivate bool `json:"PhotoPrivate"`
|
|
|
|
PhotoStory bool `json:"PhotoStory"`
|
|
|
|
PhotoReview bool `json:"PhotoReview"`
|
2020-04-26 11:41:54 +02:00
|
|
|
PhotoLat float32 `json:"PhotoLat"`
|
|
|
|
PhotoLng float32 `json:"PhotoLng"`
|
2020-04-18 23:20:54 +02:00
|
|
|
PhotoAltitude int `json:"PhotoAltitude"`
|
|
|
|
PhotoIso int `json:"PhotoIso"`
|
|
|
|
PhotoFocalLength int `json:"PhotoFocalLength"`
|
2020-04-26 11:41:54 +02:00
|
|
|
PhotoFNumber float32 `json:"PhotoFNumber"`
|
2020-04-18 23:20:54 +02:00
|
|
|
PhotoExposure string `json:"PhotoExposure"`
|
|
|
|
CameraID uint `json:"CameraID"`
|
|
|
|
CameraSrc string `json:"CameraSrc"`
|
|
|
|
LensID uint `json:"LensID"`
|
|
|
|
LocationID string `json:"LocationID"`
|
|
|
|
LocationSrc string `json:"LocationSrc"`
|
|
|
|
PlaceID string `json:"PlaceID"`
|
|
|
|
PhotoCountry string `json:"PhotoCountry"`
|
2020-02-02 03:36:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewPhoto(m interface{}) (f Photo, err error) {
|
|
|
|
err = deepcopier.Copy(m).To(&f)
|
|
|
|
|
|
|
|
return f, err
|
|
|
|
}
|