55 lines
1.1 KiB
Protocol Buffer
55 lines
1.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package auth;
|
|
|
|
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 LoginDefaultResp {
|
|
string token = 1;
|
|
string refreshToken = 2;
|
|
int64 userId = 3;
|
|
string username = 4;
|
|
int32 seqNo = 5;
|
|
int32 gender = 6;
|
|
}
|
|
|
|
message RegisterDefaultReq {
|
|
string Account = 1[(api.body)="account",(api.vd)="$!=''"];
|
|
string Password = 2[(api.body)="password",(api.vd)="$!=''"];
|
|
}
|
|
|
|
message RegisterDefaultResp {
|
|
|
|
}
|
|
|
|
message RefreshAccessTokenReq {
|
|
}
|
|
|
|
message RefreshAccessTokenResp {
|
|
string accessToken = 1;
|
|
}
|
|
|
|
service LoginService {
|
|
rpc LoginDefault(LoginDefaultReq) returns(LoginDefaultResp) {
|
|
option (api.post) = "/auth/login/default";
|
|
}
|
|
}
|
|
|
|
service RegisterService {
|
|
rpc RegisterDefault(RegisterDefaultReq) returns(RegisterDefaultResp) {
|
|
option (api.post) = "/auth/register/default";
|
|
}
|
|
}
|
|
|
|
service TokenService {
|
|
rpc RefreshAccessToken(RefreshAccessTokenReq) returns(RefreshAccessTokenResp) {
|
|
option (api.post) = "/auth/refreshToken";
|
|
}
|
|
} |