Documentation
¶
Index ¶
- Variables
- type App
- func (app *App) AuthCode2Session(jsCode string) *AuthCode2SessionResult
- func (app *App) AuthGetAccessToken() *AuthGetAccessTokenResult
- func (app *App) AuthGetAccessTokenMonitor(qdType string) (string, error)
- func (app *App) BusinessGetLiveInfo(notMustParams ...Params) *BusinessGetLiveInfoResult
- func (app *App) CgiBinWxaAppCreateWxaQrCode(notMustParams ...Params) *CgiBinWxaAppCreateWxaQrCodeResult
- func (app *App) GetAccessTokenDb() string
- func (app *App) GetAccessTokenRDb() string
- 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) SubscribeMessageSend(notMustParams ...Params) *SubscribeMessageSendResult
- func (app *App) UserInfo(param UserInfo) *UserInfoResult
- func (app *App) UserPhone(param UserPhone) *UserPhoneResult
- 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 AuthCode2SessionResponse
- type AuthCode2SessionResult
- type AuthGetAccessTokenResponse
- type AuthGetAccessTokenResult
- type BusinessGetLiveInfoResponse
- type BusinessGetLiveInfoResult
- type CgiBinWxaAppCreateWxaQrCodeResponse
- type CgiBinWxaAppCreateWxaQrCodeResult
- type GetCallBackIpResponse
- type GetCallBackIpResult
- type Params
- type SaveImgResponse
- type SubscribeMessageSendResponse
- type SubscribeMessageSendResult
- type UserInfo
- type UserInfoResponse
- type UserInfoResult
- type UserPhone
- type UserPhoneResponse
- type UserPhoneResult
- type WechatAccessTokenDbModel
- 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 ¶
This section is empty.
Variables ¶
var ( QdTypeDb = "DB" QdTypeRdb = "redis" )
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
AppId string // 小程序唯一凭证,即 AppID
AppSecret string // 小程序唯一凭证密钥,即 AppSecret
AccessToken string // 接口调用凭证
JsapiTicket string // 签名凭证
ZapLog *zap.Logger // 日志服务
Db *gorm.DB // 关系数据库服务
RDb *redis.Client // 缓存数据库服务
MDb *mongo.Client // 非关系数据库服务
}
App 微信小程序服务
func (*App) AuthCode2Session ¶
func (app *App) AuthCode2Session(jsCode string) *AuthCode2SessionResult
func (*App) AuthGetAccessToken ¶
func (app *App) AuthGetAccessToken() *AuthGetAccessTokenResult
AuthGetAccessToken 接口调用凭证 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html
func (*App) AuthGetAccessTokenMonitor ¶
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) 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) GetAccessTokenDb ¶
func (*App) GetAccessTokenRDb ¶
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) 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) 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 AuthCode2SessionResult ¶
type AuthCode2SessionResult struct {
Result AuthCode2SessionResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewAuthCode2SessionResult ¶
func NewAuthCode2SessionResult(result AuthCode2SessionResponse, body []byte, http gohttp.Response, err error) *AuthCode2SessionResult
type AuthGetAccessTokenResult ¶
type AuthGetAccessTokenResult struct {
Result AuthGetAccessTokenResponse // 结果
Body []byte // 内容
Http gohttp.Response // 请求
Err error // 错误
}
func NewAuthGetAccessTokenResult ¶
func NewAuthGetAccessTokenResult(result AuthGetAccessTokenResponse, body []byte, http gohttp.Response, err error) *AuthGetAccessTokenResult
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 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 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"`
}
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 WechatAccessTokenDbModel ¶
type WechatAccessTokenDbModel struct {
ID int64 `json:"id"`
AppID string `json:"app_id"`
AppSecret string `json:"app_secret"`
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
ExpiresTime string `json:"expires_time"`
CreateTime time.Time `gorm:"autoCreateTime" json:"-"`
}
func (*WechatAccessTokenDbModel) TableName ¶
func (m *WechatAccessTokenDbModel) TableName() string
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.db.go
- cgi-bin.token.go
- cgi-bin.token.monitor.go
- cgi-bin.token.rdb.go
- cgi-bin.wxaapp.createwxaqrcode.go
- params.go
- save_img.go
- sign.go
- sns.jscode2session.go
- user_info.go
- user_phone.go
- wxa.business.getliveinfo.go
- wxa.generate_urllink.go
- wxa.generatescheme.go
- wxa.getwxacode.go
- wxa.getwxacodeunlimit.go
- wxa.query_urllink.go
- wxa.queryscheme.go