app-cloudep-member-server/generate/protobuf/service.proto

194 lines
4.6 KiB
Protocol Buffer
Raw Normal View History

2024-08-20 16:22:48 +00:00
syntax = "proto3";
package member;
option go_package="./member";
2024-08-21 08:12:34 +00:00
// OKResp
message OKResp {}
// NoneReq
message NoneReq {}
2024-08-20 16:22:48 +00:00
// ================ enum ================
enum VerifyType {
VERIFY_NONE = 0; // 初始(異常)
VERIFY_EMAIL = 1;
VERIFY_PHONE = 2;
2024-08-21 00:21:29 +00:00
VERIFY_GOOGLE = 3; // google 驗證器
2024-08-22 13:12:14 +00:00
VERIFY_NOT = 4; // 尚未
2024-08-20 16:22:48 +00:00
}
enum AlarmType {
ALARM_NONE = 0; // 初始(異常)
ALARM_NOT = 1; // 未告警
ALARM_SYSTEM = 2; // 系統告警中
}
enum MemberStatus {
STATUS_NONE = 0; // 初始(異常)
STATUS_VERIFY = 1; // 尚未驗證
STATUS_COMPLETE = 2; // 帳號啟用中
STATUS_DISABLE = 3; // 帳號停權中
STATUS_EMAIL = 4; // 信箱以驗證
STATUS_PHONE = 5; // 手機以驗證
STATUS_GA = 6; // GA 已綁定
}
// ================ enum ================
// ================ common ================
message Pager {
int64 total =1;
int64 size=2;
int64 index=3;
}
// ================ common ================
// ================ account ================
message CreateLoginUserReq {
string login_id = 1;
int64 platform = 2;
string token = 3;
}
message BindingUserReq {
string uid = 1;
string login_id = 2;
2024-08-21 00:21:29 +00:00
int64 type = 3;
2024-08-20 16:22:48 +00:00
}
2024-08-22 13:12:14 +00:00
message BindingUserResp {
string uid = 1;
string login_id = 2;
int64 type = 3;
}
2024-08-20 16:22:48 +00:00
message CreateUserInfoReq {
string uid = 1;
VerifyType verify_type = 2;
AlarmType alarm_type = 3;
MemberStatus status = 4;
string language = 5;
string currency = 6;
2024-08-22 13:12:14 +00:00
optional string avatar= 7;
optional string nick_name = 8;
2024-08-20 16:22:48 +00:00
}
message GetAccountInfoResp {
2024-08-21 08:12:34 +00:00
CreateLoginUserReq data = 1;
2024-08-20 16:22:48 +00:00
}
// UpdateUserInfoReq 不處理邏輯給不給改,這裡只關新增修改刪除
message UpdateUserInfoReq {
string uid = 1;
optional string language = 2;
optional string currency = 3;
optional string nick_name = 4;
2024-08-21 08:12:34 +00:00
optional VerifyType verify_type = 5;
optional AlarmType alarm_type = 6;
optional MemberStatus status = 7;
2024-08-20 16:22:48 +00:00
}
message GetUIDByAccountReq {
string account = 1;
}
message GetUidByAccountResp {
2024-08-21 08:12:34 +00:00
string uid = 1;
string account =2;
2024-08-20 16:22:48 +00:00
}
message UpdateTokenReq {
string account = 1;
string token = 2;
}
message GenerateRefreshCodeReq {
string account = 1;
int32 code_type =2;
}
message VerifyCode {
string verify_code = 1;
}
message GenerateRefreshCodeResp {
2024-08-21 08:12:34 +00:00
VerifyCode data = 1;
2024-08-20 16:22:48 +00:00
}
message VerifyRefreshCodeReq {
string account = 1;
int32 code_type =2;
string verify_code = 3;
}
message UpdateStatusReq {
string uid = 1;
MemberStatus status = 2;
}
message GetUserInfoReq {
string uid = 1;
optional string nick_name =2;
}
message UserInfo {
string uid = 1;
VerifyType verify_type = 2;
AlarmType alarm_type = 3;
MemberStatus status = 4;
string language = 5;
string currency = 6;
2024-08-21 00:21:29 +00:00
string avatar = 7;
optional string nick_name = 8;
2024-08-20 16:22:48 +00:00
}
message GetUserInfoResp {
2024-08-21 08:12:34 +00:00
UserInfo data = 1;
2024-08-20 16:22:48 +00:00
}
message ListUserInfoReq {
optional VerifyType verify_type = 1;
optional AlarmType alarm_type = 2;
optional MemberStatus status = 3;
optional int64 create_start_time = 4;
optional int64 create_end_time = 5;
int64 page_size =6;
int64 page_index=7;
}
message ListUserInfoResp {
2024-08-21 08:12:34 +00:00
repeated UserInfo data = 1;
Pager page =2;
2024-08-20 16:22:48 +00:00
}
service Account {
// CreateUserAccount 建立帳號與密碼 -> 可登入,但可不可以做其他事情看業務流程,也可以只註冊就好
2024-08-21 08:12:34 +00:00
rpc CreateUserAccount(CreateLoginUserReq) returns(OKResp);
2024-08-20 16:22:48 +00:00
// GetUserAccountInfo 取得帳號密碼資料
rpc GetUserAccountInfo(GetUIDByAccountReq) returns(GetAccountInfoResp);
// UpdateUserToken 更新密碼
2024-08-21 08:12:34 +00:00
rpc UpdateUserToken(UpdateTokenReq) returns(OKResp);
2024-08-20 16:22:48 +00:00
// GetUidByAccount 用帳號換取 UID
rpc GetUidByAccount(GetUIDByAccountReq) returns(GetUidByAccountResp);
// BindAccount 綁定帳號 -> account bind to UID
2024-08-22 13:12:14 +00:00
rpc BindAccount(BindingUserReq) returns(BindingUserResp);
2024-08-20 16:22:48 +00:00
// BindUserInfo 初次,綁定 User Info
2024-08-21 08:12:34 +00:00
rpc BindUserInfo(CreateUserInfoReq) returns(OKResp);
2024-08-20 16:22:48 +00:00
// UpdateUserInfo 更新 User Info
2024-08-21 08:12:34 +00:00
rpc UpdateUserInfo(UpdateUserInfoReq) returns(OKResp);
2024-08-20 16:22:48 +00:00
// UpdateStatus 修改狀態
2024-08-21 08:12:34 +00:00
rpc UpdateStatus(UpdateStatusReq) returns(OKResp);
2024-08-21 00:21:29 +00:00
// GetUserInfo 取得會員資訊
2024-08-20 16:22:48 +00:00
rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp);
// ListMember 取得會員列表
rpc ListMember(ListUserInfoReq) returns(ListUserInfoResp);
// GenerateRefreshCode 這個帳號驗證碼(十分鐘),通用的
rpc GenerateRefreshCode(GenerateRefreshCodeReq) returns(GenerateRefreshCodeResp);
// VerifyRefreshCode 驗證忘記密碼 token
2024-08-21 08:12:34 +00:00
rpc VerifyRefreshCode(VerifyRefreshCodeReq) returns(OKResp);
2024-08-20 16:22:48 +00:00
}
// ================ account ================