Documentation
¶
Index ¶
- func WithDeviceID(deviceID uint64) func(db *gorm.DB) *gorm.DB
- func WithEndTime(endTime time.Time) func(db *gorm.DB) *gorm.DB
- func WithOrder(order string) func(db *gorm.DB) *gorm.DB
- func WithStartTime(startTime time.Time) func(db *gorm.DB) *gorm.DB
- type CollectionData
- type CollectionRecord
- type GeoPoint
- type PredictAndGuess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CollectionData ¶ added in v0.3.3
type CollectionRecord ¶
type CollectionRecord struct { ID uint `gorm:"primarykey"` DeviceID uint64 `gorm:"uniqueIndex:collection_record_device_id_timestamp"` CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` ReceivedAt time.Time *CollectionData `gorm:"embedded"` PredictAndGuess *PredictAndGuess `gorm:"foreignKey:CollectionRecordID;references:ID"` }
type PredictAndGuess ¶ added in v0.4.3
type PredictAndGuess struct { ID uint `gorm:"primarykey"` CollectionRecordID uint `gorm:"uniqueIndex;not null"` DeviceID uint64 `gorm:"not null"` CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` Level int64 `gorm:"default:-1"` Predicts []*CollectionData `gorm:"serializer:fastjson"` Levles []int64 `gorm:"serializer:fastjson"` }
func (*PredictAndGuess) AfterCreate ¶ added in v0.4.3
func (p *PredictAndGuess) AfterCreate(tx *gorm.DB) (err error)
更新CollectionRecord的UpdatedAt
func (*PredictAndGuess) AfterUpdate ¶ added in v0.4.3
func (p *PredictAndGuess) AfterUpdate(tx *gorm.DB) (err error)
Click to show internal directories.
Click to hide internal directories.