Documentation ¶
Index ¶
- Constants
- func AddHeartRateByPetChipID(ctx *gin.Context)
- func GetHeartRateByPetChipID(ctx *gin.Context)
- func InsertHeartRateQuery(session *gocql.Session, petChipID gocql.UUID, heartRate int) error
- func SetupRoutes(router *gin.Engine)
- type HeartRateV2
- type HeartRateV2QueryParams
- type HeartRateV2RequestDto
- type HeartRateV2ResponseDto
Constants ¶
View Source
const ( InsertHeartRate = "INSERT INTO heartrate_v2 (pet_chip_id, time, heart_rate) VALUES (?,toUnixTimestamp(now()),?);" SelectHeartRateByPetChipIDAndTimeRange = "SELECT pet_chip_id, time, heart_rate FROM heartrate_v2 WHERE pet_chip_id = ? AND time >= ? AND time <= ?;" SelectLastAddedRecordByPetChipID = "SELECT pet_chip_id, time, heart_rate FROM heartrate_v2 WHERE pet_chip_id = ? ORDER BY time DESC LIMIT 1;" )
Variables ¶
This section is empty.
Functions ¶
func AddHeartRateByPetChipID ¶
func GetHeartRateByPetChipID ¶
func InsertHeartRateQuery ¶
func SetupRoutes ¶
SetupRoutes initializes the application routes.
Types ¶
type HeartRateV2 ¶
type HeartRateV2 struct { ID gocql.UUID `json:"pet_chip_id"` Time time.Time `json:"time"` HeartRate int `json:"heart_rate"` }
type HeartRateV2QueryParams ¶
type HeartRateV2QueryParams struct { StartDate time.Time `form:"start-date" validate:"required,datetime,max=50" time_format:"2006-01-02T15:04:05Z"` EndDate time.Time `form:"end-date,omitempty" validate:"omitempty,datetime,max=50" time_format:"2006-01-02T15:04:05Z"` }
ISO 8601 (e.g., 2006-01-02T15:04:05Z).
type HeartRateV2RequestDto ¶
Click to show internal directories.
Click to hide internal directories.