21 lines
407 B
Go
21 lines
407 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type DevicePort struct {
|
|
ID uuid.UUID `json:"id"`
|
|
DeviceID uuid.UUID `json:"device_id" gorm:"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"
|
|
} |