forked from strava/go.strava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
photos.go
24 lines (21 loc) · 862 Bytes
/
photos.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package strava
import (
"time"
)
type PhotoSummary struct {
Id int64 `json:"id"`
ActivityId int64 `json:"activity_id"`
Reference string `json:"ref"`
UID string `json:"uid"`
Caption string `json:"caption"`
Type string `json:"type"`
UploadedAt time.Time `json:"-"`
CreatedAt time.Time `json:"-"`
UploadedAtString string `json:"uploaded_at"` // the ISO 8601 encoding of when the photo was uploaded to the external service
CreatedAtString string `json:"created_at"` // the ISO 8601 encoding of when the photo was linked with strava
Location Location `json:"location"`
}
func (p *PhotoSummary) postProcessSummary() {
p.UploadedAt, _ = time.Parse(timeFormat, p.UploadedAtString)
p.CreatedAt, _ = time.Parse(timeFormat, p.CreatedAtString)
}