heartrate_v1

package
v0.0.0-...-db40160 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InsertHeartRate            = "INSERT INTO heartrate_v1(pet_chip_id, time, heart_rate) VALUES (?,toUnixTimestamp(now()),?);"
	SelectHeartRateByPetChipID = "SELECT pet_chip_id, time, heart_rate FROM heartrate_v1 WHERE pet_chip_id = ?;"
)

Variables

This section is empty.

Functions

func AddHeartRateByPetChipID

func AddHeartRateByPetChipID(ctx *gin.Context)

func GetHeartRateByPetChipID

func GetHeartRateByPetChipID(ctx *gin.Context)

func InsertHeartRateQuery

func InsertHeartRateQuery(session *gocql.Session, petChipID gocql.UUID, heartRate int) error

func SetupRoutes

func SetupRoutes(router *gin.Engine)

SetupRoutes initializes the application routes.

Types

type HeartRateV1

type HeartRateV1 struct {
	ID        gocql.UUID `json:"pet_chip_id"`
	Time      time.Time  `json:"time"`
	HeartRate int        `json:"heart_rate"`
}

func SelectHeartRateByChipQuery

func SelectHeartRateByChipQuery(session *gocql.Session, petChipID gocql.UUID) (HeartRateV1, error)

type HeartRateV1RequestDto

type HeartRateV1RequestDto struct {
	PetChipID gocql.UUID `json:"petChipId" binding:"required,max=50"`
	HeartRate int        `json:"heartRete" binding:"required,min=0,max=500"`
}

type HeartRateV1ResponseDto

type HeartRateV1ResponseDto struct {
	ID        gocql.UUID `json:"petChipID"`
	Time      time.Time  `json:"time"`
	HeartRate int        `json:"heartRate"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL