123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633 |
- syntax = "proto3";
- // package声明符,用来防止不同的消息类型有命名冲突
- package pb_v1;
- // 用于生成指定语言go的包名称
- option go_package = "property-device-gateway/pb/v1";
- // 门禁入库
- message GateInRequest {
- // 设备名
- string device_name = 1;
- // 序列号
- string sn = 2;
- // 厂商
- string manufactor = 3;
- // 授权key
- string auth_key = 4;
- // 协议
- int32 protocol = 5;
- bool qcode_support = 6;
- bool pic_support = 7;
- bool card_support = 8;
- }
- message GateInReply {
- }
- message GateBatchInItem {
- // 设备名
- string device_name = 1;
- // 序列号
- string sn = 2;
- // 厂商
- string manufactor = 3;
- // 授权key
- string auth_key = 4;
- // 协议
- int32 protocol = 5;
- bool qcode_support = 6;
- bool pic_support = 7;
- bool card_support = 8;
- }
- message GateBatchInRequest {
- repeated GateBatchInItem list = 1;
- }
- message GateBatchInReply {
- }
- // 门禁出库
- message GateOutRequest {
- int64 device_id = 1;
- int64 garden_id = 2;
- string out_user = 3;
- }
- message GateOutReply {
- }
- // 门禁列表
- message GateItem {
- // 设备id
- int64 device_id = 1;
- // 设备名
- string device_name = 2;
- // 序列号
- string sn = 3;
- // 厂商
- string manufactor = 4;
- // 授权key
- string auth_key = 5;
- // 1支持二维码 2 不支持
- int32 qcode_support = 6;
- // 协议
- int32 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;
- string protocol_desc = 16;
- // 1 支持人脸 2 不支持
- int32 pic_support = 17;
- // 1 支持卡 2 不支持
- int32 card_support = 18;
- string user_name = 19;
- string password = 20;
- string ip = 21;
- string mac = 22;
- int64 port = 23;
- }
- message GateListRequest {
- int64 garden_id = 1;
- int64 page = 2;
- int64 page_size = 3;
- // 1 已出库 2 未出库
- int32 out = 4;
- int32 device_id = 5;
- string sn = 6;
- string device_name = 7;
- string manufactor = 8;
- repeated int64 unit_ids = 9;
- int32 qcode_support = 10;
- int32 pic_support = 11;
- int32 card_support = 12;
- }
- message GateListReply {
- int64 page = 1;
- int64 total = 2;
- repeated GateItem list = 3;
- }
- // 门禁信息
- message GateInfoRequest {
- int64 device_id = 1;
- string sn = 2;
- int32 protocol = 3;
- }
- message GateInfoReply {
- GateItem info = 1;
- }
- // 删除门禁
- message GateDelRequest {
- int64 device_id = 1;
- }
- message GateDelReply {
- }
- // 回收门禁
- message GateRecoveryRequest {
- int64 device_id = 1;
- }
- message GateRecoveryReply {
- }
- // 门禁启用停用
- message GateEnableRequest {
- int64 device_id = 1;
- int64 garden_id = 2;
- bool enable = 3;
- }
- message GateEnableReply {
- }
- // 小区端编辑位置或方向
- message GateSetRequest {
- int64 device_id = 1;
- int64 garden_id = 2;
- // 1 进场 2 出场 3 进出场
- int32 direction = 3;
- // 位置
- string location = 4;
- string gate_name = 5;
- string user_name = 6;
- string password = 7;
- string ip = 8;
- string mac = 9;
- int64 port = 10;
- }
- message GateSetReply {
- }
- // 门禁添加远程命令
- message GateCommandAddRequest {
- // 1 远程开门;
- // 2 重启设备;
- // 4 获取设备参数;
- // 5 设置设备参数; 6 下载白名单;
- // 7 清空本地所有白名单;
- // 8 清空本地所有刷卡记录;
- // 9 扫码显示参数;
- // 10 查询卡号是否存在白名单
- // 99 恢复出厂;
- int32 cmd_code = 1;
- string cmd_params = 2;
- int64 device_id = 3;
- }
- message GateCommandAddReply {
- }
- // 门禁命令列表
- message GateCommandListRequest {
- int64 device_id = 1;
- int32 status = 2;
- int64 start = 3;
- int64 end = 4;
- int64 page = 5;
- int64 page_size = 6;
- }
- message GateCommandItem {
- int64 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 GateCommandResultRequest {
- int64 id = 1;
- int32 cmd_code = 2;
- int32 result_status = 3;
- string result_desc = 4;
- string sn = 5;
- int32 protocol = 6;
- string content = 7;
- }
- message GateCommandResultReply {
- bool has_task = 1;
- }
- // 获取一条命令用于执行
- message GateCommandUseRequest {
- string sn = 1;
- int32 protocol = 2;
- }
- message GateCommandUseReply {
- int64 id = 1;
- int32 cmd_code = 2;
- string cmd_params = 3;
- }
- message GateUnitAddRequest {
- int64 device_id = 1;
- repeated int64 unit_id = 2;
- int64 garden_id = 3;
- }
- message GateUnitAddReply {
- }
- message GateUnitListRequest {
- int64 device_id = 1;
- int64 garden_id = 2;
- }
- message GateUnitListReply {
- repeated int64 unit_id = 3;
- }
- message GateUnitDeviceRequest {
- int64 garden_id = 1;
- repeated int64 unit_id = 2;
- }
- message GateUnitDeviceReply {
- repeated GateItem list = 1;
- }
- message GateUserPicAddRequest {
- int64 garden_id = 1;
- int64 unit_id = 2;
- int64 house_id = 3;
- string house_name = 4;
- int64 uid = 5;
- string id_number = 6;
- string name = 7;
- string pic_url = 8;
- string phone = 9;
- }
- message GateUserPicAddReply {
- }
- message GateUserPicInfoRequest {
- int64 garden_id = 1;
- int64 uid = 2;
- }
- message GateUserPicInfoReply {
- string pic_url = 1;
- // 1 待下发 2 已下发 3 下发失败
- int32 down_status = 2;
- // 1 待审核 2 审核通过 3 审核未通过
- int32 approve_status = 3;
- string feedback = 4;
- }
- message GateUserPicListRequest {
- int64 garden_id = 1;
- int32 down_status = 2;
- string name = 3;
- int64 page = 4;
- int64 page_size = 5;
- }
- message GateUserPicDevice {
- int64 device_id = 1;
- string device_name = 2;
- int32 down_status = 3;
- }
- message GateUserPicItem {
- int64 id = 1;
- int64 uid = 2;
- string name = 3;
- string id_number = 4;
- string house_name = 5;
- int64 created_at = 6;
- int64 approved_at = 7;
- int32 approve_status = 8;
- int32 down_status = 9;
- repeated GateUserPicDevice gate_permissions = 10;
- }
- message GateUserPicListReply {
- int64 page = 1;
- int64 total = 2;
- repeated GateUserPicItem list = 3;
- }
- message GateUserPicApproveRequest {
- int64 garden_id = 1;
- int64 id = 2;
- bool status = 3;
- string feedback = 4;
- }
- message GateUserPicApproveReply {
- }
- message GateUserPicSyncRequest {
- int64 id = 1;
- int64 garden_id = 2;
- }
- message GateUserPicSyncReply {
- }
- message GateCardAddRequest {
- string card_number = 1;
- int64 garden_id = 2;
- string name = 3;
- repeated int64 device_ids = 4;
- }
- message GateCardAddReply {
- }
- message GateCardListRequest {
- int64 garden_id = 1;
- int32 down_status = 2;
- string name = 3;
- int64 page = 4;
- int64 page_size = 5;
- }
- message GateCardDevice {
- int64 device_id = 1;
- string device_name = 2;
- int32 down_status = 3;
- }
- message GateCardItem {
- int64 id = 1;
- string name = 2;
- string card_number = 3;
- int64 created_at = 4;
- int32 down_status = 5;
- repeated GateCardDevice gate_permissions = 6;
- }
- message GateCardListReply {
- int64 page = 1;
- int64 total = 2;
- repeated GateCardItem list = 3;
- }
- message GateCardSyncRequest {
- int64 id = 1;
- int64 garden_id = 2;
- }
- message GateCardSyncReply {
- }
- // 白名单匹配
- message GateWhiteMatchRequest {
- string sn = 1;
- int32 protocol = 2;
- string code_val = 3;
- int32 code_type = 4;
- }
- message GateWhiteMatchReply {
- int32 status = 1;
- string uid = 2;
- string card_number = 3;
- string id_number = 4;
- string phone = 5;
- string device_name = 6;
- string location = 7;
- int32 direction = 8;
- string name = 9;
- string house_name = 10;
- int64 device_id = 11;
- int64 garden_id = 12;
- }
- // 门禁更新状态
- message GateOnlineRequest {
- string sn = 1;
- int32 protocol = 2;
- }
- message GateOnlineReply {
- bool has_task = 1;
- }
- // 添加进出场记录
- message GateRecordAddRequest {
- int64 device_id = 1;
- string sn = 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;
- string visitor_name = 15;
- string visitor_phone = 16;
- int32 protocol = 17;
- // 1 二维码 2 刷卡 3 人脸
- int32 open_type = 18;
- }
- message GateRecordAddReply {
- }
- // 门禁进出场记录列表
- message GateRecordListRequest {
- int64 page = 1;
- int64 page_size = 2;
- string device_id = 3;
- int64 start = 4;
- int64 end = 5;
- int32 is_visitor = 6;
- }
- 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;
- string visitor_name = 15;
- string visitor_phone = 16;
- // 1 二维码 2 刷卡 3 人脸
- int32 open_type = 17;
- string sn = 18;
- int32 protocol = 19;
- }
- message GateRecordListReply {
- int64 page = 1;
- int64 total = 2;
- repeated GateRecordItem list = 3;
- }
- message GateVisitorAddRequest {
- int64 uid = 1;
- string name = 2;
- string phone = 3;
- string visitor = 4;
- string visitor_phone = 5;
- int64 device_id = 6;
- int64 start = 7;
- int64 end = 8;
- int64 garden_id = 9;
- string comment = 10;
- }
- message GateVisitorAddReply {
- int64 id = 1;
- string qcode = 2;
- }
- message GateVisitorListRequest {
- int64 uid = 1;
- int64 device_id = 2;
- string name = 3;
- string visitor = 4;
- int64 start = 5;
- int64 end = 6;
- int64 page = 7;
- int64 page_size = 8;
- int64 id = 9;
- }
- message GateVisitorListItem {
- int64 uid = 1;
- string name = 2;
- string phone = 3;
- string visitor = 4;
- string visitor_phone = 5;
- int64 device_id = 6;
- int64 start = 7;
- int64 end = 8;
- // 1 未通行 2 已同行 3 已过期
- int64 status = 9;
- int64 open_time = 10;
- string gate_name = 11;
- int64 id = 12;
- string comment = 13;
- string qcode = 14;
- string location = 15;
- string garden_name = 16;
- }
- message GateVisitorListReply {
- int64 page = 1;
- int64 total = 2;
- repeated GateVisitorListItem list = 3;
- }
- message GateVisitorCheckRequest {
- int64 id = 1;
- int64 open_time = 2;
- int64 device_id = 3;
- }
- message GateVisitorCheckReply {
- }
- message GateVisitorDelRequest {
- int64 id = 1;
- int64 uid = 2;
- bool manager = 3;
- }
- message GateVisitorDelReply {
- }
- message MqttFaceGateRequest {
- }
- message MqttFaceGateReply {
- repeated string sns = 1;
- }
|