2021-09-18 15:32:39 +02:00
|
|
|
package search
|
2020-05-08 15:41:01 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2021-09-18 15:32:39 +02:00
|
|
|
// GeoResult represents a photo geo json search result.
|
2020-05-08 15:41:01 +02:00
|
|
|
type GeoResult struct {
|
2020-05-23 20:58:58 +02:00
|
|
|
ID string `json:"-"`
|
|
|
|
PhotoUID string `json:"UID"`
|
|
|
|
PhotoType string `json:"Type,omitempty"`
|
|
|
|
PhotoLat float32 `json:"Lat"`
|
|
|
|
PhotoLng float32 `json:"Lng"`
|
|
|
|
PhotoTitle string `json:"Title"`
|
|
|
|
PhotoDescription string `json:"Description,omitempty"`
|
|
|
|
PhotoFavorite bool `json:"Favorite,omitempty"`
|
|
|
|
FileHash string `json:"Hash"`
|
|
|
|
FileWidth int `json:"Width"`
|
|
|
|
FileHeight int `json:"Height"`
|
|
|
|
TakenAt time.Time `json:"TakenAt"`
|
2020-05-08 15:41:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (g GeoResult) Lat() float64 {
|
|
|
|
return float64(g.PhotoLat)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g GeoResult) Lng() float64 {
|
|
|
|
return float64(g.PhotoLng)
|
|
|
|
}
|
2020-05-11 14:49:00 +02:00
|
|
|
|
|
|
|
type GeoResults []GeoResult
|