1、编辑 proto 文件

syntax = "proto3";

package proto;

service GeekAuth {
    // 获取目标权限树
    rpc Tree(TreeReq) returns (TreeRsp){};
}

// 获取目标权限树 请求参数
message TreeReq {
    string appKey = 1;                // 字符串类型,参数名为 appKey
    string secretKey = 2;
    int64 target  = 3;                  //  整型,参数名为 target
    repeated int64 authId = 4;    // 数组类型,数组内元素类型为整型
}    

// 获取目标权限树 返回内容 
message TreeRsp {
    int64 code = 1;
    string message = 2;
    string data = 3;            //  data 为 json 字符串
}
demo.proto

相关文章: