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-03-26 09:41:33 +01:00
|
|
|
TakenAt time.Time `json:"TakenAt"`
|
|
|
|
PhotoTitle string `json:"PhotoTitle"`
|
|
|
|
Description struct {
|
|
|
|
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-02-02 03:36:00 +01:00
|
|
|
PhotoFavorite bool `json:"PhotoFavorite"`
|
|
|
|
PhotoPrivate bool `json:"PhotoPrivate"`
|
|
|
|
PhotoNSFW bool `json:"PhotoNSFW"`
|
|
|
|
PhotoStory bool `json:"PhotoStory"`
|
|
|
|
PhotoLat float64 `json:"PhotoLat"`
|
|
|
|
PhotoLng float64 `json:"PhotoLng"`
|
|
|
|
PhotoAltitude int `json:"PhotoAltitude"`
|
|
|
|
PhotoFocalLength int `json:"PhotoFocalLength"`
|
|
|
|
PhotoIso int `json:"PhotoIso"`
|
2020-03-26 09:41:33 +01:00
|
|
|
PhotoFNumber float64 `json:"PhotoFNumber"`
|
|
|
|
PhotoExposure string `json:"PhotoExposure"`
|
|
|
|
CameraID uint `json:"CameraID"`
|
|
|
|
LensID uint `json:"LensID"`
|
|
|
|
LocationID string `json:"LocationID"`
|
|
|
|
PlaceID string `json:"PlaceID"`
|
|
|
|
PhotoCountry string `json:"PhotoCountry"`
|
|
|
|
TimeZone string `json:"TimeZone"`
|
|
|
|
TakenAtLocal time.Time `json:"TakenAtLocal"`
|
|
|
|
ModifiedTitle bool `json:"ModifiedTitle"`
|
|
|
|
ModifiedDescription bool `json:"ModifiedDescription"`
|
|
|
|
ModifiedDate bool `json:"ModifiedDate"`
|
|
|
|
ModifiedLocation bool `json:"ModifiedLocation"`
|
|
|
|
ModifiedCamera bool `json:"ModifiedCamera"`
|
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
|
|
|
|
}
|