uc

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindUserById

func FindUserById(id string) (*apistructs.UserInfoDto, error)

func FindUserByIdWithDesensitize

func FindUserByIdWithDesensitize(id string) (*apistructs.UserInfoDto, error)

func GetToken

func GetToken(forceRefresh bool) (string, error)

func InitializeUcClient added in v1.3.0

func InitializeUcClient(db *gorm.DB)

Types

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"`
	ExpiresAt   int64  `json:"expire_at"`
}

type UserInfo

type UserInfo struct {
	Name      string      `json:"name,omitempty"`
	Username  string      `json:"username,omitempty"`
	Nickname  string      `json:"nickname,omitempty"`
	AvatarUrl string      `json:"avatar_url,omitempty"`
	UserId    interface{} `json:"user_id,omitempty"`
}

func ListUserByIds

func ListUserByIds(userIds []string) ([]UserInfo, error)

userIds like user_id:12345, ... TODO 等 uc 2.0 支持。 目前未支持

func (*UserInfo) Convert

func (u *UserInfo) Convert() (string, error)

Deprecated

func (*UserInfo) UserName

func (u *UserInfo) UserName() string

Deprecated

type UserInfoDto

type UserInfoDto struct {
	AvatarUrl string      `json:"avatarUrl,omitempty"`
	Email     string      `json:"email,omitempty"`
	UserId    interface{} `json:"id,omitempty"`
	NickName  string      `json:"nickName,omitempty"`
	Phone     string      `json:"phone,omitempty"`
	RealName  string      `json:"realName,omitempty"`
	Username  string      `json:"username,omitempty"`
}

uc 2.0

func (*UserInfoDto) Convert

func (u *UserInfoDto) Convert() (string, error)

func (*UserInfoDto) GetUsername

func (u *UserInfoDto) GetUsername() string

Jump to

Keyboard shortcuts

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