From 989a68c4b68e94d41d240c29af8a7c0b98d1c800 Mon Sep 17 00:00:00 2001 From: sky Date: Wed, 20 Aug 2025 03:35:54 +0800 Subject: [PATCH] update --- shenxianhe/v1/account.proto | 29 ++++++++++++++------ shenxianhe/v1/notification.proto | 47 ++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 shenxianhe/v1/notification.proto diff --git a/shenxianhe/v1/account.proto b/shenxianhe/v1/account.proto index 130a98d..70b81e2 100644 --- a/shenxianhe/v1/account.proto +++ b/shenxianhe/v1/account.proto @@ -1,18 +1,29 @@ syntax = "proto3"; package shenxianhe.v1; -option go_package = "shenxianhe/gen/shenxianhe/v1;accountv1"; +option go_package = "shenxianhe/gen/shenxianhe/v1;shenxianhev1"; -message LoginRequest { - string phone = 1; - string email = 2; - string code = 10; +// 认证类型枚举 +enum AuthenticationType { + AUTHENTICATION_TYPE_UNSPECIFIED = 0; + AUTHENTICATION_TYPE_PHONE = 1; // 手机号 + AUTHENTICATION_TYPE_EMAIL = 2; // 邮箱 + AUTHENTICATION_TYPE_WECHAT = 3; // 微信 } -message LoginResponse { string token = 1; } +message AuthRequest { + AuthenticationType auth_type = 1; // 认证类型 + string auth_id = 2; // 认证ID,根据auth_type存储不同的账号信息 + string credential = 3; // 凭证,可以是验证码或密码 + string invitation_code = 4; // 邀请码 +} + +message AuthResponse { string token = 1; } message SetPasswordRequest { - LoginRequest login = 1; - string password = 2; + AuthenticationType auth_type = 1; // 认证类型 + string auth_id = 2; // 认证ID,根据auth_type存储不同的账号信息 + string credential = 3; // 凭证,可以是验证码或旧密码 + string password = 4; // 新密码 } message SetPasswordResponse {} @@ -33,7 +44,7 @@ message GetUserInfoResponse { } service AccountService { - rpc Login(LoginRequest) returns (LoginResponse); + rpc Auth(AuthRequest) returns (AuthResponse); rpc SetPassword(SetPasswordRequest) returns (SetPasswordResponse); rpc SetName(SetNameRequest) returns (SetNameResponse); rpc GetAvatarUploadURL(GetAvatarUploadURLRequest) diff --git a/shenxianhe/v1/notification.proto b/shenxianhe/v1/notification.proto new file mode 100644 index 0000000..0f5129e --- /dev/null +++ b/shenxianhe/v1/notification.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package shenxianhe.v1; +option go_package = "shenxianhe/gen/shenxianhe/v1;shenxianhev1"; + +message SendSMSRequest { + string phone = 1; + string sign_name = 2; + string template_code = 3; + map template_params = 4; +} + +message SendSMSResponse {} + +message ListSMSSignRequest { int32 offset = 1; } + +enum SMSSignStatus { + SMS_SIGN_STATUS_UNSPECIFIED = 0; + SMS_SIGN_STATUS_APPLYING = 1; // 审核中 + SMS_SIGN_STATUS_PASSED = 2; // 审核通过 + SMS_SIGN_STATUS_REJECTED = 3; // 审核拒绝 + SMS_SIGN_STATUS_CANCELED = 4; // 已取消 +} + +message SMSSignReason { + string content = 1; + string sub_content = 2; + int32 create_at = 3; +} + +message SMSSign { + string id = 1; // 签名ID + string name = 2; // 签名名称 + SMSSignStatus status = 3; // 签名状态 + string type = 4; // 签名类型 + SMSSignReason reasons = 5; // 签名拒绝原因 + int32 created_at = 6; // 创建时间 +} + +message ListSMSSignResponse { + repeated SMSSign list = 1; + int32 count = 2; +} + +service NotificationService { + rpc ListSMSSign(ListSMSSignRequest) returns (ListSMSSignResponse); + rpc SendSMS(SendSMSRequest) returns (SendSMSResponse); +}