syntax = "proto3"; package member; option go_package="./member"; // OKResp message OKResp {} // NoneReq message NoneReq {} // ================ enum ================ 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; // 帳號停權中 } // ================ 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; int64 type = 3; } message BindingUserResp { string uid = 1; string login_id = 2; int64 type = 3; } message CreateUserInfoReq { string uid = 1; AlarmType alarm_type = 2; MemberStatus status = 3; string language = 4; string currency = 5; optional string avatar= 6; optional string nick_name = 7; optional string full_name = 8; optional int64 gender = 9; optional int64 birthdate = 10; optional string phone_number = 11; optional string email = 12; optional string address = 13; } message GetAccountInfoResp { CreateLoginUserReq data = 1; } // UpdateUserInfoReq 不處理邏輯給不給改,這裡只關新增修改刪除 message UpdateUserInfoReq { string uid = 1; optional string language = 2; optional string currency = 3; optional string nick_name = 4; optional string avatar = 5; optional AlarmType alarm_type = 6; optional MemberStatus status = 7; optional string full_name = 8; optional int64 gender = 9; optional int64 birthdate = 10; optional string address = 11; } message GetUIDByAccountReq { string account = 1; } message GetUIDByAccountResp { string uid = 1; string account =2; } message UpdateTokenReq { string account = 1; string token = 2; int64 platform=3; } message GenerateRefreshCodeReq { string account = 1; int32 code_type =2; } message VerifyCode { string verify_code = 1; } message GenerateRefreshCodeResp { VerifyCode data = 1; } 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; optional string avatar_url = 2; optional string full_name = 3; optional string nick_name = 4; optional int64 gender_code = 5; optional int64 birthday = 6; optional string phone =7; optional string email=8; optional string address=9; AlarmType alarm_type = 10; MemberStatus status = 11; string language = 12; string currency = 13; int64 create_time=14; int64 update_time=15; } message GetUserInfoResp { UserInfo data = 1; } message ListUserInfoReq { optional AlarmType alarm_type = 1; optional MemberStatus status = 2; optional int64 create_start_time = 3; optional int64 create_end_time = 4; int64 page_size =5; int64 page_index=6; } message ListUserInfoResp { repeated UserInfo data = 1; Pager page =2; } message VerifyAuthResultReq { string token = 1; optional string account = 2; } message VerifyAuthResultResp { bool status = 1; } message VerifyGoogleAuthResultResp { bool status = 1; optional string iss =2; // 發行者 (issuer) 通常為 "https://accounts.google.com" optional string sub =3; // 使用者唯一 ID optional string aud =4; // Audience,應該與你的 Client ID 匹配 optional string exp =5; // 過期時間 (UNIX timestamp) optional string iat =6; // 發行時間 (UNIX timestamp) optional string email =7; // 使用者的電子郵件 optional string email_verified =8; // 郵件是否已驗證 optional string name =9; // 使用者的名稱 optional string picture =10; // 使用者的頭像 URL } message TwitterAccessTokenResp { string token = 1; } message BindVerifyEmailReq { string uid = 1; string email = 2; } message BindVerifyPhoneReq { string uid = 1; string phone = 2; } message LineAccessTokenResp { string token = 1; } message LineUserProfile { string display_name = 1; string user_id = 2; string picture_url = 3; string status_message = 4; } message LineGetTokenReq { string code = 1; } message LineGetUserInfoReq { string token = 1; } service Account { // CreateUserAccount 建立帳號與密碼 -> 可登入,但可不可以做其他事情看業務流程,也可以只註冊就好 rpc CreateUserAccount(CreateLoginUserReq) returns(OKResp); // GetUserAccountInfo 取得帳號密碼資料 rpc GetUserAccountInfo(GetUIDByAccountReq) returns(GetAccountInfoResp); // UpdateUserToken 更新密碼 rpc UpdateUserToken(UpdateTokenReq) returns(OKResp); // GetUIDByAccount 用帳號換取 UID rpc GetUIDByAccount(GetUIDByAccountReq) returns(GetUIDByAccountResp); // BindAccount 綁定帳號 -> account bind to UID rpc BindAccount(BindingUserReq) returns(BindingUserResp); // BindUserInfo 初次,綁定 User Info rpc BindUserInfo(CreateUserInfoReq) returns(OKResp); // BindVerifyEmail 綁定 Email rpc BindVerifyEmail(BindVerifyEmailReq) returns (OKResp); // BindVerifyPhone 綁定 Phone rpc BindVerifyPhone(BindVerifyPhoneReq) returns (OKResp); // UpdateUserInfo 更新 User Info rpc UpdateUserInfo(UpdateUserInfoReq) returns(OKResp); // UpdateStatus 修改狀態 rpc UpdateStatus(UpdateStatusReq) returns(OKResp); // GetUserInfo 取得會員資訊 rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp); // ListMember 取得會員列表 rpc ListMember(ListUserInfoReq) returns(ListUserInfoResp); // GenerateRefreshCode 這個帳號驗證碼(十分鐘),通用的 rpc GenerateRefreshCode(GenerateRefreshCodeReq) returns(GenerateRefreshCodeResp); // VerifyRefreshCode 驗證忘記密碼 token rpc VerifyRefreshCode(VerifyRefreshCodeReq) returns(OKResp); // CheckRefreshCode 驗證忘記密碼 token 不刪除,只確認) rpc CheckRefreshCode(VerifyRefreshCodeReq) returns(OKResp); // VerifyGoogleAuthResult 驗證 google 登入是否有效 rpc VerifyGoogleAuthResult(VerifyAuthResultReq)returns(VerifyGoogleAuthResultResp); // VerifyPlatformAuthResult 驗證 google 登入是否有效 rpc VerifyPlatformAuthResult(VerifyAuthResultReq)returns(VerifyAuthResultResp); // LineCodeToAccessToken Line 驗證相關 rpc LineCodeToAccessToken(LineGetTokenReq) returns (LineAccessTokenResp); // LineGetProfileByAccessToken Line 驗證相關 rpc LineGetProfileByAccessToken(LineGetUserInfoReq) returns (LineUserProfile); } // ================ account ================