20 lines
501 B
Go
20 lines
501 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type OLT struct {
|
|
ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey"`
|
|
OLTName string `json:"olt_name" gorm:"unique;not null"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
|
|
// Relationships - One OLT can have many devices
|
|
Devices []Device `json:"devices,omitempty" gorm:"foreignKey:OLTID;references:ID"`
|
|
}
|
|
|
|
func (OLT) TableName() string {
|
|
return "olts"
|
|
} |