miniprogram

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

README

微信小程序

官方文档

包说明

  • analysis 数据分析相关API

快速入门

wc := wechat.NewWechat()
memory := cache.NewMemory()
cfg := &miniConfig.Config{
    AppID:     "xxx",
    AppSecret: "xxx",
    Cache: memory,
}
miniprogram := wc.GetMiniProgram(cfg)
miniprogram.GetAnalysis().GetAnalysisDailyRetain()
小程序虚拟支付
注意:需要传入 Appkey 的值

相关文档:小程序虚拟支付

wc := wechat.NewWechat()
miniprogram := wc.GetMiniProgram(&miniConfig.Config{
    AppID:     "xxx",
    AppSecret: "xxx",
    AppKey:    "xxx",
    OfferID:   "xxx",
    Cache: cache.NewRedis(&redis.Options{
        Addr: "",
    }),
})
virtualPayment := miniprogram.GetVirtualPayment()
virtualPayment.SetSessionKey("xxx")
// 查询用户余额
var (
    res *virtualPayment.QueryUserBalanceResponse
    err error
)

if res, err = virtualPayment.QueryUserBalance(context.TODO(), &virtualPayment.QueryUserBalanceRequest{
    OpenID: "xxx",
    Env: virtualPayment.EnvProduction,
    UserIP: "xxx",
}); err != nil {
    panic(err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MiniProgram

type MiniProgram struct {
	// contains filtered or unexported fields
}

MiniProgram 微信小程序相关API

func NewMiniProgram

func NewMiniProgram(cfg *config.Config) *MiniProgram

NewMiniProgram 实例化小程序API

func (*MiniProgram) GetAnalysis

func (miniProgram *MiniProgram) GetAnalysis() *analysis.Analysis

GetAnalysis 数据分析

func (*MiniProgram) GetAuth

func (miniProgram *MiniProgram) GetAuth() *auth.Auth

GetAuth 登录/用户信息相关接口

func (*MiniProgram) GetBusiness added in v0.1.7

func (miniProgram *MiniProgram) GetBusiness() *business.Business

GetBusiness 业务接口

func (*MiniProgram) GetContentSecurity

func (miniProgram *MiniProgram) GetContentSecurity() *content.Content

GetContentSecurity 内容安全接口

func (*MiniProgram) GetContext

func (miniProgram *MiniProgram) GetContext() *context.Context

GetContext get Context

func (*MiniProgram) GetCustomerMessage

func (miniProgram *MiniProgram) GetCustomerMessage() *message.Manager

GetCustomerMessage 客服消息接口

func (*MiniProgram) GetEncryptor

func (miniProgram *MiniProgram) GetEncryptor() *encryptor.Encryptor

GetEncryptor 小程序加解密

func (*MiniProgram) GetMessageReceiver added in v0.2.5

func (miniProgram *MiniProgram) GetMessageReceiver() *message.PushReceiver

GetMessageReceiver 获取消息推送接收器

func (*MiniProgram) GetMiniDrama added in v0.2.5

func (miniProgram *MiniProgram) GetMiniDrama() *minidrama.MiniDrama

GetMiniDrama 小程序娱乐微短剧

func (*MiniProgram) GetOpenAPI added in v0.2.3

func (miniProgram *MiniProgram) GetOpenAPI() *openapi.OpenAPI

GetOpenAPI openApi管理接口

func (*MiniProgram) GetPrivacy added in v0.1.4

func (miniProgram *MiniProgram) GetPrivacy() *privacy.Privacy

GetPrivacy 小程序隐私协议相关API

func (*MiniProgram) GetQRCode

func (miniProgram *MiniProgram) GetQRCode() *qrcode.QRCode

GetQRCode 小程序码相关API

func (*MiniProgram) GetRedPacketCover added in v0.3.0

func (miniProgram *MiniProgram) GetRedPacketCover() *redpacketcover.RedPacketCover

GetRedPacketCover 小程序微信红包封面 API

func (*MiniProgram) GetRiskControl added in v0.1.7

func (miniProgram *MiniProgram) GetRiskControl() *riskcontrol.RiskControl

GetRiskControl 安全风控接口

func (*MiniProgram) GetSecurity added in v0.1.7

func (miniProgram *MiniProgram) GetSecurity() *security.Security

GetSecurity 内容安全接口

func (*MiniProgram) GetShipping added in v0.2.5

func (miniProgram *MiniProgram) GetShipping() *order.Shipping

GetShipping 小程序发货信息管理服务

func (miniProgram *MiniProgram) GetShortLink() *shortlink.ShortLink

GetShortLink 小程序短链接口

func (*MiniProgram) GetSubscribe

func (miniProgram *MiniProgram) GetSubscribe() *subscribe.Subscribe

GetSubscribe 小程序订阅消息

func (*MiniProgram) GetTcb

func (miniProgram *MiniProgram) GetTcb() *tcb.Tcb

GetTcb 小程序云开发API

func (miniProgram *MiniProgram) GetURLLink() *urllink.URLLink

GetURLLink 小程序URL Link接口

func (*MiniProgram) GetUpdatableMessage added in v0.4.0

func (miniProgram *MiniProgram) GetUpdatableMessage() *message.UpdatableMessage

GetUpdatableMessage 小程序动态消息

func (*MiniProgram) GetVirtualPayment added in v0.2.5

func (miniProgram *MiniProgram) GetVirtualPayment() *virtualpayment.VirtualPayment

GetVirtualPayment 小程序虚拟支付

func (*MiniProgram) GetWeRun

func (miniProgram *MiniProgram) GetWeRun() *werun.WeRun

GetWeRun 微信运动接口

func (*MiniProgram) SetAccessTokenHandle

func (miniProgram *MiniProgram) SetAccessTokenHandle(accessTokenHandle credential.AccessTokenHandle)

SetAccessTokenHandle 自定义access_token获取方式

Directories

Path Synopsis
Package config 小程序 config 配置
Package config 小程序 config 配置
Package minidrama Mini Program entertainment mini-drama related interface
Package minidrama Mini Program entertainment mini-drama related interface
Package virtualpayment mini program virtual payment
Package virtualpayment mini program virtual payment

Jump to

Keyboard shortcuts

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