2025-08-19 13:52:01 +08:00
|
|
|
|
package user_core_client
|
2025-08-20 17:43:52 +08:00
|
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
|
|
type UserCenterApi interface {
|
|
|
|
|
// Verify 验证 token 并且返回 token 中的信息
|
|
|
|
|
Verify(ctx context.Context, token string) (*TokenClaims, error)
|
|
|
|
|
|
|
|
|
|
// GetPhoneTextByUID 获取明文手机号 来自于 uid
|
|
|
|
|
GetPhoneTextByUID(ctx context.Context, uid int64) (string, error)
|
|
|
|
|
|
|
|
|
|
// UpdateUserByUID 更新用户信息
|
|
|
|
|
UpdateUserByUID(ctx context.Context, uid int64, user *UpdateUserReq) (*User, error)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type UpdateUserReq struct {
|
|
|
|
|
Username string `json:"username" ` // 名称(可重复)
|
|
|
|
|
PhoneText string `json:"phoneText"` // 手机号
|
|
|
|
|
Password string `json:"password"` // 加密密码
|
|
|
|
|
Gender string `json:"gender"` // 性别 (male 男性, female 女性, unknown 未知)
|
|
|
|
|
Status string `json:"status"` // 用户状态,enabled/disabled
|
|
|
|
|
LoginName string `json:"loginName"` // 登录名
|
|
|
|
|
}
|