123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- 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 {
- }
|