user

package
v1.0.9 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: 6 Imported by: 0

Documentation

Overview

Package user migrate 用于微信公众号账号迁移,获取openID变化 参考文档:https://kf.qq.com/faq/1901177NrqMr190117nqYJze.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeOpenIDResult

type ChangeOpenIDResult struct {
	OriOpenID string `json:"ori_openid"`
	NewOpenID string `json:"new_openid"`
	ErrMsg    string `json:"err_msg,omitempty"`
}

ChangeOpenIDResult OpenID迁移变化

type ChangeOpenIDResultList

type ChangeOpenIDResultList struct {
	util.CommonError
	List []ChangeOpenIDResult `json:"result_list"`
}

ChangeOpenIDResultList OpenID迁移变化列表

type DetailList

type DetailList struct {
	util.CommonError
	Userlist []Userlist `json:"userlist"`
}

type Info

type Info struct {
	util.CommonError

	UserID         string `json:"userid"`
	Name           string `json:"name"`
	Mobile         string `json:"mobile"`
	Department     []int  `json:"department"`
	Gender         string `json:"gender"`
	Avatar         string `json:"avatar"`
	ThumbAvatar    string `json:"thumb_avatar"`
	IsLeaderInDept []int  `json:"is_leader_in_dept"`
}

Info 用户基本信息

type OpenidList

type OpenidList struct {
	util.CommonError

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

OpenidList 用户列表

type TagInfo

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

TagInfo 标签信息

type TagOpenIDList

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

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

BatchTag 批量为用户打标签

func (*User) BatchUntag

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

BatchUntag 批量为用户取消标签

func (*User) CreateTag

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

CreateTag 创建标签

func (*User) DeleteTag

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

DeleteTag 删除标签

func (*User) GetTag

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

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

func (*User) GetUserInfo

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

GetUserInfo 获取用户基本信息

func (*User) GetUserList

func (user *User) GetUserList(departmentId int) (userList *DetailList, err error)

GetUserInfo 获取用户基本信息

func (*User) ListAllChangeOpenIDs

func (user *User) ListAllChangeOpenIDs(fromAppID string, openIDs ...string) (list []ChangeOpenIDResult, err error)

ListAllChangeOpenIDs 返回所有用户OpenID列表 fromAppID 为老账号AppID openIDs 为老账号的openID AccessToken 为新账号的AccessToken

func (*User) ListAllUserUserIDs

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

ListAllUserOpenIDs 返回所有用户OpenID列表

func (*User) ListChangeOpenIDs

func (user *User) ListChangeOpenIDs(fromAppID string, openIDs ...string) (list *ChangeOpenIDResultList, err error)

ListChangeOpenIDs 返回指定OpenID变化列表 fromAppID 为老账号AppID openIDs 为老账号的openID,openIDs限100个以内 AccessToken 为新账号的AccessToken

func (*User) ListUserOpenIDs

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

ListUserOpenIDs 返回用户列表

func (*User) OpenIDListByTag

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

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

UpdateTag 编辑标签

func (*User) UserTidList

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

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

type Userlist

type Userlist struct {
	Userid         string `json:"userid"`
	Name           string `json:"name"`
	Department     []int  `json:"department"`
	Order          []int  `json:"order"`
	Position       string `json:"position"`
	Mobile         string `json:"mobile"`
	Gender         string `json:"gender"`
	Email          string `json:"email"`
	IsLeaderInDept []int  `json:"is_leader_in_dept"`
	Avatar         string `json:"avatar"`
	ThumbAvatar    string `json:"thumb_avatar"`
	Telephone      string `json:"telephone"`
	Alias          string `json:"alias"`
	Status         string `json:"status"`
	MainDepartment string `json:"main_department"`
}

Jump to

Keyboard shortcuts

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