32 lines
932 B
Go
32 lines
932 B
Go
package req
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
type DevicePort struct {
|
|
DeviceID uuid.UUID `json:"device_id"`
|
|
PortNumber int `json:"port_number"`
|
|
}
|
|
|
|
type UpdateDevicePort struct {
|
|
DeviceID *uuid.UUID `json:"device_id,omitempty" validate:"omitempty,min=3"`
|
|
PortNumber *int `json:"port_number,omitempty" validate:"omitempty,min=1"`
|
|
}
|
|
|
|
|
|
type AssignCustomerToPortDTO struct {
|
|
CustomerName string `json:"customer_name" binding:"required"`
|
|
PortNumber *int `json:"port_number,omitempty"` // Optional, will auto-assign if not provided
|
|
}
|
|
|
|
type UpdatePortUsageDTO struct {
|
|
PortUsed int `json:"port_used" binding:"required,min=0"`
|
|
}
|
|
|
|
type PortAssignmentDTO struct {
|
|
PortNumber int `json:"port_number" binding:"required,min=1"`
|
|
CustomerName *string `json:"customer_name,omitempty"`
|
|
}
|
|
|
|
type UpdatePortAssignmentsDTO struct {
|
|
PortAssignments []PortAssignmentDTO `json:"port_assignments" binding:"required"`
|
|
} |