package gate_pic import ( "context" dbmodel "property-device/model" "property-device/pb" pb_v1 "property-device/pb/v1" "property-device/utils/gate_utils" ) type PicSaiboMqttv1Whiter struct { Up *dbmodel.TUserPic Device *dbmodel.TGate Gp *dbmodel.TGatePic command bool } func (p *PicSaiboMqttv1Whiter) PersonAdd() { mreq := pb_v1.FaceWhiteAddRequest{ Sn: p.Device.Sn, List: []*pb_v1.FaceWhiteData{&pb_v1.FaceWhiteData{ CustomId: p.Up.Uid, Name: p.Up.Name, Pic: p.Up.PicUrl, }}, } _, err := pb.Mqtt.FaceWhiteAdd(context.Background(), &mreq) if err != nil { whitePicSetFail(p.Up, p.Device, gate_utils.WhiteAddStatusPersonFail, err.Error()) } return } func (p *PicSaiboMqttv1Whiter) PicAdd() { return } func (p *PicSaiboMqttv1Whiter) PicUpdate() { p.PersonAdd() return } func (p *PicSaiboMqttv1Whiter) PersonDel() { mreq := pb_v1.FaceWhiteDelRequest{ Sn: p.Device.Sn, CustomIds: []string{p.Up.Uid}, } _, _ = pb.Mqtt.FaceWhiteDel(context.Background(), &mreq) return } func (p *PicSaiboMqttv1Whiter) Command() bool { return p.command }