From 92ed7be06608937020855b24891da0c3172335d2 Mon Sep 17 00:00:00 2001 From: Univero <140871040+universero@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:13:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20platform-data=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A5=E5=8F=8Aplatform-api=E9=83=A8=E5=88=86=E6=96=B0?= =?UTF-8?q?=E5=A2=9Eauth=20(#9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 定义了用于埋点的data的rpc接口 * fix : 修正了插入接口的定义,以便于可以批量处理 * fix : 修正了插入接口的定义,以便于可以批量处理 * debug : 将data服务大写成Data避免奇怪的错误 * debug : 将data修改成DataService避免包名冲突 * fix : 添加了data api 的proto定义 * fix : 修正了api定义的结构 * fix : api中tags改为string * feat: 增加open-platform部分的proto文件 * feat: 在platform-core_api添加了auth相关接口 * fix: 修改了idl-gen-go仓库中的kitex版本不匹配问题 * fix: try-again * fix: 将以api命名的修改为core_api以符合makefile * fix: auth相关接口添加前缀/platform以适应路由 --- open_platform/core_api/user.proto | 19 +++++++++++++++ platform/core_api/auth.proto | 40 +++++++++++++++++++++++++++++++ platform/core_api/core_api.proto | 31 ++++++++++++++++++++++++ platform/core_api/data.proto | 22 +++++++++++++++++ platform/data/data.proto | 25 +++++++++++++++++++ 5 files changed, 137 insertions(+) create mode 100644 open_platform/core_api/user.proto create mode 100644 platform/core_api/auth.proto create mode 100644 platform/core_api/core_api.proto create mode 100644 platform/core_api/data.proto create mode 100644 platform/data/data.proto diff --git a/open_platform/core_api/user.proto b/open_platform/core_api/user.proto new file mode 100644 index 0000000..ae7c94c --- /dev/null +++ b/open_platform/core_api/user.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package open_platform.user; + +option go_package="open_platform/core_api"; +option java_package = "com.xhpolaris.idlgen.open_platform.core_api"; +option java_outer_classname = "UserProto"; +option java_multiple_files = true; + +// 账号密码注册请求 +message PasswordSignUpReq{ + +} + +// 账号密码注册响应 +message PasswordSignUpResp{ + +} + diff --git a/platform/core_api/auth.proto b/platform/core_api/auth.proto new file mode 100644 index 0000000..219cf51 --- /dev/null +++ b/platform/core_api/auth.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package platform.core_api; + +option go_package = "platform/core_api"; +option java_package = "com.xhpolaris.idlgen.platform.core_api"; +option java_outer_classname = "AuthProto"; +option java_multiple_files = true; + +import "basic/app.proto"; + +message SignInReq { + string authType = 1; + string authId = 2; // authType为邮件时填邮箱,为电话时填电话号,为微信时填APP_ID + optional string password = 3; + optional string verifyCode = 4; + basic.APP appId = 5; + string deviceId = 6; +} + +message SignInResp { + string userId = 1; + string accessToken = 2; + int64 accessExpire = 3; +} + +message SetPasswordReq { + string password = 1; +} + +message SetPasswordResp { +} + +message SendVerifyCodeReq { + string authType = 1; + string authId = 2; // authType为邮件时填邮箱,为电话时填电话号 +} + +message SendVerifyCodeResp { +} diff --git a/platform/core_api/core_api.proto b/platform/core_api/core_api.proto new file mode 100644 index 0000000..ac38589 --- /dev/null +++ b/platform/core_api/core_api.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package platform.core_api; + +option go_package = "platform/core_api"; +option java_package = "com.xhpolaris.idlgen.platform.core_api"; +option java_outer_classname = "CoreApiProto"; +option java_multiple_files = true; + +import "http/http.proto"; +import "platform/core_api/data.proto"; +import "platform/core_api/auth.proto"; + +service data { + rpc ReportEvent(ReportEventRequest) returns (ReportEventResponse) { + option(http.post) = "/platform/report_event"; + } +} + +service auth { + rpc SignIn (SignInReq) returns (SignInResp){ + option (http.post) = "/platform/auth/sign_in"; + } + rpc SendVerifyCode(SendVerifyCodeReq) returns (SendVerifyCodeResp){ + option (http.post) = "/platform/auth/send_verify_code"; + } + rpc SetPassword(SetPasswordReq) returns (SetPasswordResp){ + option(http.post) = "/platform/auth/set_password"; + } +} + diff --git a/platform/core_api/data.proto b/platform/core_api/data.proto new file mode 100644 index 0000000..66267bf --- /dev/null +++ b/platform/core_api/data.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package platform.core_api; + +option go_package = "platform/core_api"; +option java_package = "com.xhpolaris.idlgen.platform.core_api"; +option java_outer_classname = "CoreApiProto"; +option java_multiple_files = true; + +message ReportEventItem { + string eventName = 1; + string tags = 2; +} + + +message ReportEventRequest { + repeated ReportEventItem data = 1; +} + +message ReportEventResponse { + bool done = 1; +} \ No newline at end of file diff --git a/platform/data/data.proto b/platform/data/data.proto new file mode 100644 index 0000000..c352163 --- /dev/null +++ b/platform/data/data.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package platform.data; + +option go_package = "platform/data"; +option java_package = "com.xhpolaris.idlgen.platform.data"; +option java_outer_classname = "DataProto"; +option java_multiple_files = true; + +message Document { + string event_name = 1; + string tags = 2; +} + +message InsertReq{ + repeated Document documents = 1; +} + +message InsertResp { + bool done = 1; +} + +service DataService { + rpc Insert(InsertReq) returns (InsertResp); +} \ No newline at end of file