package mmbizappinfo;

import "comm2/tlvpickle/skbuiltintype.proto";

message SecretInfo {
    optional uint32 AppUin = 1;
    optional string AppId = 2;
    optional string SecretKey = 3;
    optional string SecretMD5 = 4;
    optional string SecretAES = 5;
    optional uint32 PwdKeyType = 6;
    optional uint32 QQDev = 7;
    optional uint32 OpenAppType = 8;
    optional string LastSecretMD5 = 9;
    optional uint32 SecretRefreshTime = 10;
}

message ExtSecretInfo {
    optional uint32 SecretID = 1;
    optional string SecretMD5 = 2;
}

message ExtSecretInfoList {
    repeated ExtSecretInfo list = 2;
}

message AppInfo {
    optional uint32 AppUin = 1;
    optional string AppId = 2;
    optional bytes NickName = 3;
    optional bytes SecretKey = 4;
    repeated uint32 Type = 7;
    optional uint32 CreateTime = 8;
    optional uint32 UpdateTime = 9;
    optional bytes DevInfo = 10;
    optional uint32 Version = 11;
    optional uint32 OpenAppType = 12;
    optional uint32 QQDev = 13;
    optional uint32 DBId = 14;
    optional bytes SearchName = 15;
    optional int32  Recommend = 16; //mp平台用户主动设置『是否允许通过昵称搜索』，为-1表示不能通过昵称搜索，只能通过id搜索。后台禁搜公众号请使用mmsearchgateway下mmbizsearchproxyclient接口

    optional int32  State = 17;
    optional uint32 OwnerUin = 18;

    optional int32 SrcIdc = 19;
    optional int32 CurIdc = 20;
    optional int32 TargetIdc = 21;
    optional int32 MigrateFlag = 22;

    optional int32 funcflag = 23;

    optional uint32 PwdKeyType = 24;
    optional bytes SecretMD5 = 25;
    optional bytes SecretAES = 26;
    optional ExtSecretInfoList ExtSecret = 27;

    optional uint32 OpenIDIndex = 28 [default=1];
    optional uint32 OpenGIDIndex = 29;

    optional bytes LastSecretMD5 = 30;
    optional uint32 SecretRefreshTime = 31;

    optional uint32 migratetime = 9998;
    optional uint64 seq = 9999;

    optional int32 fromidc = 3333;
}

message AppInfoList {
    repeated AppInfo app_info = 1;
}

message AppType {
    optional uint32 AppUin = 1;
    optional uint32 Type = 2;
}

message AppBindInfo {
    optional uint32 Type = 1;
    optional uint32 MasterUin = 2;
    optional uint32 SlaveUin = 3;
    optional uint32 CreateTime = 4;

    optional uint32 DelFlag = 5;
    optional uint32 UpdateTime = 6;

    optional uint64 seq = 9999;
}

message AppBindInfos
{
    repeated AppBindInfo list = 1;
    optional int32 fromidc = 3333;
}

message SlaveInfo {
    optional uint32 SlaveUin = 1;
    optional uint32 CreateTime = 2;
}

message MasterInfo {
    optional uint32 MasterUin = 1;
    repeated SlaveInfo SlaveInfo = 2;
}

message MpHelperInfo {
    optional uint32 AppUin = 1;
    optional uint32 BindUin = 2;
    optional uint32 CreateTime = 3;
    repeated uint32 AppUinList = 4; // 1 useruin can bind 5 bizuin
    optional uint32 FuncFlag = 5[default = 0];
}

message OwnerInfo {
    optional uint32 OwnerUin = 1;
    optional uint32 AppUin = 2;
    optional uint32 CreateTime = 3;
}

message OwnerInfos {
    optional uint32 OwnerUin = 1;
    repeated uint32 AppUin = 2;
}

// OwnerInfos with additional deleted flag
message AllOwnerInfos{
    optional uint32 OwnerUin = 1;
    repeated MoreAppInfo AppInfo = 2;
}

message MoreAppInfo
{
    optional uint32 AppUin = 1;
    optional uint32 DelFlag = 2;
}

message CommBindInfo {
    optional uint32 ParentUin = 1;
    optional uint32 SonUin = 2;
    optional uint32 CreateTime = 3;
    optional uint32 type = 4;
}

message CommBindInfos {
    optional uint32 ParentUin = 1;
    repeated uint32 SonUin = 2;
    optional uint32 type = 3;
}

message CommBindInfoIgnoreDelFlag {
    optional uint32 ParentUin = 1;
    optional uint32 SonUin = 2;
    optional uint32 CreateTime = 3;
    optional uint32 DelFlag = 4;
}

message  AllCommBindInfosIgnoreDelFlag {
    optional uint32 ParentUin = 1;
    repeated CommBindInfoIgnoreDelFlag commbindinfos = 2;
    optional uint32 type = 3;
}

message GetCommBindInfosByParentReq 
{
    optional uint32 ParentUin = 1;
    optional uint32 type = 2;
}

message GetCommBindInfoBySonReq
{
    optional uint32 SonUin = 1;
    optional uint32 type = 2;
}

message GetAllCommBindInfosByParentReq
{
    optional uint32 ParentUin= 1;
    optional uint32 type = 2;
}

message ServiceInfo {
    optional uint32 AppUin = 1;
    optional uint32 ServiceUin = 2;
    optional uint32 CreateTime = 3;
}

message GetAppInfoByAppIdReq {
    optional string AppId = 1;
}

message GetAppInfoByAppUinReq {
    optional uint32 AppUin = 1;
}

message GetMpHelperInfoByAppUinReq {
    optional uint32 AppUin = 1;
}

message GetMpHelperInfoByBindUinReq {
    optional uint32 BindUin = 1;
}

message GetMasterInfoByMasterReq {
    optional uint32 MasterUin = 1;
}

message GetMasterInfoBySlaveReq {
    optional uint32 SlaveUin = 1;
}

message GetOwnerInfoByAppUinReq {
    optional uint32 AppUin = 1; 
}

message GetOwnerInfosByOwnerUinReq {
    optional uint32 OwnerUin = 1; 
}

message BatchGetAppInfoByAppUinReq {
    repeated uint32 AppUin = 1;
}

message BatchGetAppInfoByAppUinResp {
    repeated AppInfo AppInfo = 1;
}

message BatchGetAppInfoByAppIdReq {
    repeated string AppId = 1;
}

message BatchGetAppInfoByAppIdResp {
    repeated AppInfo AppInfo = 1;
}

message GetAppInfoByTypeReq {
    optional uint32 Type = 1;
    optional uint32 Offset = 3;
    optional uint32 Limit = 4;
    optional int32 Recommend = 5;
}

message GetAppInfoByTypeResp {
    repeated AppInfo AppInfo = 1;
}

message GetServiceInfoByAppUinReq {
    optional uint32 AppUin = 1;
}

message GetServiceInfoByServiceUinReq {
    optional uint32 ServiceUin = 2;
}

message GetAppListByQQDevReq {
    optional uint32 QQ = 1;
}

message GetAppListByQQDevResp {
    repeated uint32 AppUin = 1; 
}

message RefreshSecretKeyReq {
    optional uint32 AppUin = 1;
}

message RefreshSecretKeyByAppIdReq {
    optional string AppId = 1;
    optional string SecretKey = 2;
}

message IsNickNameExistReq {
    optional bytes nick_name = 1;
    optional uint32 open_app_type = 2;
}

message BindEnterpriseReq {
    optional uint32 MasterUin = 1;
    optional uint32 SlaveUin = 2;
}

message UnBindEnterpriseReq {
    optional uint32 MasterUin = 1;
    optional uint32 SlaveUin = 2;
}

message EnterpriseInfo {
    optional uint32 MasterUin = 1;
    repeated uint32 SlaveUin = 2;
    optional uint32 CreateTime = 3;
    optional uint32 UpdateTime = 4;
}

message GetEnterpriseInfoByMasterReq {
    optional uint32 MasterUin = 1;
}

message GetEnterpriseInfoBySlaveReq {
    optional uint32 SlaveUin = 1;
}

message GetSuggestAppUinResp {
    repeated uint32 AppUin = 1;
}

message AppIdAndSecretKeyInfo {
    optional string AppId = 1;
    optional string SecretKey = 2;
}

message SecureDataTicketInfo
{
    optional uint32 uin = 1;
    optional bytes data_ticket = 2;
    optional uint32 secretid = 3;
}

message AppUinAndSecretKeyInfo {
    optional uint32 AppUin = 1;
    optional string SecretKey = 2;
};

message GetNewSecureTicketInfoReq {
    optional uint32 UserUin = 1;
    optional uint32 BizUin = 2;
};

message GetSecureTicketInfoForOpenReq {
    optional uint32 LoginUin = 1;
    optional uint32 OperateUin = 2;
};

message GetSecureTicketInfoForEnterpriseReq {
    optional uint32 LoginUin = 1;
    optional uint32 OperateUin = 2;
};

message GetSecureDataTicketReq {
    optional uint32 AppUin = 1;
}

message RefreshSecretInfoReq {
    optional uint32 AppUin = 1;
    optional string SecretMD5 = 2;
    optional string SecretAES = 3;
    optional uint32 PwdKeyType = 4;
    optional string SecretKey = 5;
    optional uint32 WriteType = 6;
}

message BindComponentPayInfoReq
{
    optional uint32 component_bizuin = 1;
    optional uint32 pay_bizuin = 2;
}

message UnBindComponentPayInfoReq 
{
    optional uint32 component_bizuin = 1;
    optional uint32 pay_bizuin = 2;
}

message ComponentPayInfo 
{
    optional uint32 component_bizuin = 1;
    optional uint32 pay_bizuin = 2;
    optional uint32 create_time = 3;
}

//--for kv dao begin--
message AppIdInfo
{
    optional uint32 appuin = 1;
    optional string appid = 2;
}

message NickNameInfo
{
    optional string nickname = 1;
    repeated uint32 appuin_list = 2;
}

message NickNameInfos
{
    repeated NickNameInfo list = 1;
}

message AppTypeInfo
{
    optional uint32 appuin = 1;
    repeated uint32 type_list = 2;
}

message AppTypeUinInfo
{
    optional uint32 type = 1;
    repeated uint32 appuin_list = 2;
}

message RetryWriteActionReq {
    enum Type {
        kType_AddAppInfo = 1;
        kType_UpdateAppInfo = 2;
    }
    optional Type type = 1;
    optional AppInfo appinfo = 2;
}

service MMBizAppInfo {

    option( tlvpickle.Magic ) = 12285;

    rpc AddAppInfo( AppInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 1;
        option( tlvpickle.OptString ) = "p:a:n:d:t:r:";
        option( tlvpickle.Usage ) = "-p <appuin> -a <appid> -n <nickname(gbk)> -d <devinfo> -t <type:1;2> -r <recommend>";
    }

    rpc UpdateAppInfo( AppInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 2;
        option( tlvpickle.OptString ) = "p:n:d:t:r:q:";
        option( tlvpickle.Usage ) = "-p <appuin> -n <nickname(gbk)> -d <devinfo> -t <type:1;2> -r <recommend> -q <qqdev>";
    }

    rpc GetAppInfoByAppId( GetAppInfoByAppIdReq ) returns ( AppInfo ) {
        option( tlvpickle.CmdID ) = 3;
        option( tlvpickle.OptString ) = "a:j:";
        option( tlvpickle.Usage ) = "-a <appid> -j <json output: optional>";
    }

    rpc GetAppInfoByAppUin( GetAppInfoByAppUinReq ) returns ( AppInfo ) {
        option( tlvpickle.CmdID ) = 4;
        option( tlvpickle.OptString ) = "p:j:d:";
        option( tlvpickle.Usage ) = "-p <appuin> -j <json output: optional> [-d <idc>]";
    }

    rpc AddMasterInfo( MasterInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 9;
        option( tlvpickle.OptString ) = "m:s:";
        option( tlvpickle.Usage ) = "-m <masteruin> -s <slaveuin>";
    }

    rpc GetMasterInfoByMaster( GetMasterInfoByMasterReq ) returns ( MasterInfo ) {
        option( tlvpickle.CmdID ) = 10;
        option( tlvpickle.OptString ) = "m:";
        option( tlvpickle.Usage ) = "-m <masteruin>";
    }

    rpc GetMasterInfoBySlave( GetMasterInfoBySlaveReq ) returns ( MasterInfo ) {
        option( tlvpickle.CmdID ) = 11;
        option( tlvpickle.OptString ) = "s:";
        option( tlvpickle.Usage ) = "-s <slaveuin>";
    }

    rpc BindOwnerInfo( OwnerInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 12;
        option( tlvpickle.OptString ) = "o:p:";
        option( tlvpickle.Usage ) = "-o <owneruin> -p <appuin>";
    }

    rpc UnBindOwnerInfo( OwnerInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 13;
        option( tlvpickle.OptString ) = "o:p:";
        option( tlvpickle.Usage ) = "-o <owneruin> -p <appuin>";
    }

    rpc GetOwnerInfoByAppUin( GetOwnerInfoByAppUinReq ) returns ( OwnerInfo ) {
        option( tlvpickle.CmdID ) = 14;
        option( tlvpickle.OptString ) = "p:";
        option( tlvpickle.Usage ) = "-p <appuin>";
    }

    rpc BatchGetAppInfoByAppUin( BatchGetAppInfoByAppUinReq ) returns ( BatchGetAppInfoByAppUinResp ) {
        option( tlvpickle.CmdID ) = 15;
        option( tlvpickle.OptString ) = "p:j:";
        option( tlvpickle.Usage ) = "-p <appuins:appuina;appuinb> -j <json output: optional>";
    }

    rpc GetAppInfoByType( GetAppInfoByTypeReq ) returns ( GetAppInfoByTypeResp ) {
        option( tlvpickle.CmdID ) = 16;
        option( tlvpickle.OptString ) = "t:r:o:l:";
        option( tlvpickle.Usage ) = "-t <type> [-r <recommend>] [-o <offset>] [-l <limit>]";
    }

    rpc GetAppIdAndSecretKeyByAppUin(tlvpickle.SKBuiltinUint32_PB) returns ( AppIdAndSecretKeyInfo ) {
        option( tlvpickle.CmdID ) = 22;
        option( tlvpickle.OptString ) = "p:";
        option( tlvpickle.Usage ) = "-p <appuin>";
    }

    rpc CheckSecretKey(AppIdAndSecretKeyInfo) returns ( SecureDataTicketInfo ) {
        option( tlvpickle.CmdID ) = 23;
        option( tlvpickle.OptString ) = "a:s:";
        option( tlvpickle.Usage ) = "-a <appid> -s <secretkey>";
    }

    rpc GetAppListByQQDev( GetAppListByQQDevReq ) returns ( GetAppListByQQDevResp ) {
        option( tlvpickle.CmdID ) = 25;
        option( tlvpickle.OptString ) = "q:";
        option( tlvpickle.Usage ) = "-q <qq>";
    }

    rpc BatchGetAppInfoByAppId( BatchGetAppInfoByAppIdReq ) returns ( BatchGetAppInfoByAppIdResp ) {
        option( tlvpickle.CmdID ) = 26;
        option( tlvpickle.OptString ) = "a:j:";
        option( tlvpickle.Usage ) = "-a <appids:appida;appidb> -j <json output: optional>";
    }

    rpc RefreshSecretKey( RefreshSecretKeyReq ) returns ( tlvpickle.SKBuiltinString_PB ) {
        option( tlvpickle.CmdID ) = 27;
        option( tlvpickle.OptString ) = "p:";
        option( tlvpickle.Usage ) = "-p <appuin>";
    }

    rpc RefreshSecretKeyByAppId( RefreshSecretKeyByAppIdReq ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 28;
        option( tlvpickle.OptString ) = "a:s:";
        option( tlvpickle.Usage ) = "-a <appid> -s <secretkey>";
    }

    // check user_uin bind biz_uin first
    rpc GetNewSecureTicketInfo( GetNewSecureTicketInfoReq ) returns(SecureDataTicketInfo) {
        option( tlvpickle.CmdID ) = 29;
        option( tlvpickle.OptString ) = "u:d:b:";
        option( tlvpickle.Usage ) = "-u <user_uin> -d <data_ticket> -b <biz_uin>";
    }

    rpc IsNickNameExist( IsNickNameExistReq ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 34;
        option( tlvpickle.OptString ) = "n:t:";
        option( tlvpickle.Usage ) = "-n <nickname> -t <openAppType>";
    }

    rpc GetOwnerInfosByOwnerUin( GetOwnerInfosByOwnerUinReq ) returns ( OwnerInfos ) {
        option( tlvpickle.CmdID ) = 35;
        option( tlvpickle.OptString ) = "o:";
        option( tlvpickle.Usage ) = "-o <owneruin>";
    }

    rpc GetSuggestAppUin( tlvpickle.SKBuiltinEmpty_PB ) returns ( GetSuggestAppUinResp ) {
        option( tlvpickle.CmdID ) = 40;
        option( tlvpickle.OptString ) = "";
        option( tlvpickle.Usage ) = "";
    }

    rpc CoverSetAppInfo( AppInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB )
    {
        option( tlvpickle.CmdID ) = 41;
        option( tlvpickle.OptString ) = "s:d:";
        option( tlvpickle.Usage ) = "-s <binary source file> -d <dst idc num>";

        option( tlvpickle.NeedExtEnd ) = 1;
    }

    rpc CoverSetBindInfo( AppBindInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB )
    {
        option( tlvpickle.CmdID ) = 42;
        option( tlvpickle.OptString ) = "s:d:";
        option( tlvpickle.Usage ) = "-s <binary source file> -d <dst idc num>";
    }

    rpc CoverSetBindInfoForIDCQueueProcessor( AppBindInfos ) returns ( tlvpickle.SKBuiltinEmpty_PB )
    {
        option( tlvpickle.CmdID ) = 43;
        option( tlvpickle.OptString ) = "";
        option( tlvpickle.Usage ) = "";
        option( tlvpickle.NeedExtEnd ) = 1;
    }

    rpc DelMasterInfo( MasterInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 44;
        option( tlvpickle.OptString ) = "m:s:";
        option( tlvpickle.Usage ) = "-m <master uin> -s <slave uin>";
    }

    rpc FlushAppInfoToSlaveIDC( tlvpickle.SKBuiltinEmpty_PB ) returns ( tlvpickle.SKBuiltinEmpty_PB )
    {
        option( tlvpickle.CmdID ) = 45;
        option( tlvpickle.OptString ) = "p:";
        option( tlvpickle.Usage ) = "-p <appuin>";
    }

    rpc FlushBindInfoToSlaveIDC( mmbizappinfo.AppBindInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB )
    {
        option( tlvpickle.CmdID ) = 46;
        option( tlvpickle.OptString ) = "t:m:s:";
        option( tlvpickle.Usage ) = "-t <type> -m <master> -s <slave>";
    }

    rpc BindComponentPayInfo( BindComponentPayInfoReq ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 47;
        option( tlvpickle.OptString ) = "b:u:";
        option( tlvpickle.Usage ) = "-b <component_bizuin> -u <pay_bizuin>";
    }

    rpc UnBindComponentPayInfo( UnBindComponentPayInfoReq ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 48;
        option( tlvpickle.OptString ) = "b:u:";
        option( tlvpickle.Usage ) = "-b <component_bizuin> -u <pay_bizuin>";
    }

    rpc GetComponentPayInfoByComponentBizUin( tlvpickle.SKBuiltinEmpty_PB ) returns ( ComponentPayInfo ) {
        option( tlvpickle.CmdID ) = 49;
        option( tlvpickle.OptString ) = "b:";
        option( tlvpickle.Usage ) = "-b <component_bizuin>";
    }

    rpc GetComponentPayInfoByPayBizUin( tlvpickle.SKBuiltinEmpty_PB ) returns ( ComponentPayInfo ) {
        option( tlvpickle.CmdID ) = 50;
        option( tlvpickle.OptString ) = "u:";
        option( tlvpickle.Usage ) = "-u <pay_bizuin>";
    }

    rpc RealTimeGetAppInfoByAppId( GetAppInfoByAppIdReq ) returns ( AppInfo ) {
        option( tlvpickle.CmdID ) = 51;
        option( tlvpickle.OptString ) = "a:j:";
        option( tlvpickle.Usage ) = "-a <appid> -j <json output: optional>";
    }

    rpc RealTimeGetAppInfoByAppUin( GetAppInfoByAppUinReq ) returns ( AppInfo ) {
        option( tlvpickle.CmdID ) = 52;
        option( tlvpickle.OptString ) = "p:j:d:";
        option( tlvpickle.Usage ) = "-p <appuin> -j <json output: optional> [-d <idc>]";
    }

    rpc SetIDCInfo( AppInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB )
    {
        option( tlvpickle.CmdID ) = 90;
        option( tlvpickle.OptString ) = "p:c:t:m:k:";
        option( tlvpickle.Usage ) = "-p <appuin> -c <current_idc> -t <target_idc>(idc value 0 indicates `dont change`) -m <migrate flag> -k <perform idc>";
    }

    rpc GetIDCInfo( tlvpickle.SKBuiltinEmpty_PB ) returns ( AppInfo )
    {
        option( tlvpickle.CmdID ) = 91;
        option( tlvpickle.OptString ) = "p:";
        option( tlvpickle.Usage ) = "-p <appuin>";
    }

    rpc FakeAddType( tlvpickle.SKBuiltinEmpty_PB ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 101;
        option( tlvpickle.OptString ) = "p:t:";
        option( tlvpickle.Usage ) = "-p <appuin> -t <type>";
    }

    rpc FakeDelType( tlvpickle.SKBuiltinEmpty_PB ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 102;
        option( tlvpickle.OptString ) = "p:t:";
        option( tlvpickle.Usage ) = "-p <appuin> -t <type>";
    }

    rpc GetAppUinAndSecretKeyByAppId(GetAppInfoByAppIdReq) returns ( AppUinAndSecretKeyInfo ) {
        option( tlvpickle.CmdID ) = 103;
        option( tlvpickle.OptString ) = "p:";
        option( tlvpickle.Usage ) = "-p <appid>";
    }

    rpc GetSecureTicketInfoForOpen( GetSecureTicketInfoForOpenReq ) returns(SecureDataTicketInfo) {
        option( tlvpickle.CmdID ) = 104;
        option( tlvpickle.OptString ) = "u:b:d:";
        option( tlvpickle.Usage ) = "-u <login_uin> -b <operate_uin> -d <data_ticket>";
    }

    rpc GetAllOwnerInfosByOwnerUin( GetOwnerInfosByOwnerUinReq ) returns ( AllOwnerInfos ) {
        option( tlvpickle.CmdID ) = 106;
        option( tlvpickle.OptString ) = "o:";
        option( tlvpickle.Usage ) = "-o <owneruin>";
    }

    rpc FakeUpdateOpenAppType(tlvpickle.SKBuiltinEmpty_PB) returns (tlvpickle.SKBuiltinEmpty_PB) {
        option( tlvpickle.CmdID ) = 107;
        option( tlvpickle.OptString ) = "p:t:";
        option( tlvpickle.Usage ) = "-p <appuin> -t <open_app_type>";
    }

    /*
    rpc GetSecureDataTicket(GetSecureDataTicketReq) returns ( SecureDataTicketInfo ) {
        option( tlvpickle.CmdID ) = 108;
        option( tlvpickle.OptString ) = "u:";
        option( tlvpickle.Usage ) = "-u <appuin>";
    }
    */

    rpc RefreshSecretInfo(RefreshSecretInfoReq) returns (tlvpickle.SKBuiltinEmpty_PB) {
        option( tlvpickle.CmdID ) = 109;
        option( tlvpickle.OptString ) = "u:m:a:t:k:w:";
        option( tlvpickle.Usage ) = "-u <appuin> -m <secretmd5> -a <secretaes> -t <pwdkeytype> -k <secretkey> -w <writetype>";
    }

    rpc RefreshExtSecretInfo(ExtSecretInfoList) returns (tlvpickle.SKBuiltinEmpty_PB) {
        option( tlvpickle.CmdID ) = 110;
        option( tlvpickle.OptString ) = "u:";
        option( tlvpickle.Usage ) = "-u <appuin>";
    }

    rpc SetSrcIDCInfo( AppInfo ) returns ( tlvpickle.SKBuiltinEmpty_PB ) {
        option( tlvpickle.CmdID ) = 111;
        option( tlvpickle.OptString ) = "p:s:";
        option( tlvpickle.Usage ) = "-p <appuin> -s <src_idc> ";
    }

    rpc RefreshSecretInfoForShakeTV(RefreshSecretInfoReq) returns (tlvpickle.SKBuiltinEmpty_PB) {
        option( tlvpickle.CmdID ) = 112;
        option( tlvpickle.OptString ) = "u:m:a:t:k:w:";
        option( tlvpickle.Usage ) = "-u <appuin> -m <secretmd5> -a <secretaes> -t <pwdkeytype> -k <secretkey> -w <writetype>";
    }

    //////////////////////////////////
    //only support 1:N relation
    rpc BindCommBindInfo(CommBindInfo) returns (tlvpickle.SKBuiltinEmpty_PB) {
        option( tlvpickle.CmdID ) = 113;
        option( tlvpickle.OptString ) = "s:p:t:";
        option( tlvpickle.Usage ) = "-s <son> -p <parent> -t <type>";
    }

    rpc UnBindCommBindInfo(CommBindInfo) returns (tlvpickle.SKBuiltinEmpty_PB) {
        option( tlvpickle.CmdID ) = 114;
        option( tlvpickle.OptString ) = "s:p:t:";
        option( tlvpickle.Usage ) = "-s <son> -p <parent> -t <type>";
    }

    rpc GetCommBindInfosByParent(GetCommBindInfosByParentReq) returns (CommBindInfos) {
        option( tlvpickle.CmdID ) = 115;
        option( tlvpickle.OptString ) = "p:t:";
        option( tlvpickle.Usage ) = "-p <parent> -t <type>";
    }

    rpc GetCommBindInfoBySon(GetCommBindInfoBySonReq) returns (CommBindInfo) {
        option( tlvpickle.CmdID ) = 116;
        option( tlvpickle.OptString ) = "s:t:";
        option( tlvpickle.Usage ) = "-s <son> -t <type>";
    }

    rpc GetAllCommBindInfosIgnoreDelFlagByParent(GetAllCommBindInfosByParentReq) returns (AllCommBindInfosIgnoreDelFlag) {
        option( tlvpickle.CmdID ) = 117;
        option( tlvpickle.OptString ) = "p:t:";
        option( tlvpickle.Usage ) = "-p <parent> -t <type>";
    }
    //////////////////////////////////////

    rpc FakeSetIDCAndCoverSetAppInfo( tlvpickle.SKBuiltinEmpty_PB ) returns ( tlvpickle.SKBuiltinEmpty_PB )
    {
        option( tlvpickle.CmdID ) = 300;
        option( tlvpickle.OptString ) = "p:r:t:m:k:";
        option( tlvpickle.Usage ) = "-p <appuin> -r <current_idc> -t <target_idc>(idc value 0 indicates `dont change`) -m <migrate flag> -k <perform idc>";
    }

    rpc FakeSetMigrateFlag( AppInfo) returns ( tlvpickle.SKBuiltinEmpty_PB )
    {
        option( tlvpickle.CmdID ) = 301;
        option( tlvpickle.OptString ) = "p:d:l:";
        option( tlvpickle.Usage ) = "-p <appuin> -l <value  0, 1>  -d <index 0-31>";
    }

    rpc FakeUpdateAppVersion(tlvpickle.SKBuiltinEmpty_PB) returns (tlvpickle.SKBuiltinEmpty_PB)
    {
        option( tlvpickle.CmdID ) = 302;
        option( tlvpickle.OptString ) = "p:n:";
        option( tlvpickle.Usage ) = "-p <appuin> -n <new version>";
    }
}

