refactor: reorganize modules and add Linux build tooling
This commit is contained in:
82
module/base/passport/proto/account.proto
Normal file
82
module/base/passport/proto/account.proto
Normal file
@@ -0,0 +1,82 @@
|
||||
syntax = "proto3";
|
||||
package passport;
|
||||
option go_package = ".;passport";
|
||||
import "blocks.proto";
|
||||
|
||||
// assport通行证模块-帐号数据
|
||||
service Account{
|
||||
// 通过会员所有信息
|
||||
rpc Get(Empty) returns (GetFullReply) {}
|
||||
|
||||
// 更新会员的信息数据,字段值为空或是0,将不更新此数据
|
||||
rpc SetData(SetDataRequest) returns (StatusReply) {}
|
||||
|
||||
// 更新会员的密码
|
||||
rpc SetPassword(SetPasswordRequest) returns (StatusReply) {}
|
||||
|
||||
// 新增标签
|
||||
rpc TagCreate(TagItem) returns (StatusReply) {}
|
||||
|
||||
// 删除标签
|
||||
rpc TagRemove(IdentRequest) returns (StatusReply) {}
|
||||
|
||||
// 获取会员的相关统计数据
|
||||
rpc Statistics(StatisticsRequest) returns (StatisticsReply) {}
|
||||
}
|
||||
|
||||
// 获取会员的完整信息
|
||||
message GetFullReply {
|
||||
string identity = 1; // 唯一标识
|
||||
string account = 2; // 帐号
|
||||
string phone = 3; // 手机号码 必填
|
||||
string email = 4; // 验证码
|
||||
string rights = 5; // 权限
|
||||
string nickname = 6; // 昵称
|
||||
string avatar = 7; // 头像
|
||||
string birthday = 8; // 生日
|
||||
int32 sex = 9; // 性别,1为男性,2为女性
|
||||
string country = 10; // 国家
|
||||
string province = 11; // 省
|
||||
string city = 12; // 市
|
||||
string area = 13; // 区
|
||||
string sign = 14; // 签名
|
||||
string cover = 15; // 背景&封面
|
||||
int32 score = 16; // 积分
|
||||
int32 level = 17; // 等级
|
||||
VerifyStatus verify_status = 18; // 用户验证状态
|
||||
repeated TagItem tags = 19; // 用户标签
|
||||
}
|
||||
|
||||
message TagItem {
|
||||
string name = 1;
|
||||
string icon = 2;
|
||||
}
|
||||
|
||||
message SetDataRequest {
|
||||
string nickname = 1; //昵称
|
||||
string avatar = 2; //头像
|
||||
string birthday = 3; //生日
|
||||
int32 sex = 4; //性别,1为男性,2为女性
|
||||
string country = 5; // 国家
|
||||
string province = 6; //省
|
||||
string city = 7; //市
|
||||
string area = 8; //区
|
||||
string sign = 9; //签名
|
||||
string cover = 10; // 背景&封面
|
||||
int32 score = 11; // 积分
|
||||
int32 level = 12; // 等级
|
||||
}
|
||||
|
||||
message SetPasswordRequest {
|
||||
string old_password = 3; // 旧密码
|
||||
string new_password = 4;// 新密码
|
||||
}
|
||||
|
||||
|
||||
message StatisticsRequest {
|
||||
repeated string field = 1; //要获取的统计数据字段。
|
||||
}
|
||||
|
||||
message StatisticsReply {
|
||||
map<string,int64> Data=1; //数据以Map格式输出
|
||||
}
|
||||
43
module/base/passport/proto/blocks.proto
Normal file
43
module/base/passport/proto/blocks.proto
Normal file
@@ -0,0 +1,43 @@
|
||||
syntax = "proto3";
|
||||
package passport;
|
||||
option go_package = ".;passport";
|
||||
|
||||
message FetchRequest {
|
||||
int64 page_no=1; // 页数
|
||||
int64 page_size=2; // 每页记录数
|
||||
map<string,string> params=3; // 条件参数,key=val,eg key:category_id=?,vlaue=11
|
||||
}
|
||||
|
||||
message IdentRequest{
|
||||
int64 id = 1; // 唯一ID
|
||||
string identity = 2; // 唯一码
|
||||
}
|
||||
|
||||
message VersionRequest {
|
||||
int64 version=1; // 时序版本号
|
||||
}
|
||||
|
||||
|
||||
message SearchRequest {
|
||||
string keyword=1; //关键词
|
||||
}
|
||||
|
||||
|
||||
message StatusReply{
|
||||
int32 code=1; // 状态码
|
||||
string message=2; // 状态说明
|
||||
string details=3; // 数据
|
||||
int64 timeseq=4; // 响应时间序列
|
||||
}
|
||||
|
||||
message VerifyStatus {
|
||||
int32 email_verify=1; // 邮箱是否已验证
|
||||
int32 phone_verify=2; // 手机是否已验证
|
||||
int32 face_verify=3; // 人脸或照片是否已验证
|
||||
int32 document_verify=4; // 证件是否已验证
|
||||
int32 kyc_verify=5; // 实名是否已验证
|
||||
}
|
||||
|
||||
|
||||
message Empty{
|
||||
}
|
||||
24
module/base/passport/proto/forget.proto
Normal file
24
module/base/passport/proto/forget.proto
Normal file
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
package passport;
|
||||
option go_package = ".;passport";
|
||||
import "blocks.proto";
|
||||
|
||||
// Passport通行证模块-找回密码
|
||||
service Forget{
|
||||
// 验证手机号和验证码
|
||||
rpc Verify(ForgetVerifyRequest) returns(StatusReply) {}
|
||||
|
||||
// 重罢密码
|
||||
rpc Reset(ForgetResetRequest) returns (StatusReply) {}
|
||||
}
|
||||
|
||||
message ForgetVerifyRequest {
|
||||
string phone = 1; //手机号
|
||||
string code = 2; // 验证码
|
||||
}
|
||||
|
||||
|
||||
message ForgetResetRequest {
|
||||
string identity = 1; //唯一码
|
||||
string password = 2; // 密码
|
||||
}
|
||||
42
module/base/passport/proto/login.proto
Normal file
42
module/base/passport/proto/login.proto
Normal file
@@ -0,0 +1,42 @@
|
||||
syntax = "proto3";
|
||||
package passport;
|
||||
option go_package = ".;passport";
|
||||
import "blocks.proto";
|
||||
|
||||
// Passport-通行证模块-登录
|
||||
service Login{
|
||||
// 通过密码登录
|
||||
rpc Pwd(LoginByPwdRequest) returns (LoginReply) {}
|
||||
|
||||
// 通过验证码登录
|
||||
rpc Code(LoginByCodeRequest) returns (LoginReply) {}
|
||||
|
||||
// 通过验证码快捷登录并注册
|
||||
rpc Quick(LoginByCodeRequest) returns (LoginReply) {}
|
||||
}
|
||||
|
||||
|
||||
message LoginByPwdRequest {
|
||||
string account = 1; // 账号 必填
|
||||
string password = 2; // 密码 必填
|
||||
}
|
||||
|
||||
|
||||
message LoginByCodeRequest {
|
||||
string country = 1; // 国家
|
||||
string phone = 2; // 手机号码
|
||||
string code = 3; // 验证码
|
||||
int64 agency_id=4; // 代理ID
|
||||
int64 staff_id=5; // 工作人员ID
|
||||
int64 owner_id=6 [json_name="owner_id"];// 所属ID
|
||||
string owner_identity = 7 [json_name="owner_identity"];// 所属唯一码
|
||||
}
|
||||
|
||||
message LoginReply {
|
||||
int64 id=1;
|
||||
string identity = 2; //用户唯一码
|
||||
string token = 3; //用户凭证
|
||||
map<string, string> extend = 4; //扩展字段
|
||||
VerifyStatus verify_status = 5; // 用户验证状态
|
||||
}
|
||||
|
||||
35
module/base/passport/proto/register.proto
Normal file
35
module/base/passport/proto/register.proto
Normal file
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
package passport;
|
||||
option go_package = ".;passport";
|
||||
import "blocks.proto";
|
||||
|
||||
// Passport-通行证模块-注册
|
||||
service Register{
|
||||
// 帐号密码注册
|
||||
rpc Pwd(RegisterRequest) returns (RegisterReply) {}
|
||||
|
||||
// 手机验证码注册
|
||||
rpc Code(RegisterRequest) returns (RegisterReply) {}
|
||||
}
|
||||
|
||||
|
||||
message RegisterRequest {
|
||||
string country = 1; // 国家码,eg CN US
|
||||
string email = 2; //邮箱
|
||||
string account = 3; //帐号
|
||||
string phone = 4; //手机号
|
||||
string password = 5; //密码
|
||||
string code = 6; //验证码
|
||||
int64 agency_id=7; // 代理ID
|
||||
int64 staff_id=8; // 工作人员ID
|
||||
int64 owner_id=9 [json_name="owner_id"];// 所属ID
|
||||
string owner_identity = 10 [json_name="owner_identity"];// 所属唯一码
|
||||
}
|
||||
|
||||
message RegisterReply {
|
||||
int64 id=1;
|
||||
string identity = 2; //用户唯一码
|
||||
string token = 4; //用户Header所需Token
|
||||
map<string, string> extend = 5; //扩展字段
|
||||
VerifyStatus verify_status = 6; // 用户验证状态
|
||||
}
|
||||
54
module/base/passport/proto/verify.proto
Normal file
54
module/base/passport/proto/verify.proto
Normal file
@@ -0,0 +1,54 @@
|
||||
syntax = "proto3";
|
||||
package passport;
|
||||
option go_package = ".;passport";
|
||||
import "blocks.proto";
|
||||
|
||||
// Passport(会员通行证)-验证
|
||||
service Verify{
|
||||
// 认证请求
|
||||
rpc Request(VerifyRequest) returns (StatusReply) {}
|
||||
|
||||
// KYC 认证回调
|
||||
rpc JumioCallback(JumioCallbackPayload) returns (StatusReply) {}
|
||||
}
|
||||
|
||||
message VerifyRequest {
|
||||
string provider = 1; // 服务提供商
|
||||
map<string, string> args = 2; // 参数
|
||||
}
|
||||
|
||||
message JumioCallbackPayload {
|
||||
string scan_reference = 1;
|
||||
string customer_internal_reference = 2;
|
||||
VerificationStatus verification_status = 3;
|
||||
Document document = 4;
|
||||
// 其他可选字段
|
||||
PersonalInformation personal_information = 5;
|
||||
FaceMap face_map = 6;
|
||||
string callback_date = 7;
|
||||
string client_ip = 8;
|
||||
}
|
||||
|
||||
message VerificationStatus {
|
||||
string state = 1; // "PENDING", "DONE", "FAILED"
|
||||
string reason = 2; // 可选字段,失败原因
|
||||
}
|
||||
|
||||
message Document {
|
||||
string status = 1; // "APPROVED_VERIFIED", "DENIED_FRAUD", etc.
|
||||
string type = 2; // "PASSPORT", "DRIVER_LICENSE", etc.
|
||||
string issuing_country = 3;
|
||||
string number = 4;
|
||||
}
|
||||
|
||||
message PersonalInformation {
|
||||
string first_name = 1;
|
||||
string last_name = 2;
|
||||
string date_of_birth = 3;
|
||||
string nationality = 4;
|
||||
}
|
||||
|
||||
message FaceMap {
|
||||
string status = 1;
|
||||
float similarity = 2; // 人脸比对相似度
|
||||
}
|
||||
Reference in New Issue
Block a user