rts-sim-module/repository/relay.go

42 lines
629 B
Go
Raw Normal View History

package repository
import "joylink.club/rtsssimulation/repository/model/proto"
type Relay struct {
Identity
code string
model string
}
func newRelay(id string, code string, model string) *Relay {
return &Relay{
Identity: identity{
id: id,
deviceType: proto.DeviceType_DeviceType_Relay,
},
code: code,
model: model,
}
}
2023-09-26 10:25:00 +08:00
func (r *Relay) Code() string {
return r.code
}
func (r *Relay) Model() string {
return r.model
}
type RelayGroup struct {
code string
relays []*Relay
}
2023-09-26 10:25:00 +08:00
func (r *RelayGroup) Code() string {
return r.code
}
func (r *RelayGroup) Relays() []*Relay {
return r.relays
}