This commit is contained in:
sky
2025-08-20 03:35:54 +08:00
parent e2698630ad
commit 989a68c4b6
2 changed files with 67 additions and 9 deletions

View File

@@ -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)

View File

@@ -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<string, string> 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);
}