128 lines
6.6 KiB
Go
128 lines
6.6 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
||
// goctl 1.8.1
|
||
|
||
package types
|
||
|
||
type BaseResponse struct {
|
||
Status Status `json:"status"` // 狀態
|
||
Data interface{} `json:"data"` // 資料
|
||
}
|
||
|
||
type BindingUserInfoReq struct {
|
||
VerifyHeader
|
||
PreferredLanguage string `json:"preferred_language,optional" validate:"oneof=zh-tw en-us"` // 使用語言
|
||
Currency string `json:"currency,optional" validate:"oneof=TWD USD"`
|
||
AvatarURL string `json:"avatar_url,optional"` // 頭像 URL(可選)
|
||
Nickname string `json:"nickname,optional"`
|
||
FullName string `json:"full_name,optional"` // 用戶全名
|
||
GenderCode string `json:"gender_code" validate:"oneof=secret male female"` // 性別代碼
|
||
Birthday string `json:"birthday,optional" validate:"rfc3339"` // 生日 (格式: unix)
|
||
Address string `json:"address,optional"` // 地址
|
||
}
|
||
|
||
type CheckoutVerifyReq struct {
|
||
VerifyHeader
|
||
Account string `json:"account" validate:"required"` // 帳號名稱
|
||
CodeType string `json:"code_type" validate:"oneof=email phone"` // 驗證碼類型 1 信箱 2 手機
|
||
VerifyCode string `json:"verify_code" validate:"required,len=6"` // 驗證碼,長度為6
|
||
UID string `json:"uid" validate:"required"`
|
||
}
|
||
|
||
type CreateAccountRequest struct {
|
||
Account string `json:"account" validate:"required"` // 帳號名稱(line code 輸入在這邊)
|
||
Token string `json:"token" validate:"required"` // 密碼或平台token,密碼請 sha256 轉碼,如果三方token 請隨便給一個 sha256 字串
|
||
TokenCheck string `json:"token_check" validate:"required"` // 密碼或平台token,token 請保持原樣,填在這邊,不用管 token
|
||
Platform string `json:"platform" validate:"oneof=platform google line"` // 平台名稱 (platform) 平台、google、line
|
||
AccountType string `json:"account_type" validate:"oneof=phone email platform"` // 帳號類型 phone(手機)、email(信箱)、platform(自定義帳號) -> (如果為第三方都寫 platform)
|
||
MemberLoginHeader
|
||
}
|
||
|
||
type ForgetPasswordCodeReq struct {
|
||
Account string `json:"account" validate:"required"` // 帳號名稱
|
||
AccountType string `json:"account_type" validate:"oneof=phone email"` // 帳號類型 (phone) 手機 (email) 信箱
|
||
}
|
||
|
||
type LoginReq struct {
|
||
Account string `json:"account" validate:"required"` // 帳號名稱
|
||
Token string `json:"token"` // 密碼或平台token,密碼請 sha256 轉碼
|
||
Platform string `json:"platform" validate:"oneof=platform google line"` // 平台名稱 platform, google
|
||
AccountType string `json:"account_type" validate:"oneof=phone email platform"` // 帳號類型 1 手機 2 信箱 3 自定義帳號
|
||
MemberLoginHeader
|
||
}
|
||
|
||
type LoginTokenResp struct {
|
||
UID string `json:"uid"` // Account
|
||
AccessToken string `json:"access_token"` // 訪問令牌 預設 5 分鐘過期
|
||
RefreshToken string `json:"refresh_token"` // 刷新令牌 (預設一天過期,只能用一次),當呼叫更新token api 時,會自動把舊的失效,變成新的 refresh_token ,前端要記得過其實協助刷新,刷新不過表示全失效了(重新登入)
|
||
TokenType string `json:"token_type"` // Bearer
|
||
}
|
||
|
||
type MemberLoginHeader struct {
|
||
DeviceID string `header:"device_id"`
|
||
IpAddress string `header:"ip_address"`
|
||
Brewser string `header:"brewser"`
|
||
}
|
||
|
||
type ModifyPasswdReq struct {
|
||
VerifyHeader
|
||
NewToken string `json:"token" validate:"required,len=64"` // 密碼或平台token,密碼請 sha256 轉碼
|
||
NewTokenCheck string `json:"token_check" validate:"required,len=64"` // 密碼或平台token,密碼請 sha256 轉碼
|
||
}
|
||
|
||
type PreVerifyForgetPasswdReq struct {
|
||
Identifier string `json:"identifier" validate:"required"` // 聯繫方式,可以是 email 或 phone
|
||
VerifyCode string `json:"verify_code" validate:"required,len=6"` // 驗證碼,長度為6
|
||
}
|
||
|
||
type RespOK struct {
|
||
}
|
||
|
||
type Status struct {
|
||
Code int64 `json:"code"` // 狀態碼
|
||
Message string `json:"message"` // 訊息
|
||
Data interface{} `json:"data,omitempty"` // 可選的數據,當有返回時才出現
|
||
Error interface{} `json:"error,omitempty"` // 可選的錯誤信息
|
||
}
|
||
|
||
type UpdatePasswordReq struct {
|
||
Account string `json:"account" validate:"required"` // 帳號名稱
|
||
VerifyCode string `json:"verify_code" validate:"required,len=6"` // 驗證碼,長度為6
|
||
Token string `json:"token" validate:"required,len=64"` // 密碼或平台token,密碼請 sha256 轉碼
|
||
TokenCheck string `json:"token_check" validate:"required,len=64"` // 密碼或平台token,密碼請 sha256 轉碼
|
||
}
|
||
|
||
type UpdateTokenReq struct {
|
||
UID string `json:"uid" validate:"required"` // 誰要更新
|
||
Token string `json:"token" validate:"required"` // access token -> 已過期要被更新的
|
||
RefreshToken string `json:"refresh_token" validate:"required"` // refresh token -> 重點,要驗證他的
|
||
}
|
||
|
||
type UserInfo struct {
|
||
Platform string `json:"platform"` // 用戶平台 platform, google, line
|
||
UID string `json:"uid"` // 用戶 UID
|
||
AvatarURL string `json:"avatar_url"` // 頭像 URL(可選)
|
||
FullName string `json:"full_name"` // 用戶全名
|
||
Nickname string `json:"nickname"` // 暱稱(可選)
|
||
GenderCode string `json:"gender_code"` // 性別代碼 mail, femail ,sec
|
||
Birthdate string `json:"birthdate"` // 生日 (格式: 19930417)
|
||
PhoneNumber string `json:"phone_number"` // 電話
|
||
Address string `json:"address"` // 地址
|
||
Email string `json:"email"` // 驗證後的信箱
|
||
AlarmCategory string `json:"alarm_category"` // 告警狀態
|
||
UserStatus string `json:"user_status"` // 用戶狀態
|
||
PreferredLanguage string `json:"preferred_language"` // 使用語言
|
||
Currency string `json:"currency"` // 使用幣種
|
||
UpdateAt string `json:"update_at"`
|
||
CreateAt string `json:"create_at"`
|
||
}
|
||
|
||
type VerificationCodeRequest struct {
|
||
VerifyHeader
|
||
Identifier string `json:"identifier" validate:"required"` // 聯繫方式,可以是 email 或 phone
|
||
CodeType string `json:"code_type" validate:"oneof=email phone forget_password"` // 驗證碼類型
|
||
}
|
||
|
||
type VerifyHeader struct {
|
||
Token string `header:"token" validate:"required"`
|
||
}
|