Files
proto/protofile/RpcServer/sources/service_third-party.proto

135 lines
5.1 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
syntax = "proto3";
option go_package = "git.hlsq.asia/alex/proto/proto/rs/rspb";
import "rs_common.proto";
import "google/api/annotations.proto";
service ThirdParty {
// ---------- 内部接口 ----------
// 校验验证码
rpc InnerCheckCode(InnerCheckCodeReq) returns (InnerCheckCodeResp) {}
// 校验验证码凭证
rpc InnerCheckCodeVoucher(InnerCheckCodeVoucherReq) returns (InnerCheckCodeVoucherResp) {}
// 踢所有端下线
rpc InnerKickOffline(InnerKickOfflineReq) returns (InnerKickOfflineResp) {}
// ---------- 后台接口 ----------
// ---------- 外部接口 ----------
// 登录
rpc AppLogin(AppLoginReq) returns (AppLoginResp) {option (google.api.http) = {post: "/third-party/open/login" body: "*"};}
// 绑定手机号
rpc AppBindPhone(AppBindPhoneReq) returns (AppLoginResp) {option (google.api.http) = {post: "/third-party/open/login_bind" body: "*"};}
// 刷新令牌
rpc AppRefreshToken(AppRefreshTokenReq) returns (AppRefreshTokenResp) {option (google.api.http) = {post: "/third-party/open/refresh_token" body: "*"};}
// 登出
rpc AppLogout(AppLogoutReq) returns (AppLogoutResp) {option (google.api.http) = {post: "/third-party/open/logout" body: "*"};}
// 发送验证码
rpc AppSendCode(AppSendCodeReq) returns (AppSendCodeResp) {option (google.api.http) = {post: "/third-party/open/send_code" body: "*"};}
// 获取验证码凭证
rpc AppGetCodeVoucher(AppGetCodeVoucherReq) returns (AppGetCodeVoucherResp) {option (google.api.http) = {post: "/third-party/open/code_voucher" body: "*"};}
}
// ---------- InnerCheckCode ----------
message InnerCheckCodeReq {
string CountryCode = 1 [json_name = "countryCode"]; // 国家码
string Phone = 2 [json_name = "phone"]; // 手机号
string Code = 3 [json_name = "code"]; // 验证码
}
message InnerCheckCodeResp {
bool Success = 1 [json_name = "success"];
}
// ---------- InnerCheckCodeVoucher ----------
message InnerCheckCodeVoucherReq {
string Voucher = 1 [json_name = "voucher"]; // 凭证
}
message InnerCheckCodeVoucherResp {
bool Success = 1 [json_name = "success"];
string Phone = 2 [json_name = "phone"];
}
// ---------- InnerKickOffline ----------
message InnerKickOfflineReq {
int64 USN = 1 [json_name = "usn"]; // 用户ID
}
message InnerKickOfflineResp {}
// ---------- AppLogin ----------
message AppLoginReq {
LoginType Type = 1 [json_name = "type"]; // 登录方式
PlatformType PlatformType = 2 [json_name = "platformType"]; // 平台类型
string CountryCode = 3 [json_name = "countryCode"]; // 国家码
string Phone = 4 [json_name = "phone"]; // 手机号
string Code = 5 [json_name = "code"]; // 验证码
string WxMiniCode = 6 [json_name = "wxMiniCode"]; // 微信小程序登录凭证
string WxAppCode = 7 [json_name = "wxAppCode"]; // 微信App登录凭证
string IdentityToken = 8 [json_name = "identityToken"]; // 苹果登录凭证
string FullName = 9 [json_name = "fullName"]; // 苹果全称
string Email = 10 [json_name = "email"]; // 邮箱
}
enum LoginType {
LOGIN_TYPE_UNKNOWN = 0;
LOGIN_TYPE_PHONE = 1; // 手机号
LOGIN_TYPE_WX_MINI = 2; // 微信小程序
LOGIN_TYPE_WX_APP = 3; // 微信App
LOGIN_TYPE_APPLE = 4; // 苹果
}
enum PlatformType {
PLATFORM_TYPE_UNKNOWN = 0;
PLATFORM_TYPE_GAME = 1; // 游戏(APP)
PLATFORM_TYPE_WX_MINI = 2; // 微信小程序
PLATFORM_TYPE_ADMIN = 3; // 后台
}
message AppLoginResp {
int32 Status = 1 [json_name = "status"]; // 状态 0 成功 1 需要绑定手机号
string Ticket = 2 [json_name = "ticket"]; // 凭证
int64 USN = 3 [json_name = "usn"]; // 用户ID
string AccessToken = 4 [json_name = "accessToken"];
string RefreshToken = 5 [json_name = "refreshToken"];
bool IsMaintain = 6 [json_name = "isMaintain"]; // 服务器是否在维护
}
// ---------- AppBindPhone ----------
message AppBindPhoneReq {
string Ticket = 1 [json_name = "ticket"]; // 凭证
string CountryCode = 2 [json_name = "countryCode"]; // 国家码
string Phone = 3 [json_name = "phone"]; // 手机号
string Code = 4 [json_name = "code"]; // 验证码
string MiniPhoneCode = 5 [json_name = "miniPhoneCode"]; // 微信小程序手机凭证
}
// ---------- AppRefreshToken ----------
message AppRefreshTokenReq {
string RefreshToken = 1 [json_name = "refreshToken"];
}
message AppRefreshTokenResp {
string AccessToken = 1 [json_name = "accessToken"];
string RefreshToken = 2 [json_name = "refreshToken"];
bool IsMaintain = 3 [json_name = "isMaintain"];
}
// ---------- AppLogout ----------
message AppLogoutReq {
string RefreshToken = 1 [json_name = "refreshToken"];
}
message AppLogoutResp {}
// ---------- AppSendCode ----------
message AppSendCodeReq {
string Phone = 1 [json_name = "phone"];
string CountryCode = 2 [json_name = "countryCode"];
}
message AppSendCodeResp {}
// ---------- AppGetCodeVoucher ----------
message AppGetCodeVoucherReq {
string CountryCode = 1 [json_name = "countryCode"]; // 国家码
string Phone = 2 [json_name = "phone"]; // 手机号
string Code = 3 [json_name = "code"]; // 验证码
}
message AppGetCodeVoucherResp {
string CodeVoucher = 1 [json_name = "codeVoucher"]; // 凭证
}