user

package
v2.0.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	util.CommonError

	Subscribe      int32   `json:"subscribe"`
	OpenID         string  `json:"openid"`
	Nickname       string  `json:"nickname"`
	Sex            int32   `json:"sex"`
	City           string  `json:"city"`
	Country        string  `json:"country"`
	Province       string  `json:"province"`
	Language       string  `json:"language"`
	Headimgurl     string  `json:"headimgurl"`
	SubscribeTime  int32   `json:"subscribe_time"`
	UnionID        string  `json:"unionid"`
	Remark         string  `json:"remark"`
	GroupID        int32   `json:"groupid"`
	TagIDList      []int32 `json:"tagid_list"`
	SubscribeScene string  `json:"subscribe_scene"`
	QrScene        int     `json:"qr_scene"`
	QrSceneStr     string  `json:"qr_scene_str"`
}

Info 用户基本信息

type OpenidList

type OpenidList struct {
	Total int `json:"total"`
	Count int `json:"count"`
	Data  struct {
		OpenIDs []string `json:"openid"`
	} `json:"data"`
	NextOpenID string `json:"next_openid"`
}

OpenidList 用户列表

type TagInfo added in v2.0.2

type TagInfo struct {
	ID    int32  `json:"id"`
	Name  string `json:"name"`
	Count int64  `json:"count"`
}

TagInfo 标签信息

type TagOpenIDList added in v2.0.2

type TagOpenIDList struct {
	Count int `json:"count"`
	Data  struct {
		OpenIDs []string `json:"openid"`
	} `json:"data"`
	NextOpenID string `json:"next_openid"`
}

TagOpenIDList 标签用户列表

type User

type User struct {
	*context.Context
}

User 用户管理

func NewUser

func NewUser(context *context.Context) *User

NewUser 实例化

func (*User) BatchTag added in v2.0.2

func (user *User) BatchTag(openIDList []string, tagID int32) (err error)

BatchTag 批量为用户打标签

func (*User) BatchUntag added in v2.0.2

func (user *User) BatchUntag(openIDList []string, tagID int32) (err error)

BatchUntag 批量为用户取消标签

func (*User) CreateTag added in v2.0.2

func (user *User) CreateTag(tagName string) (tagInfo *TagInfo, err error)

CreateTag 创建标签

func (*User) DeleteTag added in v2.0.2

func (user *User) DeleteTag(tagID int32) (err error)

DeleteTag 删除标签

func (*User) GetTag added in v2.0.2

func (user *User) GetTag() (tags []*TagInfo, err error)

GetTag 获取公众号已创建的标签

func (*User) GetUserInfo

func (user *User) GetUserInfo(openID string) (userInfo *Info, err error)

GetUserInfo 获取用户基本信息

func (*User) ListAllUserOpenIDs

func (user *User) ListAllUserOpenIDs() ([]string, error)

ListAllUserOpenIDs 返回所有用户OpenID列表

func (*User) ListUserOpenIDs

func (user *User) ListUserOpenIDs(nextOpenid ...string) (*OpenidList, error)

ListUserOpenIDs 返回用户列表

func (*User) OpenIDListByTag added in v2.0.2

func (user *User) OpenIDListByTag(tagID int32, nextOpenID ...string) (userList *TagOpenIDList, err error)

OpenidListByTag 获取标签下粉丝列表

func (*User) UpdateRemark

func (user *User) UpdateRemark(openID, remark string) (err error)

UpdateRemark 设置用户备注名

func (*User) UpdateTag added in v2.0.2

func (user *User) UpdateTag(tagID int32, tagName string) (err error)

UpdateTag 编辑标签

func (*User) UserTidList added in v2.0.2

func (user *User) UserTidList(openID string) (tagIDList []int32, err error)

UserTidList 获取用户身上的标签列表

Jump to

Keyboard shortcuts

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