20 lines
496 B
Go
20 lines
496 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type DevicePort struct {
|
|
ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey"`
|
|
DeviceID uuid.UUID `json:"device_id" gorm:"type:uuid;column:device_id"`
|
|
PortNumber int `json:"port_number"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
|
|
Device Device `gorm:"foreignKey:DeviceID"`
|
|
}
|
|
|
|
func (DevicePort) TableName() string {
|
|
return "device_ports"
|
|
} |