1234567891011121314151617181920212223242526272829303132333435363738 |
- package gate_pic
- import (
- dbmodel "property-device/model"
- "property-device/utils/gate_utils"
- )
- type PicWhiter interface {
- PersonAdd()
- PicAdd()
- PicUpdate()
- PersonDel()
- Command() bool
- }
- func NewPicWhiter(up *dbmodel.TUserPic, device *dbmodel.TGate, gp *dbmodel.TGatePic) PicWhiter {
- switch device.Protocol {
- case gate_utils.GateProtocolYufanHttpV1:
- byIp := false
- if gate_utils.CheckYufanIp(device.Ip, device.Port, device.Password) {
- byIp = true
- }
- return &PicYufanHttpv1Whiter{
- Up: up,
- Device: device,
- Gp: gp,
- ByIp: byIp,
- }
- case gate_utils.GateProtocolSaiboMqttV1:
- return &PicSaiboMqttv1Whiter{
- Up: up,
- Device: device,
- Gp: gp,
- }
- }
- return nil
- }
|