123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- // Copyright 2019 getensh.com. All rights reserved.
- // Use of this source code is governed by getensh.com.
- package impl
- import (
- "context"
- "property-device/impl/v1/gate"
- "property-device/impl/v1/gate_card"
- "property-device/impl/v1/gate_command"
- "property-device/impl/v1/gate_match"
- "property-device/impl/v1/gate_pic"
- "property-device/impl/v1/gate_record"
- "property-device/impl/v1/gate_unit"
- "property-device/impl/v1/mqtt_device"
- "property-device/impl/v1/visitor"
- "property-device/pb"
- pb_v1 "property-device/pb/v1"
- "git.getensh.com/common/gopkgs/tasker/rpctasker"
- "google.golang.org/grpc"
- )
- // 具体实现
- type Rcvr struct {
- }
- func Register(s *grpc.Server) {
- pb.RegisterDeviceServer(s, &Rcvr{})
- }
- //
- func (c *Rcvr) GateOnline(ctx context.Context, req *pb_v1.GateOnlineRequest) (reply *pb_v1.GateOnlineReply, err error) {
- t1 := func() error {
- reply, err = gate.GateOnline(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateIn(ctx context.Context, req *pb_v1.GateInRequest) (reply *pb_v1.GateInReply, err error) {
- t1 := func() error {
- reply, err = gate.GateIn(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateBatchIn(ctx context.Context, req *pb_v1.GateBatchInRequest) (reply *pb_v1.GateBatchInReply, err error) {
- t1 := func() error {
- reply, err = gate.GateBatchIn(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateList(ctx context.Context, req *pb_v1.GateListRequest) (reply *pb_v1.GateListReply, err error) {
- t1 := func() error {
- reply, err = gate.GateList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateOut(ctx context.Context, req *pb_v1.GateOutRequest) (reply *pb_v1.GateOutReply, err error) {
- t1 := func() error {
- reply, err = gate.GateOut(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateProtocols(ctx context.Context, req *pb_v1.GateProtocolsRequest) (reply *pb_v1.GateProtocolsReply, err error) {
- t1 := func() error {
- reply, err = gate.GateProtocols(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateDel(ctx context.Context, req *pb_v1.GateDelRequest) (reply *pb_v1.GateDelReply, err error) {
- t1 := func() error {
- reply, err = gate.GateDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateRecovery(ctx context.Context, req *pb_v1.GateRecoveryRequest) (reply *pb_v1.GateRecoveryReply, err error) {
- t1 := func() error {
- reply, err = gate.GateRecovery(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateEnable(ctx context.Context, req *pb_v1.GateEnableRequest) (reply *pb_v1.GateEnableReply, err error) {
- t1 := func() error {
- reply, err = gate.GateEnable(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateSet(ctx context.Context, req *pb_v1.GateSetRequest) (reply *pb_v1.GateSetReply, err error) {
- t1 := func() error {
- reply, err = gate.GateSet(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 添加门禁卡
- func (c *Rcvr) GateCardAdd(ctx context.Context, req *pb_v1.GateCardAddRequest) (reply *pb_v1.GateCardAddReply, err error) {
- t1 := func() error {
- reply, err = gate_card.GateCardAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateCardDel(ctx context.Context, req *pb_v1.GateCardDelRequest) (reply *pb_v1.GateCardDelReply, err error) {
- t1 := func() error {
- reply, err = gate_card.GateCardDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 卡列表
- func (c *Rcvr) GateCardList(ctx context.Context, req *pb_v1.GateCardListRequest) (reply *pb_v1.GateCardListReply, err error) {
- t1 := func() error {
- reply, err = gate_card.GateCardList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 获取卡还可以绑定的设备
- func (c *Rcvr) GateCardCanBindDevices(ctx context.Context, req *pb_v1.GateCardCanBindDevicesRequest) (reply *pb_v1.GateCardCanBindDevicesReply, err error) {
- t1 := func() error {
- reply, err = gate_card.GateCardCanBindDevices(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 卡下发
- func (c *Rcvr) GateCardSync(ctx context.Context, req *pb_v1.GateCardSyncRequest) (reply *pb_v1.GateCardSyncReply, err error) {
- t1 := func() error {
- reply, err = gate_card.GateCardSync(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 人脸录入
- func (c *Rcvr) GateUserPicAdd(ctx context.Context, req *pb_v1.GateUserPicAddRequest) (reply *pb_v1.GateUserPicAddReply, err error) {
- t1 := func() error {
- reply, err = gate_pic.GateUserPicAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateUserPicDel(ctx context.Context, req *pb_v1.GateUserPicDelRequest) (reply *pb_v1.GateUserPicDelReply, err error) {
- t1 := func() error {
- reply, err = gate_pic.GateUserPicDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 人脸审核
- func (c *Rcvr) GateUserPicApprove(ctx context.Context, req *pb_v1.GateUserPicApproveRequest) (reply *pb_v1.GateUserPicApproveReply, err error) {
- t1 := func() error {
- reply, err = gate_pic.GateUserPicApprove(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 人脸下发
- func (c *Rcvr) GateUserPicSync(ctx context.Context, req *pb_v1.GateUserPicSyncRequest) (reply *pb_v1.GateUserPicSyncReply, err error) {
- t1 := func() error {
- reply, err = gate_pic.GateUserPicSync(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 人脸列表
- func (c *Rcvr) GateUserPicList(ctx context.Context, req *pb_v1.GateUserPicListRequest) (reply *pb_v1.GateUserPicListReply, err error) {
- t1 := func() error {
- reply, err = gate_pic.GateUserPicList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 人脸信息
- func (c *Rcvr) GateUserPicInfo(ctx context.Context, req *pb_v1.GateUserPicInfoRequest) (reply *pb_v1.GateUserPicInfoReply, err error) {
- t1 := func() error {
- reply, err = gate_pic.GateUserPicInfo(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) HouseholdGateSyncCheck(ctx context.Context, req *pb_v1.HouseholdGateSyncCheckRequest) (reply *pb_v1.HouseholdGateSyncCheckReply, err error) {
- t1 := func() error {
- reply, err = gate_pic.HouseholdGateSyncCheck(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MqttFaceGate(ctx context.Context, req *pb_v1.MqttFaceGateRequest) (reply *pb_v1.MqttFaceGateReply, err error) {
- t1 := func() error {
- reply, err = mqtt_device.MqttFaceGate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 门禁白名单匹配
- func (c *Rcvr) GateWhiteMatch(ctx context.Context, req *pb_v1.GateWhiteMatchRequest) (reply *pb_v1.GateWhiteMatchReply, err error) {
- t1 := func() error {
- reply, err = gate_match.GateWhiteMatch(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 门禁进出记录添加
- func (c *Rcvr) GateRecordAdd(ctx context.Context, req *pb_v1.GateRecordAddRequest) (reply *pb_v1.GateRecordAddReply, err error) {
- t1 := func() error {
- reply, err = gate_record.GateRecordAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 门禁进出记录列表
- func (c *Rcvr) GateRecordList(ctx context.Context, req *pb_v1.GateRecordListRequest) (reply *pb_v1.GateRecordListReply, err error) {
- t1 := func() error {
- reply, err = gate_record.GateRecordList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 获取门禁远程命令
- func (c *Rcvr) GateCommandUse(ctx context.Context, req *pb_v1.GateCommandUseRequest) (reply *pb_v1.GateCommandUseReply, err error) {
- t1 := func() error {
- reply, err = gate_command.GateCommandUse(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 门禁远程命令结果
- func (c *Rcvr) GateCommandResult(ctx context.Context, req *pb_v1.GateCommandResultRequest) (reply *pb_v1.GateCommandResultReply, err error) {
- t1 := func() error {
- reply, err = gate_command.GateCommandResult(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 门禁命令添加
- func (c *Rcvr) GateCommandAdd(ctx context.Context, req *pb_v1.GateCommandAddRequest) (reply *pb_v1.GateCommandAddReply, err error) {
- t1 := func() error {
- reply, err = gate_command.GateCommandAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 门禁命令记录
- func (c *Rcvr) GateCommandList(ctx context.Context, req *pb_v1.GateCommandListRequest) (reply *pb_v1.GateCommandListReply, err error) {
- t1 := func() error {
- reply, err = gate_command.GateCommandList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateVisitorAdd(ctx context.Context, req *pb_v1.GateVisitorAddRequest) (reply *pb_v1.GateVisitorAddReply, err error) {
- t1 := func() error {
- reply, err = visitor.GateVisitorAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateVisitorDel(ctx context.Context, req *pb_v1.GateVisitorDelRequest) (reply *pb_v1.GateVisitorDelReply, err error) {
- t1 := func() error {
- reply, err = visitor.GateVisitorDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateVisitorCheck(ctx context.Context, req *pb_v1.GateVisitorCheckRequest) (reply *pb_v1.GateVisitorCheckReply, err error) {
- t1 := func() error {
- reply, err = visitor.GateVisitorCheck(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) GateVisitorList(ctx context.Context, req *pb_v1.GateVisitorListRequest) (reply *pb_v1.GateVisitorListReply, err error) {
- t1 := func() error {
- reply, err = visitor.GateVisitorList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 门禁绑定范围
- func (c *Rcvr) GateUnitAdd(ctx context.Context, req *pb_v1.GateUnitAddRequest) (reply *pb_v1.GateUnitAddReply, err error) {
- t1 := func() error {
- reply, err = gate_unit.GateUnitAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 门禁单元列表
- func (c *Rcvr) GateUnitList(ctx context.Context, req *pb_v1.GateUnitListRequest) (reply *pb_v1.GateUnitListReply, err error) {
- t1 := func() error {
- reply, err = gate_unit.GateUnitList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 绑定了某单元的门禁
- func (c *Rcvr) GateUnitDevice(ctx context.Context, req *pb_v1.GateUnitDeviceRequest) (reply *pb_v1.GateUnitDeviceReply, err error) {
- t1 := func() error {
- reply, err = gate_unit.GateUnitDevice(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
|