112 lines
3.2 KiB
Protocol Buffer
112 lines
3.2 KiB
Protocol Buffer
|
|
// @file
|
||
|
|
// @brief
|
||
|
|
// @author xuyang
|
||
|
|
|
||
|
|
syntax="proto2";
|
||
|
|
import "Public.proto";
|
||
|
|
package iot_idl;
|
||
|
|
|
||
|
|
//========================================================================================
|
||
|
|
// 消息类型枚举
|
||
|
|
//========================================================================================
|
||
|
|
enum enRdbServerMessage
|
||
|
|
{
|
||
|
|
MT_DBMS_RTDATA_NET_REQUEST = 1; // 网络实时数据请求
|
||
|
|
MT_DBMS_RTDATA_NET_REPLAY = 2; // 网络实时数据响应
|
||
|
|
MT_DBMS_RTDATA_NET_DELETECLI = 3; // 网络删除客户端
|
||
|
|
MT_DBMS_RTDATA_SYN_SUDDEN = 4; // 突发同步
|
||
|
|
MT_DBMS_RTDATA_SYN_SNAP = 5; // 快照同步
|
||
|
|
MT_DBMS_RTDATA_SYN_SNAP_REQUEST = 6; // 请求快照同步
|
||
|
|
MT_DBMS_RTDATA_SYN_VALUETABLE = 7; // 同步数值表
|
||
|
|
}
|
||
|
|
|
||
|
|
//消息定义
|
||
|
|
//========================================================================================
|
||
|
|
message RdbCondition{
|
||
|
|
optional ENConditionLogic enLogic =1;
|
||
|
|
required ENConditionRelation enRelation=2;
|
||
|
|
required string strColumnName =3;
|
||
|
|
required SVariable msgValue =5;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RdbRecord{
|
||
|
|
repeated SVariable msgValueArray =1;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RdbUpdateValue{
|
||
|
|
required string strColumnName =1;
|
||
|
|
required SVariable msgValue =2;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RdbQuery{
|
||
|
|
required string strTableName = 1;
|
||
|
|
repeated string strSelectColNameArr =2;
|
||
|
|
repeated string strOrderColNameArr =3;
|
||
|
|
repeated RdbCondition msgCondition =4;
|
||
|
|
optional int32 nAsc = 5[default = 1];
|
||
|
|
}
|
||
|
|
|
||
|
|
message RdbInsert{
|
||
|
|
required string strTableName = 1;
|
||
|
|
repeated string strColumnName =2;
|
||
|
|
repeated RdbRecord msgData =3;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RdbRemove{
|
||
|
|
required string strTableName = 1;
|
||
|
|
repeated RdbCondition msgCondtionArray=2;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RdbUpdate{
|
||
|
|
required string strTableName = 1;
|
||
|
|
repeated RdbCondition msgCondition =2;
|
||
|
|
repeated RdbUpdateValue msgUpdateValue =3;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RdbLockTable{
|
||
|
|
required string strTableName = 1;
|
||
|
|
required bool bLock =2; //true lock, else false unlock
|
||
|
|
}
|
||
|
|
|
||
|
|
message RdbRet{
|
||
|
|
required int32 ret = 2[default = 0]; //0 is ok ,else mean an error is occur
|
||
|
|
repeated RdbRecord msgRecord = 3;
|
||
|
|
optional string strErr = 4;
|
||
|
|
}
|
||
|
|
|
||
|
|
// 请求消息
|
||
|
|
//========================================================================================
|
||
|
|
message RdbRequest{
|
||
|
|
required string strSessionID = 1;
|
||
|
|
required string strPackageId = 2;
|
||
|
|
optional RdbQuery msgQuery = 4;
|
||
|
|
optional RdbInsert msgInsert = 5;
|
||
|
|
optional RdbRemove msgRemove = 6;
|
||
|
|
optional RdbUpdate msgUpdate = 7;
|
||
|
|
optional RdbLockTable msgLock = 8;
|
||
|
|
}
|
||
|
|
|
||
|
|
// 回复消息
|
||
|
|
//========================================================================================
|
||
|
|
message RdbReply{
|
||
|
|
required string strSessionID = 1;
|
||
|
|
required string strPackageId = 3;
|
||
|
|
required RdbRet ret = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
// 同步更新消息PKG
|
||
|
|
//========================================================================================
|
||
|
|
message RdbReplace{
|
||
|
|
required string strSessionID = 1;
|
||
|
|
required string strTableName = 2;
|
||
|
|
repeated RdbSynUpdate msgUpdate = 3;
|
||
|
|
}
|
||
|
|
|
||
|
|
// 同步更新消息
|
||
|
|
//========================================================================================
|
||
|
|
message RdbSynUpdate{
|
||
|
|
repeated RdbCondition msgCondition =1;
|
||
|
|
repeated RdbUpdateValue msgUpdateValue =2;
|
||
|
|
optional string strKeys =3;
|
||
|
|
}
|