mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 07:15:25 +00:00
Locations Service (#34)
* Locations Proto * Add Read RPC * Locations Service * Add read locks
This commit is contained in:
26
locations/model/location.go
Normal file
26
locations/model/location.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Location struct {
|
||||
ID string
|
||||
UserID string `gorm:"index"`
|
||||
Latitude float64
|
||||
Longitude float64
|
||||
Timestamp time.Time
|
||||
}
|
||||
|
||||
// use the user id for the geoindex so only one result is returned per user
|
||||
func (l *Location) Id() string {
|
||||
return l.UserID
|
||||
}
|
||||
|
||||
func (l *Location) Lat() float64 {
|
||||
return l.Latitude
|
||||
}
|
||||
|
||||
func (l *Location) Lon() float64 {
|
||||
return l.Longitude
|
||||
}
|
||||
Reference in New Issue
Block a user