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.

61 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* @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){}
}