Documentation ¶
Overview ¶
Package user blacklist 公众号用户黑名单管理 参考文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/Manage_blacklist.html
Package user migrate 用于微信公众号账号迁移,获取openID变化 参考文档:https://kf.qq.com/faq/1901177NrqMr190117nqYJze.html
Index ¶
- type BatchGetUserInfoParams
- type BatchGetUserListItem
- type ChangeOpenIDResult
- type ChangeOpenIDResultList
- type Info
- type InfoList
- type OpenidList
- type TagInfo
- type TagOpenIDList
- type User
- func (user *User) BatchBlackList(ctx context.Context, openidList ...string) (err error)
- func (user *User) BatchGetUserInfo(ctx context.Context, params BatchGetUserInfoParams) (*InfoList, error)
- func (user *User) BatchTag(ctx context.Context, openIDList []string, tagID int32) (err error)
- func (user *User) BatchUnBlackList(ctx context.Context, openidList ...string) (err error)
- func (user *User) BatchUntag(ctx context.Context, openIDList []string, tagID int32) (err error)
- func (user *User) CreateTag(ctx context.Context, tagName string) (tagInfo *TagInfo, err error)
- func (user *User) DeleteTag(ctx context.Context, tagID int32) (err error)
- func (user *User) GetAllBlackList(ctx context.Context) (openIDList []string, err error)
- func (user *User) GetBlackList(ctx context.Context, beginOpenid ...string) (userlist *OpenidList, err error)
- func (user *User) GetTag(ctx context.Context) (tags []*TagInfo, err error)
- func (user *User) GetUserInfo(ctx context.Context, openID string) (userInfo *Info, err error)
- func (user *User) ListAllChangeOpenIDs(ctx context.Context, fromAppID string, openIDs ...string) (list []ChangeOpenIDResult, err error)
- func (user *User) ListAllUserOpenIDs(ctx context.Context) ([]string, error)
- func (user *User) ListChangeOpenIDs(ctx context.Context, fromAppID string, openIDs ...string) (list *ChangeOpenIDResultList, err error)
- func (user *User) ListUserOpenIDs(ctx context.Context, nextOpenid ...string) (*OpenidList, error)
- func (user *User) OpenIDListByTag(ctx context.Context, tagID int32, nextOpenID ...string) (userList *TagOpenIDList, err error)
- func (user *User) UpdateRemark(ctx context.Context, openID, remark string) (err error)
- func (user *User) UpdateTag(ctx context.Context, tagID int32, tagName string) (err error)
- func (user *User) UserTidList(ctx context.Context, openID string) (tagIDList []int32, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchGetUserInfoParams ¶ added in v0.2.3
type BatchGetUserInfoParams struct {
UserList []BatchGetUserListItem `json:"user_list"` // 需要批量获取基本信息的用户列表
}
BatchGetUserInfoParams 批量获取用户基本信息参数
type BatchGetUserListItem ¶ added in v0.2.3
type BatchGetUserListItem struct { OpenID string `json:"openid"` // 用户的标识,对当前公众号唯一 Lang string `json:"lang"` // 国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语,默认为zh-CN }
BatchGetUserListItem 需要获取基本信息的用户
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 Info ¶
type Info struct { util.CommonError // contains filtered or unexported fields }
Info 用户基本信息
type InfoList ¶ added in v0.2.3
type InfoList struct { util.CommonError UserInfoList []userInfo `json:"user_info_list"` }
InfoList 用户基本信息列表
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 TagOpenIDList ¶
type TagOpenIDList struct { Count int `json:"count"` Data struct { OpenIDs []string `json:"openid"` } `json:"data"` NextOpenID string `json:"next_openid"` }
TagOpenIDList 标签用户列表
type User ¶
User 用户管理
func (*User) BatchBlackList ¶ added in v0.2.0
BatchBlackList 拉黑用户 参数 openidList:需要拉入黑名单的用户的openid,每次拉黑最多允许20个
func (*User) BatchGetUserInfo ¶ added in v0.2.3
func (user *User) BatchGetUserInfo(ctx context.Context, params BatchGetUserInfoParams) (*InfoList, error)
BatchGetUserInfo 批量获取用户基本信息
func (*User) BatchUnBlackList ¶ added in v0.2.0
BatchUnBlackList 取消拉黑用户 参数 openidList:需要取消拉入黑名单的用户的openid,每次拉黑最多允许20个
func (*User) BatchUntag ¶
BatchUntag 批量为用户取消标签
func (*User) GetAllBlackList ¶ added in v0.2.0
GetAllBlackList 获取公众号的所有黑名单列表
func (*User) GetBlackList ¶ added in v0.2.0
func (user *User) GetBlackList(ctx context.Context, beginOpenid ...string) (userlist *OpenidList, err error)
GetBlackList 获取公众号的黑名单列表 该接口每次调用最多可拉取 1000 个OpenID,当列表数较多时,可以通过多次拉取的方式来满足需求。 参数 beginOpenid:当 begin_openid 为空时,默认从开头拉取。
func (*User) GetUserInfo ¶
GetUserInfo 获取用户基本信息
func (*User) ListAllChangeOpenIDs ¶
func (user *User) ListAllChangeOpenIDs(ctx context.Context, fromAppID string, openIDs ...string) (list []ChangeOpenIDResult, err error)
ListAllChangeOpenIDs 返回所有用户OpenID列表 fromAppID 为老账号AppID openIDs 为老账号的openID AccessToken 为新账号的AccessToken
func (*User) ListAllUserOpenIDs ¶
ListAllUserOpenIDs 返回所有用户OpenID列表
func (*User) ListChangeOpenIDs ¶
func (user *User) ListChangeOpenIDs(ctx context.Context, fromAppID string, openIDs ...string) (list *ChangeOpenIDResultList, err error)
ListChangeOpenIDs 返回指定OpenID变化列表 fromAppID 为老账号AppID openIDs 为老账号的openID,openIDs限100个以内 AccessToken 为新账号的AccessToken
func (*User) ListUserOpenIDs ¶
ListUserOpenIDs 返回用户列表
func (*User) OpenIDListByTag ¶
func (user *User) OpenIDListByTag(ctx context.Context, tagID int32, nextOpenID ...string) (userList *TagOpenIDList, err error)
OpenIDListByTag 获取标签下粉丝列表
func (*User) UpdateRemark ¶
UpdateRemark 设置用户备注名