121 lines
2.9 KiB
Protocol Buffer
121 lines
2.9 KiB
Protocol Buffer
syntax = "proto3";
|
||
package passport;
|
||
option go_package = "./passport";
|
||
|
||
|
||
message FetchRequest {
|
||
int64 page_no=1; // 页数
|
||
int64 page_size=2; // 每页记录数
|
||
map<string,string> params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11
|
||
}
|
||
|
||
message IdentRequest{
|
||
int64 id = 1; // 唯一ID
|
||
string identity = 2; // 唯一码
|
||
}
|
||
|
||
message VersionRequest {
|
||
int64 version=1; // 时序版本号
|
||
}
|
||
|
||
|
||
message SearchRequest {
|
||
string keyword=1; //关键词
|
||
}
|
||
|
||
|
||
message StatusReply{
|
||
int64 status = 1; // 状态码
|
||
string identity=2; // 标识码
|
||
string message=3; //状态说明
|
||
int64 timeseq=4; // 响应时间序列
|
||
}
|
||
|
||
message Empty{
|
||
}
|
||
|
||
// Passport-通行证模块-登录
|
||
service Login{
|
||
// 通过密码登录
|
||
rpc Pwd(LoginByPwdRequest) returns (LoginReply) {}
|
||
|
||
// 通过验证码登录
|
||
rpc Code(LoginByCodeRequest) returns (LoginReply) {}
|
||
|
||
// 通过Wechat登录
|
||
rpc WeChatByCode(WeChatByCodeRequest) returns (WeChatByCodeReply) {}
|
||
rpc WeChatByPhone(WeChatByPhoneRequest) returns (WeChatByPhoneReply) {}
|
||
rpc WeChatGetUserinfo(WeChatByPhoneRequest) returns (WeChatGetUserinfoReply) {}
|
||
|
||
// 通过AppleID登录
|
||
rpc AppleID(LoginByAppleIDRequest) returns (LoginReply) {}
|
||
|
||
// 通过验证码登录并注册
|
||
rpc CodeAndRegister(LoginByCodeRequest) returns (LoginReply) {}
|
||
}
|
||
|
||
|
||
message LoginByPwdRequest {
|
||
string account = 1; // 账号 必填
|
||
string password = 2; // 密码 必填
|
||
string device = 3; // 设备 必填
|
||
}
|
||
|
||
|
||
message LoginByCodeRequest {
|
||
string country = 1; // 国家
|
||
string phone = 2; // 手机号码
|
||
string code = 3; // 验证码
|
||
string device = 4;// 设备
|
||
}
|
||
|
||
message WeChatByCodeRequest {
|
||
string code = 1; // WeChat code
|
||
int64 agency_id=2; // 代理ID
|
||
int64 staff_id=3; // 工作人员ID
|
||
}
|
||
|
||
message WeChatByPhoneReply {
|
||
string account = 1; // WeChat code
|
||
}
|
||
|
||
message WeChatByCodeReply {
|
||
string session_key = 1; // WeChat session key
|
||
string open_id = 2; // WeChat open id
|
||
string identity = 3; // identity
|
||
string account = 4; // account
|
||
}
|
||
|
||
message WeChatByPhoneRequest {
|
||
string session_key = 1; // WeChat session key
|
||
string open_id = 2; // open_id
|
||
string data = 3; // data
|
||
string iv = 4; // iv
|
||
string identity = 5; // identiy
|
||
}
|
||
|
||
message WeChatGetUserinfoReply {
|
||
int64 id=1;
|
||
string account=2;
|
||
string identity=3;
|
||
string nickname=4;
|
||
string avatar=5;
|
||
string rights=6;
|
||
string token=7;
|
||
}
|
||
|
||
message LoginByAppleIDRequest {
|
||
string apple_id = 1; // apple id
|
||
string desc = 2; // 描述
|
||
string device = 3;// 设备
|
||
}
|
||
|
||
message LoginReply {
|
||
int64 id=1;
|
||
string identity = 2; //用户唯一码
|
||
string data_bind = 3; // 数据绑定的相关说明,PASS通过,NOPHONE没有绑定手机号,NOPWD没有设置密码,NOBIND没有手机号同时没有密码
|
||
string token = 4; //用户凭证
|
||
map<string, string> extend = 5; //扩展字段
|
||
}
|
||
|