u
This commit is contained in:
1 parent
500fab7a80
commit
8f3f6982db
54 files changed
+2076
-1877
No files matched your search
@@ -6,56 +6,34 @@ option go_package = "auth";
|
||||
|
||||
import "api.proto";
|
||||
|
||||
// 登录请求
|
||||
message LoginDefaultReq {
|
||||
string Account = 1 [(api.body)="account", (api.vd)="$!=''"];
|
||||
string Password = 2 [(api.body)="password", (api.vd)="$!=''"];
|
||||
message LoginQqReq {
|
||||
string openid = 1;
|
||||
string username = 2;
|
||||
string avatar = 3;
|
||||
}
|
||||
|
||||
message LoginWxReq {
|
||||
string code = 1;
|
||||
}
|
||||
|
||||
// 登录响应
|
||||
message LoginDefaultResp {
|
||||
string Token = 1 [(api.body)="token"];
|
||||
string RefreshToken = 2 [(api.body)="refreshToken"];
|
||||
int64 UserId = 3 [(api.body)="userId"];
|
||||
string Username = 4 [(api.body)="username"];
|
||||
int32 SeqNo = 5 [(api.body)="seqNo"];
|
||||
int32 Gender = 6 [(api.body)="gender"];
|
||||
}
|
||||
|
||||
// 注册请求
|
||||
message RegisterDefaultReq {
|
||||
string Account = 1 [(api.body)="account", (api.vd)="$!=''"];
|
||||
string Password = 2 [(api.body)="password", (api.vd)="$!=''"];
|
||||
}
|
||||
|
||||
// 注册响应
|
||||
message RegisterDefaultResp {}
|
||||
|
||||
// 刷新 access token 请求
|
||||
message RefreshAccessTokenReq {}
|
||||
|
||||
// 刷新 access token 响应
|
||||
message RefreshAccessTokenResp {
|
||||
string AccessToken = 1 [(api.body)="accessToken"];
|
||||
message LoginResp {
|
||||
// JWT
|
||||
string token = 1 [(api.body)="token"];
|
||||
// 用户ID
|
||||
int64 userId = 2 [(api.body)="userId"];
|
||||
// 昵称
|
||||
string username = 3 [(api.body)="username"];
|
||||
// 头像
|
||||
string avatar = 4 [(api.body)="avatar"];
|
||||
}
|
||||
|
||||
// 登录服务
|
||||
service LoginService {
|
||||
rpc LoginDefault(LoginDefaultReq) returns(LoginDefaultResp) {
|
||||
option (api.post) = "/auth/login/default";
|
||||
rpc LoginQq(LoginQqReq) returns (LoginResp) {
|
||||
option (api.post) = "/auth/login/qq";
|
||||
}
|
||||
}
|
||||
|
||||
// 注册服务
|
||||
service RegisterService {
|
||||
rpc RegisterDefault(RegisterDefaultReq) returns(RegisterDefaultResp) {
|
||||
option (api.post) = "/auth/register/default";
|
||||
}
|
||||
}
|
||||
|
||||
// token 服务
|
||||
service TokenService {
|
||||
rpc RefreshAccessToken(RefreshAccessTokenReq) returns(RefreshAccessTokenResp) {
|
||||
option (api.get) = "/auth/refresh/token";
|
||||
rpc LoginWx(LoginWxReq) returns (LoginResp) {
|
||||
option (api.post) = "/auth/login/wx";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user