common

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SystemOperator = "system"

Variables

View Source
var SystemUser = User{
	ID:   SystemOperator,
	Name: SystemOperator,
	Nick: SystemOperator,
}

Functions

func PolishUnassignedAsEmptyStr

func PolishUnassignedAsEmptyStr(userIDs []string) (result []string)

func ToPbUser

func ToPbUser(user User) *pb.User

Types

type Interface

type Interface interface {
	pb.UserServiceServer
}

type USERID

type USERID string
const (
	UnassignedUserID USERID = "unassigned"
)

func (USERID) IsUnassigned

func (u USERID) IsUnassigned() bool

func (USERID) String

func (u USERID) String() string

func (*USERID) UnmarshalJSON

func (u *USERID) UnmarshalJSON(b []byte) error

maybe int or string, unmarshal them to string(USERID)

type User

type User struct {
	ID        string `json:"user_id"`
	Name      string `json:"username"`
	Nick      string `json:"nickname"`
	AvatarURL string `json:"avatar_url"`
	Phone     string `json:"phone_number"`
	Email     string `json:"email"`
	State     string `json:"state"`
}

type UserInPaging

type UserInPaging struct {
	Id            interface{} `json:"id"`            // 主键
	Avatar        string      `json:"avatar"`        // 头像
	Username      string      `json:"username"`      // 用户名
	Nickname      string      `json:"nickname"`      // 昵称
	Mobile        string      `json:"mobile"`        // 手机号
	Email         string      `json:"email"`         // 邮箱
	Enabled       bool        `json:"enabled"`       // 是否启用
	UserDetail    interface{} `json:"userDetail"`    // 用户详细信息
	Locked        bool        `json:"locked"`        // 冻结FLAG(0:NOT,1:YES)
	PasswordExist bool        `json:"passwordExist"` // 密码是否存在
	PwdExpireAt   timestamp   `json:"pwdExpireAt"`   // 过期时间
	Extra         interface{} `json:"extra"`         // 扩展字段
	Source        string      `json:"source"`        // 用户来源
	SourceType    string      `json:"sourceType"`    // 来源类型
	Tag           string      `json:"tag"`           // 标签
	Channel       string      `json:"channel"`       // 注册渠道
	ChannelType   string      `json:"channelType"`   // 渠道类型
	TenantId      int         `json:"tenantId"`      // 租户ID
	CreatedAt     timestamp   `json:"createdAt"`     // 创建时间
	UpdatedAt     timestamp   `json:"updatedAt"`     // 更新时间
	LastLoginAt   timestamp   `json:"lastLoginAt"`   // 最后登录时间
}

userInPaging 用户中心分页用户数据结构

type UserInfo

type UserInfo struct {
	ID               USERID `json:"id"`
	Token            string `json:"token"`
	Email            string `json:"email"`
	EmailExist       bool   `json:"emailExist"`
	PasswordExist    bool   `json:"passwordExist"`
	PhoneExist       bool   `json:"phoneExist"`
	Birthday         string `json:"birthday"`
	PasswordStrength int    `json:"passwordStrength"`
	Phone            string `json:"phone"`
	AvatarUrl        string `json:"avatarUrl"`
	UserName         string `json:"username"`
	NickName         string `json:"nickName"`
	Enabled          bool   `json:"enabled"`
	CreatedAt        string `json:"createdAt"`
	UpdatedAt        string `json:"updatedAt"`
	LastLoginAt      string `json:"lastLoginAt"`
	KratosID         string `json:"kratosId"`
}

func NewUserInfoFromDTO

func NewUserInfoFromDTO(dto *apistructs.UserInfoDto) *UserInfo

type UserPaging

type UserPaging struct {
	Data  []UserInPaging `json:"data"`
	Total int            `json:"total"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL