Documentation
¶
Index ¶
- Constants
- type App
- func (app *App) BusinessGetLiveInfo(notMustParams ...Params) *BusinessGetLiveInfoResult
- func (app *App) CgiBinToken() *CgiBinTokenResult
- func (app *App) CgiBinWxaAppCreateWxaQrCode(notMustParams ...Params) *CgiBinWxaAppCreateWxaQrCodeResult
- func (app *App) GetAccessToken() string
- func (app *App) GetAccessTokenMonitor() (string, error)
- func (app *App) GetCallBackIp() *GetCallBackIpResult
- func (app *App) NewParamsWith(params ...Params) Params
- func (app *App) SaveImg(resp gohttp.Response, dir, saveName string) SaveImgResponse
- func (app *App) SnsJsCode2session(jsCode string) *SnsJsCode2sessionResult
- func (app *App) SubscribeMessageSend(notMustParams ...Params) *SubscribeMessageSendResult
- func (app *App) UserInfo(param UserInfo) *UserInfoResult
- func (app *App) UserPhone(param UserPhone) *UserPhoneResult
- func (app *App) WxaBusinessGetUserPhoneNumber(code string) *WxaBusinessGetUserPhoneNumberResult
- func (app *App) WxaGenerateScheme(notMustParams ...Params) *WxaGenerateSchemeResult
- func (app *App) WxaGenerateUrlLink(notMustParams ...Params) *WxaGenerateUrlLinkResult
- func (app *App) WxaGetWxaCode(notMustParams ...Params) *WxaGetWxaCodeResult
- func (app *App) WxaGetWxaCodeUnLimit(notMustParams ...Params) *WxaGetWxaCodeUnLimitResult
- func (app *App) WxaQueryScheme(notMustParams ...Params) *WxaQuerySchemeResult
- func (app *App) WxaQueryUrlLink(urlLink string) *WxaQueryUrlLinkResult
- type BusinessGetLiveInfoResponse
- type BusinessGetLiveInfoResult
- type CgiBinTokenResponse
- type CgiBinTokenResult
- type CgiBinWxaAppCreateWxaQrCodeResponse
- type CgiBinWxaAppCreateWxaQrCodeResult
- type GetCallBackIpResponse
- type GetCallBackIpResult
- type Params
- type SaveImgResponse
- type SnsJsCode2sessionResponse
- type SnsJsCode2sessionResult
- type SubscribeMessageSendResponse
- type SubscribeMessageSendResult
- type UserInfo
- type UserInfoResponse
- type UserInfoResult
- type UserPhone
- type UserPhoneResponse
- type UserPhoneResult
- type WxaBusinessGetUserPhoneNumberResponse
- type WxaBusinessGetUserPhoneNumberResult
- type WxaGenerateSchemeResponse
- type WxaGenerateSchemeResult
- type WxaGenerateUrlLinkResponse
- type WxaGenerateUrlLinkResult
- type WxaGetWxaCodeResponse
- type WxaGetWxaCodeResult
- type WxaGetWxaCodeUnLimitResponse
- type WxaGetWxaCodeUnLimitResult
- type WxaQuerySchemeResponse
- type WxaQuerySchemeResult
- type WxaQueryUrlLinkResponse
- type WxaQueryUrlLinkResult
Constants ¶
const ( WECHAT_API_URL = "https://api.weixin.qq.com" WECHAT_MP_URL = "https://mp.weixin.qq.com" CGIUrl = WECHAT_API_URL + "/cgi-bin" UnionUrl = WECHAT_API_URL + "/union" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
AppId string // 小程序唯一凭证,即 AppID
AppSecret string // 小程序唯一凭证密钥,即 AppSecret
AccessToken string // 接口调用凭证
JsapiTicket string // 签名凭证
Redis goredis.App // 缓存数据库服务
Mongo gomongo.App // 日志数据库
}
App 微信小程序服务
func (*App) BusinessGetLiveInfo ¶
func (app *App) BusinessGetLiveInfo(notMustParams ...Params) *BusinessGetLiveInfoResult
BusinessGetLiveInfo 获取直播间列表 调用此接口获取直播间列表及直播间信息 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/liveplayer/studio-api.html
func (*App) CgiBinToken ¶
func (app *App) CgiBinToken() *CgiBinTokenResult
CgiBinToken 接口调用凭证 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html
func (*App) CgiBinWxaAppCreateWxaQrCode ¶
func (app *App) CgiBinWxaAppCreateWxaQrCode(notMustParams ...Params) *CgiBinWxaAppCreateWxaQrCodeResult
CgiBinWxaAppCreateWxaQrCode 获取小程序二维码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.createQRCode.html
func (*App) GetAccessToken ¶
func (*App) GetAccessTokenMonitor ¶
func (*App) GetCallBackIp ¶
func (app *App) GetCallBackIp() *GetCallBackIpResult
GetCallBackIp 获取微信callback IP地址 callback IP即微信调用开发者服务器所使用的出口IP。 https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_the_WeChat_server_IP_address.html#2.%20%E8%8E%B7%E5%8F%96%E5%BE%AE%E4%BF%A1callback%20IP%E5%9C%B0%E5%9D%80
func (*App) NewParamsWith ¶
func (*App) SaveImg ¶
func (app *App) SaveImg(resp gohttp.Response, dir, saveName string) SaveImgResponse
func (*App) SnsJsCode2session ¶
func (app *App) SnsJsCode2session(jsCode string) *SnsJsCode2sessionResult
func (*App) SubscribeMessageSend ¶
func (app *App) SubscribeMessageSend(notMustParams ...Params) *SubscribeMessageSendResult
SubscribeMessageSend 发送订阅消息 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html
func (*App) UserPhone ¶
func (app *App) UserPhone(param UserPhone) *UserPhoneResult
UserPhone 解密手机号信息
func (*App) WxaBusinessGetUserPhoneNumber ¶
func (app *App) WxaBusinessGetUserPhoneNumber(code string) *WxaBusinessGetUserPhoneNumberResult
WxaBusinessGetUserPhoneNumber code换取用户手机号。 每个code只能使用一次,code的有效期为5min https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/phonenumber/phonenumber.getPhoneNumber.html
func (*App) WxaGenerateScheme ¶
func (app *App) WxaGenerateScheme(notMustParams ...Params) *WxaGenerateSchemeResult
WxaGenerateScheme 获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。通过该接口,可以选择生成到期失效和永久有效的小程序码,有数量限制,目前仅针对国内非个人主体的小程序开放 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.generate.html
func (*App) WxaGenerateUrlLink ¶
func (app *App) WxaGenerateUrlLink(notMustParams ...Params) *WxaGenerateUrlLinkResult
WxaGenerateUrlLink 获取小程序 URL Link,适用于短信、邮件、网页、微信内等拉起小程序的业务场景。通过该接口,可以选择生成到期失效和永久有效的小程序链接,有数量限制,目前仅针对国内非个人主体的小程序开放 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.generate.html
func (*App) WxaGetWxaCode ¶
func (app *App) WxaGetWxaCode(notMustParams ...Params) *WxaGetWxaCodeResult
WxaGetWxaCode 获取小程序码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.get.html
func (*App) WxaGetWxaCodeUnLimit ¶
func (app *App) WxaGetWxaCodeUnLimit(notMustParams ...Params) *WxaGetWxaCodeUnLimitResult
WxaGetWxaCodeUnLimit 获取小程序码,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.getUnlimited.html
func (*App) WxaQueryScheme ¶
func (app *App) WxaQueryScheme(notMustParams ...Params) *WxaQuerySchemeResult
WxaQueryScheme 查询小程序 scheme 码,及长期有效 quota https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-scheme/urlscheme.query.html
func (*App) WxaQueryUrlLink ¶
func (app *App) WxaQueryUrlLink(urlLink string) *WxaQueryUrlLinkResult
WxaQueryUrlLink 查询小程序 url_link 配置,及长期有效 quota https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.query.html
type BusinessGetLiveInfoResponse ¶
type BusinessGetLiveInfoResponse struct {
Errcode int `json:"errcode"` // // 错误码,0代表成功,1代表未创建直播间
Errmsg string `json:"errmsg"` // 错误信息
Total int `json:"total"`
RoomInfo []struct {
Name string `json:"name"` // 直播间名称
Roomid int `json:"roomid"` // 直播间ID
CoverImg string `json:"cover_img"`
ShareImg string `json:"share_img"`
LiveStatus int `json:"live_status"`
StartTime int `json:"start_time"`
EndTime int `json:"end_time"`
AnchorName string `json:"anchor_name"`
Goods []struct {
CoverImg string `json:"cover_img"`
Url string `json:"url"`
Name string `json:"name"`
Price int `json:"price"`
Price2 int `json:"price2"`
PriceType int `json:"price_type"`
GoodsId int `json:"goods_id"`
ThirdPartyAppid string `json:"third_party_appid"`
} `json:"goods"`
LiveType int `json:"live_type"`
CloseLike int `json:"close_like"`
CloseGoods int `json:"close_goods"`
CloseComment int `json:"close_comment"`
CloseKf int `json:"close_kf"`
CloseReplay int `json:"close_replay"`
IsFeedsPublic int `json:"is_feeds_public"`
CreaterOpenid string `json:"creater_openid"`
FeedsImg string `json:"feeds_img"`
} `json:"room_info"`
}
type BusinessGetLiveInfoResult ¶
type BusinessGetLiveInfoResult struct {
Result BusinessGetLiveInfoResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewBusinessGetLiveInfoResult ¶
func NewBusinessGetLiveInfoResult(result BusinessGetLiveInfoResponse, body []byte, http gohttp.Response, err error) *BusinessGetLiveInfoResult
type CgiBinTokenResponse ¶
type CgiBinTokenResult ¶
type CgiBinTokenResult struct {
Result CgiBinTokenResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewCgiBinTokenResult ¶
func NewCgiBinTokenResult(result CgiBinTokenResponse, body []byte, http gohttp.Response, err error) *CgiBinTokenResult
type CgiBinWxaAppCreateWxaQrCodeResult ¶
type CgiBinWxaAppCreateWxaQrCodeResult struct {
Result CgiBinWxaAppCreateWxaQrCodeResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewCgiBinWxaAppCreateWxaQrCodeResult ¶
func NewCgiBinWxaAppCreateWxaQrCodeResult(result CgiBinWxaAppCreateWxaQrCodeResponse, body []byte, http gohttp.Response, err error) *CgiBinWxaAppCreateWxaQrCodeResult
type GetCallBackIpResponse ¶
type GetCallBackIpResponse struct {
IpList []string `json:"ip_list"`
}
type GetCallBackIpResult ¶
type GetCallBackIpResult struct {
Result GetCallBackIpResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewGetCallBackIpResult ¶
func NewGetCallBackIpResult(result GetCallBackIpResponse, body []byte, http gohttp.Response, err error) *GetCallBackIpResult
type SaveImgResponse ¶
type SnsJsCode2sessionResult ¶
type SnsJsCode2sessionResult struct {
Result SnsJsCode2sessionResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewSnsJsCode2sessionResult ¶
func NewSnsJsCode2sessionResult(result SnsJsCode2sessionResponse, body []byte, http gohttp.Response, err error) *SnsJsCode2sessionResult
type SubscribeMessageSendResult ¶
type SubscribeMessageSendResult struct {
Result SubscribeMessageSendResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewSubscribeMessageSendResult ¶
func NewSubscribeMessageSendResult(result SubscribeMessageSendResponse, body []byte, http gohttp.Response, err error) *SubscribeMessageSendResult
type UserInfoResponse ¶
type UserInfoResponse struct {
OpenID string `json:"openId"`
NickName string `json:"nickName"`
Gender int `json:"gender"`
City string `json:"city"`
Province string `json:"province"`
Country string `json:"country"`
AvatarUrl string `json:"avatarUrl"`
UnionId string `json:"unionId"`
Watermark struct {
AppID string `json:"appid"`
Timestamp int64 `json:"timestamp"`
} `json:"watermark"`
}
func (*UserInfoResponse) UserInfoAvatarUrlReal ¶
func (u *UserInfoResponse) UserInfoAvatarUrlReal() string
type UserInfoResult ¶
type UserInfoResult struct {
Result UserInfoResponse // 结果
Err error // 错误
}
func NewUserInfoResult ¶
func NewUserInfoResult(result UserInfoResponse, err error) *UserInfoResult
type UserPhoneResponse ¶
type UserPhoneResponse struct {
PhoneNumber string `json:"phoneNumber"` // 用户绑定的手机号(国外手机号会有区号)
PurePhoneNumber string `json:"purePhoneNumber"` // 没有区号的手机号
CountryCode string `json:"countryCode"` // 区号
Watermark struct {
AppID string `json:"appid"`
Timestamp int64 `json:"timestamp"`
} `json:"watermark"`
}
type UserPhoneResult ¶
type UserPhoneResult struct {
Result UserPhoneResponse // 结果
Err error // 错误
}
func NewUserPhoneResult ¶
func NewUserPhoneResult(result UserPhoneResponse, err error) *UserPhoneResult
type WxaBusinessGetUserPhoneNumberResponse ¶
type WxaBusinessGetUserPhoneNumberResponse struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
PhoneInfo struct {
PhoneNumber string `json:"phoneNumber"` // 用户绑定的手机号(国外手机号会有区号)
PurePhoneNumber string `json:"purePhoneNumber"` // 没有区号的手机号
CountryCode int `json:"countryCode"` // 区号
Watermark struct {
Timestamp int `json:"timestamp"` // 用户获取手机号操作的时间戳
Appid string `json:"appid"` // 小程序appid
} `json:"watermark"`
} `json:"phone_info"`
}
type WxaBusinessGetUserPhoneNumberResult ¶
type WxaBusinessGetUserPhoneNumberResult struct {
Result WxaBusinessGetUserPhoneNumberResponse // 结果
Body []byte // 内容
Err error // 错误
}
func NewWxaBusinessGetUserPhoneNumberResult ¶
func NewWxaBusinessGetUserPhoneNumberResult(result WxaBusinessGetUserPhoneNumberResponse, body []byte, err error) *WxaBusinessGetUserPhoneNumberResult
type WxaGenerateSchemeResult ¶
type WxaGenerateSchemeResult struct {
Result WxaGenerateSchemeResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewWxaGenerateSchemeResult ¶
func NewWxaGenerateSchemeResult(result WxaGenerateSchemeResponse, body []byte, http gohttp.Response, err error) *WxaGenerateSchemeResult
type WxaGenerateUrlLinkResult ¶
type WxaGenerateUrlLinkResult struct {
Result WxaGenerateUrlLinkResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewWxaGenerateUrlLinkResult ¶
func NewWxaGenerateUrlLinkResult(result WxaGenerateUrlLinkResponse, body []byte, http gohttp.Response, err error) *WxaGenerateUrlLinkResult
type WxaGetWxaCodeResponse ¶
type WxaGetWxaCodeResult ¶
type WxaGetWxaCodeResult struct {
Result WxaGetWxaCodeResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewWxaGetWxaCodeResult ¶
func NewWxaGetWxaCodeResult(result WxaGetWxaCodeResponse, body []byte, http gohttp.Response, err error) *WxaGetWxaCodeResult
type WxaGetWxaCodeUnLimitResult ¶
type WxaGetWxaCodeUnLimitResult struct {
Result WxaGetWxaCodeUnLimitResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewWxaGetWxaCodeUnLimitResult ¶
func NewWxaGetWxaCodeUnLimitResult(result WxaGetWxaCodeUnLimitResponse, body []byte, http gohttp.Response, err error) *WxaGetWxaCodeUnLimitResult
type WxaQuerySchemeResponse ¶
type WxaQuerySchemeResponse struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
SchemeInfo struct {
Appid string `json:"appid"`
Path string `json:"path"`
Query string `json:"query"`
CreateTime int `json:"create_time"`
ExpireTime int `json:"expire_time"`
EnvVersion string `json:"env_version"`
} `json:"scheme_info"`
SchemeQuota struct {
LongTimeUsed int `json:"long_time_used"`
LongTimeLimit int `json:"long_time_limit"`
} `json:"scheme_quota"`
}
type WxaQuerySchemeResult ¶
type WxaQuerySchemeResult struct {
Result WxaQuerySchemeResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewWxaQuerySchemeResult ¶
func NewWxaQuerySchemeResult(result WxaQuerySchemeResponse, body []byte, http gohttp.Response, err error) *WxaQuerySchemeResult
type WxaQueryUrlLinkResponse ¶
type WxaQueryUrlLinkResponse struct {
Errcode int `json:"errcode"`
Errmsg string `json:"errmsg"`
UrlLinkInfo struct {
Appid string `json:"appid"`
Path string `json:"path"`
Query string `json:"query"`
CreateTime int `json:"create_time"`
ExpireTime int `json:"expire_time"`
EnvVersion string `json:"env_version"`
CloudBase struct {
Env string `json:"env"`
Doamin string `json:"doamin"`
Path string `json:"path"`
Query string `json:"query"`
ResourceAppid string `json:"resource_appid"`
} `json:"cloud_base"`
} `json:"url_link_info"`
UrlLinkQuota struct {
LongTimeUsed int `json:"long_time_used"`
LongTimeLimit int `json:"long_time_limit"`
} `json:"url_link_quota"`
}
type WxaQueryUrlLinkResult ¶
type WxaQueryUrlLinkResult struct {
Result WxaQueryUrlLinkResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewWxaQueryUrlLinkResult ¶
func NewWxaQueryUrlLinkResult(result WxaQueryUrlLinkResponse, body []byte, http gohttp.Response, err error) *WxaQueryUrlLinkResult
Source Files
¶
- app.go
- cgi-bin.getcallbackip.go
- cgi-bin.message.subscribe.send.go
- cgi-bin.token.go
- cgi-bin.token.monitor.go
- cgi-bin.token.rdb.go
- cgi-bin.wxaapp.createwxaqrcode.go
- mongodb.go
- params.go
- save_img.go
- sign.go
- sns.jscode2session.go
- user_info.go
- user_phone.go
- wxa.business.getliveinfo.go
- wxa.business.getuserphonenumber.go
- wxa.generate_urllink.go
- wxa.generatescheme.go
- wxa.getwxacode.go
- wxa.getwxacodeunlimit.go
- wxa.query_urllink.go
- wxa.queryscheme.go