Documentation ¶
Index ¶
- Constants
- func JsSDKUsePermissionSign(jsapiTicket, nonceStr, url string, timestamp int) (sign string)
- type AccessToken
- type ErrorCode
- type FansData
- type QRCodeRsp
- type SDK
- func (s *SDK) DoRequestGet(c context.Context, path string, ptr any) (res *http.Response, err error)
- func (s *SDK) GetApiTicket(c context.Context) (at *TicketRsp, err error)
- func (s *SDK) GetJsApiTicket(c context.Context) (jt *TicketRsp, err error)
- func (s *SDK) GetPublicAccessToken() (at string)
- func (s *SDK) QRCodeCreate(c context.Context, body bm.BodyMap) (qr *QRCodeRsp, err error)
- func (s *SDK) SetHttpClient(client *xhttp.Client)
- func (s *SDK) SetLogger(logger xlog.XLogger)
- func (s *SDK) SetPublicAccessToken(accessToken string)
- func (s *SDK) SetPublicAccessTokenCallback(fn func(appid, accessToken string, expireIn int, err error))
- func (s *SDK) ShortKeyFetch(c context.Context, shortKey string) (skf *ShortKeyFetchRsp, err error)
- func (s *SDK) ShortKeyGen(c context.Context, body bm.BodyMap) (skg *ShortKeyGenRsp, err error)
- func (s *SDK) UserTagBatchTagging(c context.Context, tagId int, openidList []string) (err error)
- func (s *SDK) UserTagBatchUnTagging(c context.Context, tagId int, openidList []string) (err error)
- func (s *SDK) UserTagCreate(c context.Context, tagName string) (ut *UserTagRsp, err error)
- func (s *SDK) UserTagDelete(c context.Context, tagId int) (err error)
- func (s *SDK) UserTagFansList(c context.Context, tagId int, openid string) (utf *UserTagFansListRsp, err error)
- func (s *SDK) UserTagIdList(c context.Context, openid string) (uti *UserTagIdListRsp, err error)
- func (s *SDK) UserTagList(c context.Context) (utl *UserTagListRsp, err error)
- func (s *SDK) UserTagUpdate(c context.Context, tagId int, tagName string) (err error)
- type ShortKeyFetchRsp
- type ShortKeyGenRsp
- type Tag
- type TicketRsp
- type UserTagFansListRsp
- type UserTagIdListRsp
- type UserTagListRsp
- type UserTagRsp
Constants ¶
const ( Success = 0 HostDefault = "https://api.weixin.qq.com" )
Variables ¶
This section is empty.
Functions ¶
func JsSDKUsePermissionSign ¶ added in v1.1.5
JsSDKUsePermissionSign 获取JS-SDK使用权限签名 文档介绍:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62
Types ¶
type AccessToken ¶ added in v1.1.2
type SDK ¶
type SDK struct { DebugSwitch wechat.DebugSwitch Appid string Secret string Host string RefreshInternal time.Duration // contains filtered or unexported fields }
func (*SDK) DoRequestGet ¶ added in v1.1.2
func (*SDK) GetApiTicket ¶ added in v1.1.5
GetApiTicket 获取卡券 api_ticket 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#54
func (*SDK) GetJsApiTicket ¶ added in v1.1.5
GetJsApiTicket 获取 jsapi_ticket 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62
func (*SDK) GetPublicAccessToken ¶ added in v1.1.2
GetPublicAccessToken get public access token string
func (*SDK) QRCodeCreate ¶
QRCodeCreate 生成带参数的二维码 注意:errcode = 0 为成功 注意:expire_seconds 字段不传,代表永久二维码。 文档:https://developers.weixin.qq.com/doc/offiaccount/Account_Management/Generating_a_Parametric_QR_Code.html
func (*SDK) SetHttpClient ¶ added in v1.1.6
SetHttpClient 设置自定义的xhttp.Client
func (*SDK) SetPublicAccessToken ¶ added in v1.1.2
SetPublicAccessToken set public access token string
func (*SDK) SetPublicAccessTokenCallback ¶ added in v1.1.2
func (s *SDK) SetPublicAccessTokenCallback(fn func(appid, accessToken string, expireIn int, err error))
SetPublicAccessTokenCallback set public access token callback listener
func (*SDK) ShortKeyFetch ¶
ShortKeyFetch 获取托管的短key 注意:errcode = 0 为成功 shortKey:短key 文档:https://developers.weixin.qq.com/doc/offiaccount/Account_Management/KEY_Shortener.html
func (*SDK) ShortKeyGen ¶
ShortKeyGen 生成短key托管 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/Account_Management/KEY_Shortener.html
func (*SDK) UserTagBatchTagging ¶
UserTagBatchTagging 批量为用户打标签 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html
func (*SDK) UserTagBatchUnTagging ¶
UserTagBatchUnTagging 批量为用户取消标签 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html
func (*SDK) UserTagCreate ¶
UserTagCreate 用户标签创建 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html
func (*SDK) UserTagDelete ¶
UserTagDelete 用户标签删除 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html
func (*SDK) UserTagFansList ¶
func (s *SDK) UserTagFansList(c context.Context, tagId int, openid string) (utf *UserTagFansListRsp, err error)
UserTagFansList 获取标签下粉丝列表 注意:errcode = 0 为成功 openid:第一个拉取的 openid,不填默认从头开始拉取 文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html
func (*SDK) UserTagIdList ¶
UserTagIdList 获取用户身上的标签列表 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html
func (*SDK) UserTagList ¶
func (s *SDK) UserTagList(c context.Context) (utl *UserTagListRsp, err error)
UserTagList 获取已创建的用户标签列表 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html
func (*SDK) UserTagUpdate ¶
UserTagUpdate 用户标签编辑更新 注意:errcode = 0 为成功 文档:https://developers.weixin.qq.com/doc/offiaccount/User_Management/User_Tag_Management.html