2023-01-06 14:34:53 +08:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// UserExternalLoginResp user external login resp
|
|
|
|
type UserExternalLoginResp struct {
|
2023-01-06 17:22:09 +08:00
|
|
|
BindingKey string `json:"binding_key"`
|
|
|
|
AccessToken string `json:"access_token"`
|
2023-04-14 17:33:22 +08:00
|
|
|
// ErrMsg error message, if not empty, means login failed and this message should be displayed.
|
2023-04-20 19:10:24 +08:00
|
|
|
ErrMsg string `json:"-"`
|
|
|
|
ErrTitle string `json:"-"`
|
2023-01-06 17:22:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ExternalLoginBindingUserSendEmailReq external login binding user request
|
|
|
|
type ExternalLoginBindingUserSendEmailReq struct {
|
|
|
|
BindingKey string `validate:"required,gt=1,lte=100" json:"binding_key"`
|
|
|
|
Email string `validate:"required,gt=1,lte=512,email" json:"email"`
|
|
|
|
// If must is true, whatever email if exists, try to bind user.
|
|
|
|
// If must is false, when email exist, will only be prompted with a warning.
|
|
|
|
Must bool `json:"must"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ExternalLoginBindingUserSendEmailResp external login binding user response
|
|
|
|
type ExternalLoginBindingUserSendEmailResp struct {
|
2023-01-10 14:24:32 +08:00
|
|
|
EmailExistAndMustBeConfirmed bool `json:"email_exist_and_must_be_confirmed"`
|
|
|
|
AccessToken string `json:"access_token"`
|
2023-01-06 17:22:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ExternalLoginBindingUserReq external login binding user request
|
|
|
|
type ExternalLoginBindingUserReq struct {
|
2023-01-09 16:54:20 +08:00
|
|
|
Code string `validate:"required,gt=0,lte=500" json:"code"`
|
|
|
|
Content string `json:"-"`
|
2023-01-06 17:22:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ExternalLoginBindingUserResp external login binding user response
|
|
|
|
type ExternalLoginBindingUserResp struct {
|
2023-01-06 14:34:53 +08:00
|
|
|
AccessToken string `json:"access_token"`
|
|
|
|
}
|
2023-01-09 16:54:20 +08:00
|
|
|
|
|
|
|
// ExternalLoginUserInfoCache external login user info
|
|
|
|
type ExternalLoginUserInfoCache struct {
|
|
|
|
// Third party identification
|
|
|
|
// e.g. facebook, twitter, instagram
|
|
|
|
Provider string
|
|
|
|
// required. The unique user ID provided by the third-party login
|
|
|
|
ExternalID string
|
|
|
|
// optional. This name is used preferentially during registration
|
2023-03-02 12:13:58 +08:00
|
|
|
DisplayName string
|
|
|
|
// optional. This username is used preferentially during registration
|
|
|
|
Username string
|
2023-01-09 16:54:20 +08:00
|
|
|
// optional. If email exist will bind the existing user
|
|
|
|
Email string
|
2023-03-02 10:24:32 +08:00
|
|
|
// optional. The avatar URL provided by the third-party login platform
|
|
|
|
Avatar string
|
2023-01-09 16:54:20 +08:00
|
|
|
// optional. The original user information provided by the third-party login platform
|
|
|
|
MetaInfo string
|
2023-04-14 17:33:22 +08:00
|
|
|
// optional. The bio provided by the third-party login platform
|
|
|
|
Bio string
|
2023-01-09 16:54:20 +08:00
|
|
|
}
|
2023-01-13 12:50:20 +08:00
|
|
|
|
|
|
|
// ExternalLoginUnbindingReq external login unbinding user
|
|
|
|
type ExternalLoginUnbindingReq struct {
|
|
|
|
ExternalID string `validate:"required,gt=0,lte=128" json:"external_id"`
|
|
|
|
UserID string `json:"-"`
|
|
|
|
}
|
2023-03-29 17:12:45 +08:00
|
|
|
|
|
|
|
// UserCenterUserSettingsResp user center user info response
|
|
|
|
type UserCenterUserSettingsResp struct {
|
|
|
|
ProfileSettingAgent UserSettingAgent `json:"profile_setting_agent"`
|
|
|
|
AccountSettingAgent UserSettingAgent `json:"account_setting_agent"`
|
|
|
|
}
|
|
|
|
|
2023-04-16 12:39:02 +08:00
|
|
|
type UserCenterAdminFunctionAgentResp struct {
|
2023-04-26 11:01:45 +08:00
|
|
|
AllowCreateUser bool `json:"allow_create_user"`
|
|
|
|
AllowUpdateUserStatus bool `json:"allow_update_user_status"`
|
|
|
|
AllowUpdateUserPassword bool `json:"allow_update_user_password"`
|
|
|
|
AllowUpdateUserRole bool `json:"allow_update_user_role"`
|
2023-04-16 12:39:02 +08:00
|
|
|
}
|
|
|
|
|
2023-03-29 17:12:45 +08:00
|
|
|
type UserSettingAgent struct {
|
|
|
|
Enabled bool `json:"enabled"`
|
|
|
|
RedirectURL string `json:"redirect_url"`
|
|
|
|
}
|