2020-02-02 03:36:00 +01:00
|
|
|
package form
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/ulule/deepcopier"
|
|
|
|
)
|
|
|
|
|
2020-05-18 22:18:58 +02:00
|
|
|
type Details struct {
|
|
|
|
PhotoID uint `json:"PhotoID" deepcopier:"skip"`
|
|
|
|
Keywords string `json:"Keywords"`
|
|
|
|
Notes string `json:"Notes"`
|
|
|
|
Subject string `json:"Subject"`
|
|
|
|
Artist string `json:"Artist"`
|
|
|
|
Copyright string `json:"Copyright"`
|
|
|
|
License string `json:"License"`
|
2020-05-12 13:52:09 +02:00
|
|
|
}
|
|
|
|
|
2020-02-02 03:36:00 +01:00
|
|
|
// Photo represents a photo edit form.
|
|
|
|
type Photo struct {
|
2020-05-23 20:58:58 +02:00
|
|
|
PhotoType string `json:"Type"`
|
2020-07-14 12:42:31 +02:00
|
|
|
TypeSrc string `json:"TypeSrc"`
|
2020-05-18 22:18:58 +02:00
|
|
|
TakenAt time.Time `json:"TakenAt"`
|
|
|
|
TakenAtLocal time.Time `json:"TakenAtLocal"`
|
|
|
|
TakenSrc string `json:"TakenSrc"`
|
|
|
|
TimeZone string `json:"TimeZone"`
|
2020-07-06 07:41:33 +02:00
|
|
|
PhotoYear int `json:"Year"`
|
|
|
|
PhotoMonth int `json:"Month"`
|
|
|
|
PhotoDay int `json:"Day"`
|
2020-05-23 20:58:58 +02:00
|
|
|
PhotoTitle string `json:"Title"`
|
2020-05-18 22:18:58 +02:00
|
|
|
TitleSrc string `json:"TitleSrc"`
|
2020-05-23 20:58:58 +02:00
|
|
|
PhotoDescription string `json:"Description"`
|
2020-05-18 22:18:58 +02:00
|
|
|
DescriptionSrc string `json:"DescriptionSrc"`
|
|
|
|
Details Details `json:"Details"`
|
2020-05-23 20:58:58 +02:00
|
|
|
PhotoFavorite bool `json:"Favorite"`
|
2020-05-29 18:04:30 +02:00
|
|
|
PhotoPrivate bool `json:"Private"`
|
|
|
|
PhotoReview bool `json:"Review"`
|
2020-07-06 14:35:25 +02:00
|
|
|
PhotoScan bool `json:"Scan"`
|
2020-07-16 15:43:23 +02:00
|
|
|
PhotoPanorama bool `json:"Panorama"`
|
2020-07-06 10:32:37 +02:00
|
|
|
PhotoAltitude int `json:"Altitude"`
|
2020-05-29 18:04:30 +02:00
|
|
|
PhotoLat float32 `json:"Lat"`
|
|
|
|
PhotoLng float32 `json:"Lng"`
|
|
|
|
PhotoIso int `json:"Iso"`
|
|
|
|
PhotoFocalLength int `json:"FocalLength"`
|
|
|
|
PhotoFNumber float32 `json:"FNumber"`
|
|
|
|
PhotoExposure string `json:"Exposure"`
|
|
|
|
PhotoCountry string `json:"Country"`
|
2020-07-12 08:27:05 +02:00
|
|
|
CellID string `json:"CellID"`
|
|
|
|
CellAccuracy int `json:"CellAccuracy"`
|
2020-05-29 18:04:30 +02:00
|
|
|
PlaceID string `json:"PlaceID"`
|
2020-07-12 08:27:05 +02:00
|
|
|
PlaceSrc string `json:"PlaceSrc"`
|
2020-05-29 18:04:30 +02:00
|
|
|
CameraID uint `json:"CameraID"`
|
|
|
|
CameraSrc string `json:"CameraSrc"`
|
|
|
|
LensID uint `json:"LensID"`
|
2020-06-10 14:13:57 +02:00
|
|
|
OriginalName string `json:"OriginalName"`
|
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
|
|
|
|
}
|