syntax = "proto3"; // package声明符,用来防止不同的消息类型有命名冲突 package pb_v1; // 用于生成指定语言go的包名称 option go_package = "property-applete-gateway/pb/v1"; // 门禁入库 message GateInRequest { // 设备id string device_id = 1; // 设备名 string device_name = 2; // 序列号 string sn = 3; // 厂商 string manufactor = 4; // 授权key string auth_key = 5; // 1 二维码门禁 2 人脸识别门禁 int32 gate_type = 6; // 协议 string protocol = 7; } message GateInReply { } // 门禁出库 message GateOutRequest { string device_id = 1; int64 garden_id = 2; string out_user = 3; } message GateOutReply { } // 门禁列表 message GateItem { // 设备id string device_id = 1; // 设备名 string device_name = 2; // 序列号 string sn = 3; // 厂商 string manufactor = 4; // 授权key string auth_key = 5; // 1 二维码门禁 2 人脸识别门禁 int32 gate_type = 6; // 协议 string protocol = 7; // 小区id int64 garden_id = 8; // 小区名 string garden_name = 9; // 出库人 string out_user = 10; // 出库时间 int64 out_time = 11; // 1 在线 2 离线 int32 status = 12; // true 已启用 false 已禁用 bool enable = 13; // 1 进场 2 出场 3 进出场 int32 direction = 14; string location = 15; } message GateListRequest { int64 garden_id = 1; int64 page = 2; int64 page_size = 3; // 1 已出库 2 未出库 int32 out = 4; string device_id = 5; } message GateListReply { int64 page = 1; int64 total = 2; repeated GateItem list = 3; } // 门禁信息 message GateInfoRequest { string device_id = 1; } message GateInfoReply { GateItem info = 1; } // 删除门禁 message GateDelRequest { string device_id = 1; } message GateDelReply { } // 回收门禁 message GateRecoveryRequest { string device_id = 1; } message GateRecoveryReply { } // 门禁启用停用 message GateEnableRequest { string device_id = 1; int64 garden_id = 2; bool enable = 3; } message GateEnableReply { } // 小区端编辑位置或方向 message GateSetRequest { string device_id = 1; int64 garden_id = 2; // 1 进场 2 出场 3 进出场 int32 direction = 3; // 位置 string location = 4; } message GateSetReply { } // 门禁白名单添加用户或ic卡 message GateCardInfo { string card_number = 1; string card_owner = 2; } message GateWhiteAddRequest { // 使用门禁列表中的id字段填充gate_id string device_id = 1; // 业主uid和ic卡二选一 repeated int64 household_uids = 2; repeated GateCardInfo card_info= 3; } message GateWhiteAddReply { } // 门禁白名单删除记录 message GateWhiteDelRequest { int64 id = 1; } message GateWhiteDelReply { } // 门禁白名单业主列表 message GateWhiteHouseholdItem { int64 household_uid = 1; string id_number = 2; string house_name = 3; int64 id = 4; string household_name = 5; // 1.待同步 2 同步中 3 已同步 4 删除中 int32 status = 6; } message GateWhiteHouseholdListRequest { int64 page = 1; int64 page_size = 2; string device_id = 3; int64 garden_id = 4; } message GateWhiteHouseholdListReply { int64 page = 1; int64 total = 2; repeated GateWhiteHouseholdItem list = 3; } // 门禁白名单ic卡列表 message GateWhiteCardItem { string card_number = 1; string card_ower = 2; int64 id = 3; // 1.待同步 2 同步中 3 已同步 4 删除中 int32 status = 6; } message GateWhiteCardListRequest { int64 page = 1; int64 page_size = 2; string device_id = 3; int64 garden_id = 4; } message GateWhiteCardListReply { int64 page = 1; int64 total = 2; repeated GateWhiteCardItem list = 3; } // 门禁更新状态 message GateOnlineRequest { string device_id = 1; } message GateOnlineReply { } // 白名单匹配 message GateWhiteMatchRequest { string device_id = 1; int64 garden_id = 2; string auth_key = 3; string code_val = 4; int32 code_type = 5; } message GateWhiteMatchReply { int32 status = 1; string status_desc = 2; GateItem device_info = 3; GateWhiteHouseholdItem household_info = 4; GateWhiteCardItem card_info = 5; } // 添加进出场记录 message GateRecordAddRequest { string device_id = 1; int64 white_id = 2; string location = 3; int32 direction = 4; string household_user = 5; string household_id_number = 6; string household_housename = 7; string card_number = 8; string card_owner = 9; int32 online = 10; int64 garden_id = 11; // 1 访客 2 非访客 int32 is_visitor = 12; // 开门时间 int64 open_time = 13; int64 household_uid = 14; } message GateRecordAddReply { } // 门禁进出场记录列表 message GateRecordListRequest { int64 page = 1; int64 page_size = 2; string device_id = 3; int64 start = 4; int64 end = 5; } message GateRecordItem { string device_id = 1; int64 white_id = 2; string location = 3; int32 direction = 4; string household_user = 5; string household_id_number = 6; string household_housename = 7; string card_number = 8; string card_owner = 9; int32 online = 10; int64 garden_id = 11; // 1 访客 2 非访客 int32 is_visitor = 12; // 开门时间 int64 open_time = 13; int64 household_uid = 14; } message GateRecordListReply { int64 page = 1; int64 total = 2; repeated GateRecordItem list = 3; } // 门禁添加远程命令 message GateCommandAddRequest { // 1 远程开门; // 2 重启设备; // 4 获取设备参数; // 5 设置设备参数; 6 下载白名单; // 7 清空本地所有白名单; // 8 清空本地所有刷卡记录; // 9 扫码显示参数; // 10 查询卡号是否存在白名单 // 99 恢复出厂; int32 cmd_code = 1; string cmd_params = 2; string device_id = 3; } message GateCommandAddReply { } // 门禁命令列表 message GateCommandListRequest { string device_id = 1; int32 status = 2; int64 start = 3; int64 end = 4; int64 page = 5; int64 page_size = 6; } message GateCommandItem { string device_id = 1; string desc = 2; // 1 待执行 2 执行中 3 执行完成 int32 status = 3; int64 created_at = 4; // 1 成功 2 失败 int32 result_status = 5; // 结果描述 string result_status_desc = 6; int64 id = 7; } message GateCommandListReply { int64 page = 1; int64 total = 2; repeated GateCommandItem list = 3; } // 删除命令 message GateCommandDelRequest { int64 id = 1; } message GateCommandDelReply { } // 重新执行命令 message GateCommandReuseRequest { int64 id = 1; } message GateCommandReuseReply { } message WhiteItem { string code_val = 1; int32 code_type = 2; } // 命令结果 message GateCommandResultRequest { int64 id = 1; int32 cmd_code = 2; int32 result_status = 3; string result_desc = 4; string device_id = 5; repeated WhiteItem exists = 6; } message GateCommandResultReply { } // 获取一条命令用于执行 message GateCommandUseRequest { string device_id = 1; } message GateCommandUseReply { int64 id = 1; int32 cmd_code = 2; string cmd_params = 3; } message GateWhiteSyncRequest { string device_id = 1; } message GateWhiteSyncReply { }