diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c33cddb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "protobuf.additionalPaths": ["src"], + "protobuf.sourceRoot": "src", + "protoc": { + "options": ["--proto_path=src"] + } +} \ No newline at end of file diff --git a/src/account/v1/account.proto b/src/account/v1/account.proto deleted file mode 100644 index bc42199..0000000 --- a/src/account/v1/account.proto +++ /dev/null @@ -1,65 +0,0 @@ -syntax = "proto3"; -package account.v1; -option go_package = "git.shenxianhe.cn/shenxianhe/sdk/account/v1;accountv1"; - -// 认证类型枚举 -enum AuthenticationType { - AUTHENTICATION_TYPE_UNSPECIFIED = 0; - AUTHENTICATION_TYPE_NAME = 1; // 用户名 - AUTHENTICATION_TYPE_PHONE = 2; // 手机号 - AUTHENTICATION_TYPE_EMAIL = 3; // 邮箱 - AUTHENTICATION_TYPE_WECHAT = 4; // 微信 -} - -message SendCredentialRequest { - AuthenticationType auth_type = 1; // 认证类型 - string auth_id = 2; // 认证ID,根据auth_type存储不同的账号信息 -} - -message SendCredentialResponse {} - -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 { - AuthenticationType auth_type = 1; // 认证类型 - string auth_id = 2; // 认证ID,根据auth_type存储不同的账号信息 - string credential = 3; // 凭证,可以是验证码或旧密码 - string password = 4; // 新密码 -} -message SetPasswordResponse {} - -message SetNameRequest { string name = 1; } -message SetNameResponse {} - -message GetAvatarUploadURLRequest {} -message GetAvatarUploadURLResponse { string url = 1; } -message SetAvatarRequest { string url = 1; } -message SetAvatarResponse {} - -message GetUserInfoRequest {} -message GetUserInfoResponse { - string id = 1; - string avatar = 2; - string invitation_code = 3; - string name = 4; - string phone = 5; - string email = 6; -} - -service AccountService { - rpc SendCredential(SendCredentialRequest) returns (SendCredentialResponse); - rpc Auth(AuthRequest) returns (AuthResponse); - rpc SetPassword(SetPasswordRequest) returns (SetPasswordResponse); - rpc SetName(SetNameRequest) returns (SetNameResponse); - rpc GetAvatarUploadURL(GetAvatarUploadURLRequest) - returns (GetAvatarUploadURLResponse); - rpc SetAvatar(SetAvatarRequest) returns (SetAvatarResponse); - rpc GetUserInfo(GetUserInfoRequest) returns (GetUserInfoResponse); -} diff --git a/src/admin/v1/service.proto b/src/admin/v1/service.proto new file mode 100644 index 0000000..cf7243c --- /dev/null +++ b/src/admin/v1/service.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package admin.v1; +option go_package = "git.shenxianhe.cn/shenxianhe/sdk/admin/v1;adminv1"; + +import "admin/v1/sms.proto"; +import "admin/v1/user.proto"; + +service AdminService { + rpc ListSMSSign(ListSMSSignRequest) returns (ListSMSSignResponse); + rpc SendSMS(SendSMSRequest) returns (SendSMSResponse); + + rpc GetUserInfo(GetUserInfoRequest) returns (GetUserInfoResponse); +} \ No newline at end of file diff --git a/src/admin/v1/sms.proto b/src/admin/v1/sms.proto new file mode 100644 index 0000000..affd305 --- /dev/null +++ b/src/admin/v1/sms.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package admin.v1; +option go_package = "git.shenxianhe.cn/shenxianhe/sdk/admin/v1;adminv1"; + +import "enums/v1/sms.proto"; + +message SendSMSRequest { + string phone = 1; + string sign_name = 2; + string template_code = 3; + map template_params = 4; +} + +message SendSMSResponse {} + +message ListSMSSignRequest { int32 offset = 1; } + +message SMSSignReason { + string content = 1; + string sub_content = 2; + int32 create_at = 3; +} + +message SMSSign { + string id = 1; // 签名ID + string name = 2; // 签名名称 + enums.v1.SMSSignStatus status = 3; // 签名状态 + string type = 4; // 签名类型 + SMSSignReason reasons = 5; // 签名拒绝原因 + int32 created_at = 6; // 创建时间 +} + +message ListSMSSignResponse { + repeated SMSSign list = 1; + int32 count = 2; +} diff --git a/src/admin/v1/user.proto b/src/admin/v1/user.proto new file mode 100644 index 0000000..4f87e34 --- /dev/null +++ b/src/admin/v1/user.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package admin.v1; +option go_package = "git.shenxianhe.cn/shenxianhe/sdk/admin/v1;adminv1"; + +message GetUserInfoRequest { + string user_id = 1; + string invitation_code = 2; +} +message GetUserInfoResponse { + string id = 1; + string avatar = 2; + string invitation_code = 3; + string description = 4; + string name = 5; + string phone = 6; + string email = 7; +} \ No newline at end of file diff --git a/src/enums/v1/sms.proto b/src/enums/v1/sms.proto new file mode 100644 index 0000000..0fd16d2 --- /dev/null +++ b/src/enums/v1/sms.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package enums.v1; +option go_package = "git.shenxianhe.cn/shenxianhe/sdk/enums/v1;enumsv1"; + +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; // 已取消 +} \ No newline at end of file diff --git a/src/enums/v1/user.proto b/src/enums/v1/user.proto new file mode 100644 index 0000000..2abca92 --- /dev/null +++ b/src/enums/v1/user.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package enums.v1; +option go_package = "git.shenxianhe.cn/shenxianhe/sdk/enums/v1;enumsv1"; + +// 认证类型枚举 +enum AuthenticationType { + AUTHENTICATION_TYPE_UNSPECIFIED = 0; + AUTHENTICATION_TYPE_NAME = 1; // 用户名 + AUTHENTICATION_TYPE_PHONE = 2; // 手机号 + AUTHENTICATION_TYPE_EMAIL = 3; // 邮箱 + AUTHENTICATION_TYPE_WECHAT = 4; // 微信 +} diff --git a/src/notification/v1/notification.proto b/src/notification/v1/notification.proto deleted file mode 100644 index 38f59c4..0000000 --- a/src/notification/v1/notification.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; -package notification.v1; -option go_package = "git.shenxianhe.cn/shenxianhe/sdk/notification/v1;notificationv1"; - -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); -} diff --git a/src/user/v1/service.proto b/src/user/v1/service.proto new file mode 100644 index 0000000..93e0573 --- /dev/null +++ b/src/user/v1/service.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package user.v1; +option go_package = "git.shenxianhe.cn/shenxianhe/sdk/user/v1;userv1"; + +import "user/v1/user.proto"; + +service UserService { + rpc SendCredential(SendCredentialRequest) returns (SendCredentialResponse); + rpc Auth(AuthRequest) returns (AuthResponse); + rpc SetPassword(SetPasswordRequest) returns (SetPasswordResponse); + rpc SetName(SetNameRequest) returns (SetNameResponse); + rpc GetAvatarUploadURL(GetAvatarUploadURLRequest) + returns (GetAvatarUploadURLResponse); + rpc SetAvatar(SetAvatarRequest) returns (SetAvatarResponse); + rpc SetDescription(SetDescriptionRequest) returns (SetDescriptionResponse); + rpc GetUserInfo(GetUserInfoRequest) returns (GetUserInfoResponse); +} diff --git a/src/user/v1/user.proto b/src/user/v1/user.proto new file mode 100644 index 0000000..3c06d04 --- /dev/null +++ b/src/user/v1/user.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package user.v1; +option go_package = "git.shenxianhe.cn/shenxianhe/sdk/user/v1;userv1"; + +import "enums/v1/user.proto"; + +message SendCredentialRequest { + enums.v1.AuthenticationType auth_type = 1; // 认证类型 + string auth_id = 2; // 认证ID,根据auth_type存储不同的账号信息 +} + +message SendCredentialResponse {} + +message AuthRequest { + enums.v1.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 { + enums.v1.AuthenticationType auth_type = 1; // 认证类型 + string auth_id = 2; // 认证ID,根据auth_type存储不同的账号信息 + string credential = 3; // 凭证,可以是验证码或旧密码 + string password = 4; // 新密码 +} +message SetPasswordResponse {} + +message SetNameRequest { string name = 1; } +message SetNameResponse {} + +message GetAvatarUploadURLRequest {} +message GetAvatarUploadURLResponse { + string key = 1; + string url = 2; +} +message SetAvatarRequest { string key = 1; } +message SetAvatarResponse {} + +message SetDescriptionRequest { string description = 1; } +message SetDescriptionResponse {} + +message GetUserInfoRequest {} +message GetUserInfoResponse { + string id = 1; + string avatar = 2; + string invitation_code = 3; + string description = 4; + string name = 5; + string phone = 6; + string email = 7; +} diff --git a/version.txt b/version.txt index 88c5fb8..dc1e644 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.4.0 +1.6.0