23 lines
633 B
Go
23 lines
633 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Tower struct {
|
|
ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey"`
|
|
DeviceID uuid.UUID `json:"dev_id" gorm:"type:uuid;column:dev_id"`
|
|
TowerCode string `json:"tower_code" gorm:"unique"`
|
|
Longitude float64 `json:"longitude"`
|
|
Latitude float64 `json:"latitude"`
|
|
ImageURL string `json:"image_url" gorm:"column:image_url"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
|
|
Device Device `gorm:"foreignKey:DeviceID"`
|
|
}
|
|
|
|
func (Tower) TableName() string {
|
|
return "towers"
|
|
} |