You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.4 KiB

2 years ago
/**
* @Auth:ShenZ
* @Description:
*/
syntax = "proto3"; // 版本号
option go_package="./;proto"; //参数1 表示生成到哪个目录 参数2 表示生成的文件的package
package proto ; //默认在哪个包
//结构体
/**
"avatar": "",
"clientId": 0,
"employeeId": 0,
"id": 0,
"nickname": "",
"phone": "",
"sessionId": "",
"systemId": 0,
"token": "",
"tokenExpireTime": "",
"unionId": ""
**/
message User {
string avatar = 1;
int32 clientId = 2;
int32 employeeId =3;
string nickname = 4;
string phone = 5;
string sessionId = 6;
string token = 7;
string tokenExpireTime = 8;
string unionId = 9;
int32 id = 10;
}
/**
{
"clientId": 0,
"phone": "",
"systemId": 0,
"verificationCode": ""
}
**/
//请求 request struct
message LoginRequest {
int32 clientId = 1;
string phone = 2;
int32 systemId = 3;
string verificationCode = 4;
}
//响应 resp struct
message LoginResp{
string token = 1;
User user = 2;
}
//RPC 服务 接口
service Login {
//rpc 服务
rpc Login (LoginRequest) returns (LoginResp){}
}
2 years ago
// 获取 分布式 token
message TokenReq {
string uuid = 1;
}
//响应 resp struct
message TokenResp{
string token = 1;
bool isLogin=2;
}
//RPC 服务 接口
service GetUserToken {
//rpc 服务
rpc GetUserToken (TokenReq) returns (TokenResp){}
}