weapp

package module
v3.6.17 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 26 Imported by: 4

README

微信小程序服务端 SDK (for Golang)

说明

  • v1 版本入口
  • v2 版本入口
  • 查看完整文档
  • SDK 暂不包含支付相关内容 已有很多优秀的支付相关模块;
  • 微信小程序的功能和接口一直在持续更新迭代,如果遇到没有的接口或者不符合当前实际情况的接口请提交 issue 或者发起 pull request;

获取代码


go get -u github.com/medivhzhan/weapp/v3

初始化

  • 初始化 SDK
package main

import (
 "github.com/medivhzhan/weapp/v3"
)

func main() {
 sdk := weapp.NewClient("your-appid", "your-secret")
}
  • 自定义 HTTP 客户端
package main

import (
 "crypto/tls"
 "net/http"
 "time"

 "github.com/medivhzhan/weapp/v3"
)

func main() {
 cli := &http.Client{
  Timeout: 10 * time.Second,
  Transport: &http.Transport{
   // 跳过安全校验
   TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
  },
 }

 sdk := weapp.NewClient(
  "your-appid",
  "your-secret",
  weapp.WithHttpClient(cli),
 )
}

  • 自定义日志
package main

import (
 "log"
 "os"

 "github.com/medivhzhan/weapp/v3"
 "github.com/medivhzhan/weapp/v3/logger"
)

func main() {
 lgr := logger.NewLogger(log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Info, true)

 sdk := weapp.NewClient(
  "your-appid",
  "your-secret",
  weapp.WithLogger(lgr),
 )

 // 任意切换日志等级
 sdk.SetLogLevel(logger.Silent)
}

  • 自定义缓存
package main

import (
 "time"

 "github.com/medivhzhan/weapp/v3"
)

type MyCache struct{}

func (cc *MyCache) Set(key string, val interface{}, timeout time.Duration) {
 // ...
}

func (cc *MyCache) Get(key string) (interface{}, bool) {
 return "your-access-token", true
}

func main() {
 cc := new(MyCache)

 sdk := weapp.NewClient(
  "your-appid",
  "your-secret",
  weapp.WithCache(cc),
 )
}

  • 自定义 token 获取方法
package main

import (
 "github.com/medivhzhan/weapp/v3"
)

func main() {
 tokenGetter := func() (token string, expireIn uint) {

  expireIn = 1000
  token = "your-custom-token"

  return token, expireIn
 }

 sdk := weapp.NewClient(
  "your-appid",
  "your-secret",
  weapp.WithAccessTokenSetter(tokenGetter),
 )
}


调用接口示例

官方文档

package main

import (
 "fmt"
 "log"

 "github.com/medivhzhan/weapp/v3"
 "github.com/medivhzhan/weapp/v3/auth"
)

func main() {
 sdk := weapp.NewClient("your-appid", "your-secret")

 cli := sdk.NewAuth()

    // 用户支付完成后获取该用户的 UnionId
 rsp, err := cli.GetPaidUnionId(&auth.GetPaidUnionIdRequest{})
 if err != nil {
  log.Fatal(err)
 }

    // 检查加密信息是否由微信生成
 rsp, err := cli.CheckEncryptedData(&auth.CheckEncryptedDataRequest{})
 if err != nil {
  log.Fatal(err)
 }

    // 登录凭证校验
 rsp, err := cli.Code2Session(&auth.Code2SessionRequest{})
 if err != nil {
  log.Fatal(err)
 }

    // 获取小程序全局唯一后台接口调用凭据
 rsp, err := cli.GetAccessToken(&auth.GetAccessTokenRequest{})
 if err != nil {
  log.Fatal(err)
 }

    // 检查微信是否返回错误
 if err := rsp.GetResponseError(); err != nil {
  log.Println(err)
 }

 fmt.Println(rsp)
}


接收微信通知

官方文档

package main

import (
 "log"
 "net/http"

 "github.com/medivhzhan/weapp/v3"
 "github.com/medivhzhan/weapp/v3/server"
)

func main() {
 sdk := weapp.NewClient("your-appid", "your-secret")

 //  通用处理器
 handler := func(req map[string]interface{}) map[string]interface{} {
  switch req["MsgType"] {
  case "text":
   // Do something cool ...
  }

  return nil
 }

    // HTTP handler
 http.HandleFunc("/wechat/notify", func(w http.ResponseWriter, r *http.Request) {
  srv, err := sdk.NewServer("token", "aesKey", "mchID", "apiKey", false, handler)
  if err != nil {
   log.Fatalf("init server error: %s", err)
  }

  // 调用事件处理器后 通用处理器不再处理该事件
  srv.OnCustomerServiceTextMessage(func(tmr *server.TextMessageResult) *server.TransferCustomerMessage {

   return &server.TransferCustomerMessage{}
  })

  if err := srv.Serve(w, r); err != nil {
   log.Fatalf("serving error: %s", err)
  }
 })
}

Documentation

Index

Constants

View Source
const (
	Bind   = "bind"   // 绑定
	Unbind = "unbind" // 解除绑定
)

所有绑定动作类型

View Source
const (
	BindSuccess = 0  // 成功
	BindFailed  = -1 // 系统失败
)

所有账号绑定状态

View Source
const (
	Uninsured = 0 // 不保价
	Insured   = 1 // 保价
)

所有保价状态

View Source
const (
	CardTypeFront = "Front" // 正面
	CardTypeBack  = "Back"  // 背面
)

所有卡片方向

View Source
const (
	MiniprogramStateDeveloper = "developer"
	MiniprogramStateTrial     = "trial"
	MiniprogramStateFormal    = "formal"
)

developer为开发版;trial为体验版;formal为正式版;默认为正式版

View Source
const (
	UpdatableMsgParamMemberCount UpdatableMsgParamName = "member_count" // target_state = 0 时必填,文字内容模板中 member_count 的值
	UpdatableMsgParamRoomLimit                         = "room_limit"   // target_state = 0 时必填,文字内容模板中 room_limit 的值
	UpdatableMsgParamPath                              = "path"         // target_state = 1 时必填,点击「进入」启动小程序时使用的路径。 对于小游戏,没有页面的概念,可以用于传递查询字符串(query),如 "?foo=bar"
	UpdatableMsgParamVersionType                       = "version_type" // target_state = 1 时必填,点击「进入」启动小程序时使用的版本。有效参数值为:develop(开发版),trial(体验版),release(正式版)
)

动态消息状态

Variables

This section is empty.

Functions

func WithAccessTokenSetter added in v3.2.1

func WithAccessTokenSetter(getter AccessTokenGetter) func(*Client)

自定义获取access_token的方法

func WithCache

func WithCache(cc cache.Cache) func(*Client)

自定义缓存

func WithHttpClient

func WithHttpClient(hc *http.Client) func(*Client)

自定义 HTTP Client

func WithLogger added in v3.1.1

func WithLogger(logger logger.Logger) func(*Client)

自定义日志

Types

type AICropResponse

type AICropResponse struct {
	request.CommonError
	Results []struct {
		CropLeft   uint `json:"crop_left"`
		CropTop    uint `json:"crop_top"`
		CropRight  uint `json:"crop_right"`
		CropBottom uint `json:"crop_bottom"`
	} `json:"results"`
	IMGSize struct {
		Width  uint `json:"w"`
		Height uint `json:"h"`
	} `json:"img_size"`
}

AICropResponse 图片智能裁剪后的返回数据

type AbnormalConfirmer

type AbnormalConfirmer struct {
	ShopID       string `json:"shopid"`        // 商家id, 由配送公司分配的appkey
	ShopOrderID  string `json:"shop_order_id"` // 唯一标识订单的 ID,由商户生成
	ShopNo       string `json:"shop_no"`       // 商家门店编号, 在配送公司登记,如果只有一个门店,可以不填
	DeliverySign string `json:"delivery_sign"` // 用配送公司提供的appSecret加密的校验串
	WaybillID    string `json:"waybill_id"`    // 配送单id
	Remark       string `json:"remark"`        // 备注
}

AbnormalConfirmer 异常件退回商家商家确认器

type AccessTokenGetter added in v3.2.1

type AccessTokenGetter func(appid, secret string) (token string, expireIn uint)

用户自定义获取access_token的方法

type AccountList

type AccountList struct {
	request.CommonError
	Count uint `json:"count"` // 账号数量
	List  []struct {
		BizID           string     `json:"biz_id"`            // 	快递公司客户编码
		DeliveryID      string     `json:"delivery_id"`       // 	快递公司 ID
		CreateTime      uint       `json:"create_time"`       // 	账号绑定时间
		UpdateTime      uint       `json:"update_time"`       // 	账号更新时间
		StatusCode      BindStatus `json:"status_code"`       // 	绑定状态
		Alias           string     `json:"alias"`             // 	账号别名
		RemarkWrongMsg  string     `json:"remark_wrong_msg"`  // 	账号绑定失败的错误信息(EMS审核结果)
		RemarkContent   string     `json:"remark_content"`    // 	账号绑定时的备注内容(提交EMS审核需要))
		QuotaNum        uint       `json:"quota_num"`         // 	电子面单余额
		QuotaUpdateTime uint       `json:"quota_update_time"` // 	电子面单余额更新时间
	} `json:"list"` // 账号列表
}

AccountList 所有绑定的物流账号

type AddNearbyPoiResponse

type AddNearbyPoiResponse struct {
	request.CommonError
	Data struct {
		AuditID           string `json:"audit_id"`           //	审核单 ID
		PoiID             string `json:"poi_id"`             //	附近地点 ID
		RelatedCredential string `json:"related_credential"` //	经营资质证件号
	} `json:"data"`
}

AddNearbyPoiResponse response of add position.

type AddTemplateResponse

type AddTemplateResponse struct {
	request.CommonError
	Pid string `json:"priTmplId"` // 添加至帐号下的模板id,发送小程序订阅消息时所需
}

AddTemplateResponse 添加模版消息返回数据

type Attribute

type Attribute struct {
	ID    uint   `json:"id"`   // 属性值id
	Name  string `json:"name"` // 属性值名称,与id对应。如属性为 province 时,返回的属性值名称包括「广东」等。
	Value uint   `json:"value"`
	// TODO: 确认后删除该字段
	AccessSourceVisitUV uint `json:"access_source_visit_uv"` // 该场景访问uv
}

Attribute 描述内容

type BankCardResponse

type BankCardResponse struct {
	request.CommonError
	Number string `json:"number"` // 银行卡号
}

BankCardResponse 识别银行卡返回数据

type BindStatus

type BindStatus = int8

BindStatus 账号绑定状态

type BindType

type BindType = string

BindType 绑定动作类型

type BusinessLicenseResponse

type BusinessLicenseResponse struct {
	request.CommonError
	RegNum              string `json:"reg_num"`              //	注册号
	Serial              string `json:"serial"`               //	编号
	LegalRepresentative string `json:"legal_representative"` //	法定代表人姓名
	EnterpriseName      string `json:"enterprise_name"`      //	企业名称
	TypeOfOrganization  string `json:"type_of_organization"` //	组成形式
	Address             string `json:"address"`              //	经营场所/企业住所
	TypeOfEnterprise    string `json:"type_of_enterprise"`   //	公司类型
	BusinessScope       string `json:"business_scope"`       //	经营范围
	RegisteredCapital   string `json:"registered_capital"`   //	注册资本
	PaidInCapital       string `json:"paid_in_capital"`      //	实收资本
	ValidPeriod         string `json:"valid_period"`         //	营业期限
	RegisteredDate      string `json:"registered_date"`      //	注册日期/成立日期
	CertPosition        struct {
		Position LicensePosition `json:"pos"`
	} `json:"cert_position"` //	营业执照位置
	ImgSize LicensePoint `json:"img_size"` //	图片大小
}

BusinessLicenseResponse 营业执照 OCR 识别返回数据

type BusinessResultCode

type BusinessResultCode = int8

BusinessResultCode 商户审核结果状态码

const (
	ResultSuccess BusinessResultCode = 0 // 审核通过
	ResultFailed                     = 1 // 审核失败
)

所有商户审核结果状态码

type BusinessUpdater

type BusinessUpdater struct {
	ShopAppID  string             `json:"shop_app_id"`          // 商户的小程序AppID,即审核商户事件中的 ShopAppID
	BizID      string             `json:"biz_id"`               // 商户账户
	ResultCode BusinessResultCode `json:"result_code"`          // 审核结果,0 表示审核通过,其他表示审核失败
	ResultMsg  string             `json:"result_msg,omitempty"` // 审核错误原因,仅 result_code 不等于 0 时需要设置
}

BusinessUpdater 商户审核结果更新器

type CSMsgImage

type CSMsgImage struct {
	MediaID string `json:"media_id"` // 发送的图片的媒体ID,通过 新增素材接口 上传图片文件获得。
}

CSMsgImage 客服图片消息

type CSMsgLink struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	URL         string `json:"url"`
	ThumbURL    string `json:"thumb_url"`
}

CSMsgLink 图文链接消息

type CSMsgMPCard

type CSMsgMPCard struct {
	Title        string `json:"title"`          // 标题
	PagePath     string `json:"pagepath"`       // 小程序页面路径
	ThumbMediaID string `json:"thumb_media_id"` // 小程序消息卡片的封面, image 类型的 media_id,通过 新增素材接口 上传图片文件获得,建议大小为 520*416
}

CSMsgMPCard 接收的卡片消息

type CSMsgText

type CSMsgText struct {
	Content string `json:"content"`
}

CSMsgText 接收的文本消息

type CancelDeliveryOrderResponse

type CancelDeliveryOrderResponse struct {
	*request.CommonResult
	DeductFee float64 `json:"deduct_fee"` // 	预计扣除的违约金(单位:元),精确到分
	Desc      string  `json:"desc"`       //说明
}

CancelDeliveryOrderResponse 取消配送单返回数据

type CancelOrderResponse

type CancelOrderResponse struct {
	request.CommonError
	Count uint `json:"count"` //快递公司数量
	Data  []struct {
		DeliveryID   string `json:"delivery_id"`   // 快递公司 ID
		DeliveryName string `json:"delivery_name"` // 快递公司名称

	} `json:"data"` //快递公司信息列表
}

CancelOrderResponse 取消订单返回数据

type CardResponse

type CardResponse struct {
	request.CommonError
	Type      CardType `json:"type"`       // 正面或背面,Front / Back
	ValidDate string   `json:"valid_date"` // 有效期
}

CardResponse 识别卡片返回数据

type CardType

type CardType = string

CardType 卡片方向

type CargoDetail

type CargoDetail struct {
	Name  string `json:"name"`  // 商品名,不超过128字节
	Count uint   `json:"count"` // 商品数量
}

CargoDetail 包裹详情

type CheckMediaResponse

type CheckMediaResponse struct {
	request.CommonError
	TraceID string `json:"trace_id"`
}

CheckMediaResponse 异步校验图片/音频返回数据

type Client

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

func NewClient

func NewClient(appid, secret string, opts ...func(*Client)) *Client

初始化客户端并用自定义配置替换默认配置

func (*Client) AICrop

func (cli *Client) AICrop(filename string) (*AICropResponse, error)

AICrop 本接口提供基于小程序的图片智能裁剪能力。

func (*Client) AICropByURL

func (cli *Client) AICropByURL(url string) (*AICropResponse, error)

AICropByURL 本接口提供基于小程序的图片智能裁剪能力。

func (*Client) AbnormalImmediateDeliveryConfirm

func (cli *Client) AbnormalImmediateDeliveryConfirm(confirmer *AbnormalConfirmer) (*request.CommonResult, error)

Confirm 异常件退回商家商家确认收货

func (*Client) AccessToken

func (cli *Client) AccessToken() (string, error)

获取小程序全局唯一后台接口调用凭据(access_token)。 调调用绝大多数后台接口时都需使用 access_token,开发者需要进行妥善保存,注意缓存。

func (*Client) AddImmediateDeliveryOrder

func (cli *Client) AddImmediateDeliveryOrder(creator *DeliveryOrderCreator) (*CreateDeliveryOrderResponse, error)

Create 下配送单

func (*Client) AddImmediateDeliveryTip

func (cli *Client) AddImmediateDeliveryTip(adder *DeliveryTipAdder) (*request.CommonResult, error)

Add 对待接单状态的订单增加小费。需要注意:订单的小费,以最新一次加小费动作的金额为准,故下一次增加小费额必须大于上一次小费额

func (*Client) AddLogisticOrder

func (cli *Client) AddLogisticOrder(creator *ExpressOrderCreator) (*CreateExpressOrderResponse, error)

Create 生成运单 token 接口调用凭证

func (*Client) AddNearByPoi

func (cli *Client) AddNearByPoi(poi *NearbyPoi) (*AddNearbyPoiResponse, error)

Add 添加地点 token 接口调用凭证

func (*Client) AddTemplate

func (cli *Client) AddTemplate(tid, desc string, keywordIDList []int32) (*AddTemplateResponse, error)

AddTemplate 组合模板并添加至帐号下的个人模板库

token 微信 access_token tid 模板ID desc 服务场景描述,15个字以内 keywordIDList 关键词 ID 列表

func (*Client) ApplyPlugin

func (cli *Client) ApplyPlugin(appID, reason string) (*request.CommonError, error)

ApplyPlugin 向插件开发者发起使用插件的申请 accessToken 接口调用凭证 action string 是 此接口下填写 "apply" appID string 是 插件 appId reason string 否 申请使用理由

func (*Client) BankCard

func (cli *Client) BankCard(filename string, mode RecognizeMode) (*BankCardResponse, error)

BankCard 通过文件识别银行卡 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。

token 接口调用凭证 img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用传递 img_url。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)

func (*Client) BankCardByURL

func (cli *Client) BankCardByURL(cardURL string, mode RecognizeMode) (*BankCardResponse, error)

BankCardByURL 通过URL识别银行卡 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。

token 接口调用凭证 url 要检测的图片 url,传这个则不用传 img 参数。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)

func (*Client) BindLogisticsAccount

func (cli *Client) BindLogisticsAccount(ea *ExpressAccount) (*request.CommonError, error)

Bind 绑定、解绑物流账号 token 接口调用凭证

func (*Client) BusinessLicense

func (cli *Client) BusinessLicense(filename string) (*BusinessLicenseResponse, error)

BusinessLicense 通过文件进行营业执照 OCR 识别

func (*Client) BusinessLicenseByURL

func (cli *Client) BusinessLicenseByURL(cardURL string) (*BusinessLicenseResponse, error)

BusinessLicenseByURL 通过链接进行营业执照 OCR 识别

func (*Client) CancelImmediateDeliveryOrder

func (cli *Client) CancelImmediateDeliveryOrder(canceler *DeliveryOrderCanceler) (*CancelDeliveryOrderResponse, error)

Cancel 取消配送单

func (*Client) CancelLogisticsOrder

func (cli *Client) CancelLogisticsOrder(canceler *ExpressOrderCanceler) (*request.CommonError, error)

Cancel 取消运单 token 接 口调用凭证

func (*Client) CreateActivityID

func (cli *Client) CreateActivityID() (*CreateActivityIDResponse, error)

CreateActivityID 创建被分享动态消息的 activity_id。 token 接口调用凭证

func (*Client) CreateLiveRoom

func (cli *Client) CreateLiveRoom(creator *LiveRoomCreator) (*CreateLiveRoomResponse, error)

创建直播间

func (*Client) CreateQRCode

func (cli *Client) CreateQRCode(creator *QRCodeCreator) (*http.Response, *request.CommonError, error)

Create 获取小程序二维码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制 通过该接口生成的小程序码,永久有效,有数量限制

func (*Client) DecryptMobile

func (cli *Client) DecryptMobile(sessionKey, encryptedData, iv string) (*Mobile, error)

DecryptMobile 解密手机号码

sessionKey 通过 Login 向微信服务端请求得到的 session_key encryptedData 小程序通过 api 得到的加密数据(encryptedData) iv 小程序通过 api 得到的初始向量(iv)

func (*Client) DecryptRunData

func (cli *Client) DecryptRunData(sessionKey, encryptedData, iv string) (*RunData, error)

DecryptRunData 解密微信运动的加密数据

sessionKey 通过 Login 向微信服务端请求得到的 session_key encryptedData 小程序通过 api 得到的加密数据(encryptedData) iv 小程序通过 api 得到的初始向量(iv)

func (*Client) DecryptShareInfo

func (cli *Client) DecryptShareInfo(sessionKey, encryptedData, iv string) (*ShareInfo, error)

DecryptShareInfo 解密转发信息的加密数据

sessionKey 通过 Login 向微信服务端请求得到的 session_key encryptedData 小程序通过 api 得到的加密数据(encryptedData) iv 小程序通过 api 得到的初始向量(iv)

gid 小程序唯一群号

func (*Client) DecryptUserData

func (cli *Client) DecryptUserData(ssk, ciphertext, iv string) ([]byte, error)

DecryptUserData 解密用户数据

func (*Client) DecryptUserInfo

func (cli *Client) DecryptUserInfo(sessionKey, rawData, encryptedData, signature, iv string) (*UserInfo, error)

DecryptUserInfo 解密用户信息

sessionKey 微信 session_key rawData 不包括敏感信息的原始数据字符串,用于计算签名。 encryptedData 包括敏感数据在内的完整用户信息的加密数据 signature 使用 sha1( rawData + session_key ) 得到字符串,用于校验用户信息 iv 加密算法的初始向量

func (*Client) DeleteNearbyPoi

func (cli *Client) DeleteNearbyPoi(id string) (*request.CommonError, error)

DeleteNearbyPoi 删除地点 token 接口调用凭证 id 附近地点 ID

func (*Client) DeleteTemplate

func (cli *Client) DeleteTemplate(pid string) (*request.CommonError, error)

DeleteTemplate 删除帐号下的某个模板

token 微信 access_token pid 模板ID

func (*Client) DriverLicense

func (cli *Client) DriverLicense(filename string) (*DrivingLicenseResponse, error)

DriverLicense 通过文件识别行驶证 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。

token 接口调用凭证 img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用传递 img_url。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)

func (*Client) DriverLicenseByURL

func (cli *Client) DriverLicenseByURL(licenseURL string) (*DrivingLicenseResponse, error)

DriverLicenseByURL 通过URL识别行驶证 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。

token 接口调用凭证 url 要检测的图片 url,传这个则不用传 img 参数。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)

func (*Client) FaceIdentify

func (cli *Client) FaceIdentify(key string) (*FaceIdentifyResponse, error)

FaceIdentify 获取人脸识别结果

key 小程序 verify_result

func (*Client) FetchLiveRoomList

func (cli *Client) FetchLiveRoomList(start, limit int) (*FetchLiveRoomListResponse, error)

获取直播间列表及直播间信息

@start: 起始拉取房间,start = 0 表示从第 1 个房间开始拉取 @limit: 每次拉取的个数上限,不要设置过大,建议 100 以内

func (cli *Client) GenerateShortLink(link *ShortLinkRequest) (*ShortLinkResponse, error)

获取小程序 Short Link,适用于微信内拉起小程序的业务场景。目前只开放给电商类目(具体包含以下一级类目:电商平台、商家自营、跨境电商)。通过该接口,可以选择生成到期失效和永久有效的小程序短链

func (cli *Client) GenerateURLLink(link *URLLinkRequest) (*URLLinkResponse, error)

获取小程序 URL Link,适用于短信、邮件、网页、微信内等拉起小程序的业务场景。通过该接口,可以选择生成到期失效和永久有效的小程序链接,目前仅针对国内非个人主体的小程序开放

func (*Client) GenerateURLScheme

func (cli *Client) GenerateURLScheme(scheme *URLSchemeRequest) (*URLSchemeResponse, error)

获取小程序scheme码,适用于短信、邮件、外部网页等拉起小程序的业务场景。

func (*Client) GetAccessToken

func (cli *Client) GetAccessToken() (*TokenResponse, error)

func (*Client) GetAllDelivery

func (cli *Client) GetAllDelivery() (*DeliveryList, error)

GetAllDelivery 获取支持的快递公司列表 token 接口调用凭证

func (*Client) GetAllImmediateDelivery

func (cli *Client) GetAllImmediateDelivery() (*GetAllImmediateDeliveryResponse, error)

GetAllImmediateDelivery 获取已支持的配送公司列表接口

func (*Client) GetAllLogisticsAccount

func (cli *Client) GetAllLogisticsAccount() (*AccountList, error)

GetAllLogisticsAccount 获取所有绑定的物流账号 token 接口调用凭证

func (*Client) GetContact

func (cli *Client) GetContact(token, watBillID string) (*GetContactResponse, error)

GetContact 获取面单联系人信息 token, watBillID 接口调用凭证

func (*Client) GetDailyRetain

func (cli *Client) GetDailyRetain(begin, end string) (*RetainResponse, error)

GetDailyRetain 获取用户访问小程序日留存 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd

func (*Client) GetDailySummary

func (cli *Client) GetDailySummary(begin, end string) (*DailySummary, error)

GetDailySummary 获取用户访问小程序数据概况 begin 开始日期。格式为 yyyymmdd end 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd

func (*Client) GetDailyVisitTrend

func (cli *Client) GetDailyVisitTrend(begin, end string) (*VisitTrend, error)

GetDailyVisitTrend 获取用户访问小程序数据日趋势 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd

func (*Client) GetExpressQuota

func (cli *Client) GetExpressQuota(getter *QuotaGetter) (*QuotaGetResponse, error)

Get 获取电子面单余额。仅在使用加盟类快递公司时,才可以调用。

func (*Client) GetImmediateDeliveryBindAccount

func (cli *Client) GetImmediateDeliveryBindAccount() (*GetBindAccountResponse, error)

GetBindAccount 拉取已绑定账号

func (*Client) GetImmediateDeliveryOrder

func (cli *Client) GetImmediateDeliveryOrder(getter *DeliveryOrderGetter) (*GetDeliveryOrderResponse, error)

Get 下配送单

func (*Client) GetLogisticsOrder

func (cli *Client) GetLogisticsOrder(getter *ExpressOrderGetter) (*GetExpressOrderResponse, error)

Get 获取运单数据 token 接口调用凭证

func (*Client) GetLogisticsPath

func (cli *Client) GetLogisticsPath(ep *ExpressPathGetter) (*GetExpressPathResponse, error)

Get 查询运单轨迹 token 接口调用凭证

func (*Client) GetMonthlyRetain

func (cli *Client) GetMonthlyRetain(begin, end string) (*RetainResponse, error)

GetMonthlyRetain 获取用户访问小程序月留存 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,为自然月最后一天,限定查询一个月数据。格式为 yyyymmdd

func (*Client) GetMonthlyVisitTrend

func (cli *Client) GetMonthlyVisitTrend(begin, end string) (*VisitTrend, error)

GetMonthlyVisitTrend 获取用户访问小程序数据月趋势 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,为自然月最后一天,限定查询一个月数据。格式为 yyyymmdd

func (*Client) GetNearbyPoiList

func (cli *Client) GetNearbyPoiList(page, rows uint) (*PositionList, error)

GetNearbyPoiList 查看地点列表 token 接口调用凭证 page 起始页id(从1开始计数) rows 每页展示个数(最多1000个)

func (*Client) GetPaidUnionID

func (cli *Client) GetPaidUnionID(openID, transactionID string) (*GetPaidUnionIDResponse, error)

GetPaidUnionID 用户支付完成后,通过微信支付订单号(transaction_id)获取该用户的 UnionId

func (*Client) GetPaidUnionIDWithMCH

func (cli *Client) GetPaidUnionIDWithMCH(openID, outTradeNo, mchID string) (*GetPaidUnionIDResponse, error)

GetPaidUnionIDWithMCH 用户支付完成后,通过微信支付商户订单号和微信支付商户号(out_trade_no 及 mch_id)获取该用户的 UnionId

func (*Client) GetPluginDevApplyList

func (cli *Client) GetPluginDevApplyList(page, num uint) (*GetPluginDevApplyListResponse, error)

GetPluginDevApplyList 获取当前所有插件使用方 accessToken 接口调用凭证 page number 是 要拉取第几页的数据 num 是 每页的记录数

func (*Client) GetPluginList

func (cli *Client) GetPluginList() (*GetPluginListResponse, error)

GetPluginList 查询已添加的插件 accessToken 接口调用凭证

func (*Client) GetPrinter

func (cli *Client) GetPrinter(token string) (*GetPrinterResponse, error)

GetPrinter 获取打印员。若需要使用微信打单 PC 软件,才需要调用。 token 接口调用凭证

func (*Client) GetPubTemplateKeyWordsById

func (cli *Client) GetPubTemplateKeyWordsById(tid string) (*GetPubTemplateKeyWordsByIdResponse, error)

GetPubTemplateKeyWordsById 获取模板标题下的关键词列表

token 微信 access_token tid 模板ID

func (*Client) GetPubTemplateTitleList

func (cli *Client) GetPubTemplateTitleList(ids string, start, limit int) (*GetPubTemplateTitleListResponse, error)

GetPubTemplateTitleList 获取帐号所属类目下的公共模板标题

token 微信 access_token ids 类目 id,多个用逗号隔开 start 用于分页,表示从 start 开始。从 0 开始计数。 limit 用于分页,表示拉取 limit 条记录。最大为 30

func (*Client) GetQRCode

func (cli *Client) GetQRCode(code *QRCode) (*http.Response, *request.CommonError, error)

Get 获取小程序码 可接受path参数较长 生成个数受限 永久有效 适用于需要的码数量较少的业务场景

func (*Client) GetTempMedia

func (cli *Client) GetTempMedia(mediaID string) (*http.Response, *request.CommonError, error)

GetTempMedia 获取客服消息内的临时素材。即下载临时的多媒体文件。目前小程序仅支持下载图片文件。

token 接口调用凭证 mediaID 媒体文件 ID

func (*Client) GetTemplateCategory

func (cli *Client) GetTemplateCategory() (*GetTemplateCategoryResponse, error)

GetTemplateCategory 删除帐号下的某个模板

token 微信 access_token

func (*Client) GetTemplateList

func (cli *Client) GetTemplateList() (*GetTemplateListResponse, error)

GetTemplateList 获取帐号下已存在的模板列表

token 微信 access_token

func (*Client) GetUnlimitedQRCode

func (cli *Client) GetUnlimitedQRCode(code *UnlimitedQRCode) (*http.Response, *request.CommonError, error)

Get 获取小程序码 可接受页面参数较短 生成个数不受限 适用于需要的码数量极多的业务场景 根路径前不要填加'/' 不能携带参数(参数请放在scene字段里)

func (*Client) GetUserPortrait

func (cli *Client) GetUserPortrait(begin, end string) (*UserPortrait, error)

GetUserPortrait 获取小程序新增或活跃用户的画像分布数据。 时间范围支持昨天、最近7天、最近30天。 其中,新增用户数为时间范围内首次访问小程序的去重用户数,活跃用户数为时间范围内访问过小程序的去重用户数。 begin 开始日期。格式为 yyyymmdd end 结束日期,开始日期与结束日期相差的天数限定为0/6/29,分别表示查询最近1/7/30天数据,允许设置的最大值为昨日。格式为 yyyymmdd

func (*Client) GetVisitDistribution

func (cli *Client) GetVisitDistribution(begin, end string) (*VisitDistribution, error)

GetVisitDistribution 获取用户小程序访问分布数据 begin 开始日期。格式为 yyyymmdd end 结束日期,限定查询 1 天数据,允许设置的最大值为昨日。格式为 yyyymmdd

func (*Client) GetVisitPage

func (cli *Client) GetVisitPage(begin, end string) (*VisitPage, error)

GetVisitPage 访问页面。 目前只提供按 page_visit_pv 排序的 top200。 begin 开始日期。格式为 yyyymmdd end 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd

func (*Client) GetWeeklyRetain

func (cli *Client) GetWeeklyRetain(begin, end string) (*RetainResponse, error)

GetWeeklyRetain 获取用户访问小程序周留存 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,为周日日期,限定查询一周数据。格式为 yyyymmdd

func (*Client) GetWeeklyVisitTrend

func (cli *Client) GetWeeklyVisitTrend(begin, end string) (*VisitTrend, error)

GetWeeklyVisitTrend 获取用户访问小程序数据周趋势 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,为周日日期,限定查询一周数据。格式为 yyyymmdd

func (*Client) IDCard

func (cli *Client) IDCard(filename string, mode RecognizeMode) (*IDCardResponse, error)

IDCard 通过文件识别身份证 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。

token 接口调用凭证 img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用传递 img_url。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)

func (*Client) IDCardByURL

func (cli *Client) IDCardByURL(cardURL string, mode RecognizeMode) (*IDCardResponse, error)

IDCardByURL 通过URL识别身份证 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。

token 接口调用凭证 url 要检测的图片 url,传这个则不用传 img 参数。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)

func (*Client) IMGSecCheck

func (cli *Client) IMGSecCheck(filename string) (*request.CommonError, error)

IMGSecCheck 本地图片检测 官方文档: https://developers.weixin.qq.com/miniprogram/dev/api/imgSecCheck.html

filename 要检测的图片本地路径 token 接口调用凭证(access_token)

func (*Client) Logger added in v3.1.1

func (cli *Client) Logger() logger.Logger

获取日志记录器

func (*Client) Login

func (cli *Client) Login(code string) (*LoginResponse, error)

Login 登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。

appID 小程序 appID secret 小程序的 app secret code 小程序登录时获取的 code

func (*Client) MSGSecCheck

func (cli *Client) MSGSecCheck(content string) (*request.CommonError, error)

MSGSecCheck 文本检测 官方文档: https://developers.weixin.qq.com/miniprogram/dev/api/msgSecCheck.html

content 要检测的文本内容,长度不超过 500KB,编码格式为utf-8 token 接口调用凭证(access_token)

func (*Client) MediaCheckAsync

func (cli *Client) MediaCheckAsync(mediaURL string, mediaType MediaType) (*CheckMediaResponse, error)

MediaCheckAsync 异步校验图片/音频是否含有违法违规内容。

mediaURL 要检测的多媒体url mediaType 接口调用凭证(access_token)

func (*Client) MockUpdateImmediateDeliveryOrder

func (cli *Client) MockUpdateImmediateDeliveryOrder(mocker *UpdateDeliveryOrderMocker) (*request.CommonResult, error)

Mock 模拟配送公司更新配送单状态

func (*Client) NewAuth added in v3.4.0

func (cli *Client) NewAuth() *auth.Auth

用户信息

func (*Client) NewLiveBroadcast added in v3.1.1

func (cli *Client) NewLiveBroadcast() *livebroadcast.LiveBroadcast

直播

func (*Client) NewOCR added in v3.1.1

func (cli *Client) NewOCR() *ocr.OCR

OCR

func (*Client) NewOperation added in v3.1.1

func (cli *Client) NewOperation() *operation.Operation

运维中心

func (*Client) NewPhonenumber added in v3.6.3

func (cli *Client) NewPhonenumber() *phonenumber.Phonenumber

手机号

func (*Client) NewSearch added in v3.1.1

func (cli *Client) NewSearch() *search.Search

小程序搜索

func (*Client) NewSecurity added in v3.5.0

func (cli *Client) NewSecurity() *security.Security

内容安全

func (*Client) NewServer added in v3.1.1

func (cli *Client) NewServer(token, aesKey, mchID, apiKey string, validate bool, handler func(map[string]interface{}) map[string]interface{}) (*server.Server, error)

微信通知监听服务

func (*Client) NewSubscribeMessage added in v3.1.1

func (cli *Client) NewSubscribeMessage() *subscribemessage.SubscribeMessage

订阅消息

func (*Client) NewUpdatableMessage added in v3.1.1

func (cli *Client) NewUpdatableMessage() *updatablemessage.UpdatableMessage

动态消息

func (*Client) NewWXACode added in v3.1.1

func (cli *Client) NewWXACode() *wxacode.WXACode

小程序码

func (*Client) PreAddImmediateDeliveryOrder

func (cli *Client) PreAddImmediateDeliveryOrder(creator *DeliveryOrderCreator) (*PreDeliveryOrderResponse, error)

Prepare 预下配送单接口

func (*Client) PreCancelImmediateDeliveryOrder

func (cli *Client) PreCancelImmediateDeliveryOrder(canceler *DeliveryOrderCanceler) (*CancelDeliveryOrderResponse, error)

Prepare 预取消配送单

func (*Client) PreviewLogisticsTemplate

func (cli *Client) PreviewLogisticsTemplate(previewer *ExpressTemplatePreviewer) (*PreviewTemplateResponse, error)

Preview 预览面单模板。用于调试面单模板使用。 token 接口调用凭证

func (*Client) PrintedText

func (cli *Client) PrintedText(filename string) (*PrintedTextResponse, error)

PrintedText 通过文件进行通用印刷体 OCR 识别

func (*Client) PrintedTextByURL

func (cli *Client) PrintedTextByURL(cardURL string) (*PrintedTextResponse, error)

PrintedTextByURL 通过链接进行通用印刷体 OCR 识别

func (*Client) ReImmediateDeliveryOrder

func (cli *Client) ReImmediateDeliveryOrder(creator *DeliveryOrderCreator) (*CreateDeliveryOrderResponse, error)

Recreate 重新下单

func (*Client) ScanQRCode

func (cli *Client) ScanQRCode(filename string) (*ScanQRCodeResponse, error)

ScanQRCode 本接口提供基于小程序的条码/二维码识别的API。

func (*Client) ScanQRCodeByURL

func (cli *Client) ScanQRCodeByURL(imgURL string) (*ScanQRCodeResponse, error)

ScanQRCodeByURL 把网络文件上传到微信服务器。目前仅支持图片。用于发送客服消息或被动回复用户消息。

func (*Client) SearchImage

func (cli *Client) SearchImage(filename string) (*SearchImageResponse, error)

本接口提供基于小程序的站内搜商品图片搜索能力

func (*Client) SearchSite

func (cli *Client) SearchSite(req *SearchSiteRequest) (*SearchSiteResponse, error)

小程序内部搜索API提供针对页面的查询能力,小程序开发者输入搜索词后,将返回自身小程序和搜索词相关的页面。因此,利用该接口,开发者可以查看指定内容的页面被微信平台的收录情况;同时,该接口也可供开发者在小程序内应用,给小程序用户提供搜索能力。

func (*Client) SendCardMsg

func (cli *Client) SendCardMsg(openID string, msg *CSMsgMPCard) (*request.CommonError, error)

SendTo 发送卡片消息

openID 用户openID

func (*Client) SendImageMsg

func (cli *Client) SendImageMsg(openID string, msg *CSMsgImage) (*request.CommonError, error)

SendTo 发送图片消息

openID 用户openID

func (*Client) SendLinkMsg

func (cli *Client) SendLinkMsg(openID string, msg *CSMsgLink) (*request.CommonError, error)

SendTo 发送图文链接消息

openID 用户openID

func (*Client) SendSearchSubmitPages

func (cli *Client) SendSearchSubmitPages(smp *SearchSubmitPagesRequest) (*request.CommonError, error)

Send 提交收录请求

func (*Client) SendSubscribeMsg

func (cli *Client) SendSubscribeMsg(msg *SubscribeMessage) (*request.CommonError, error)

Send 发送订阅消息

token access_token

func (*Client) SendTextMsg

func (cli *Client) SendTextMsg(openID string, msg *CSMsgText) (*request.CommonError, error)

SendTo 发送文本消息

openID 用户openID

func (*Client) SendUniformMsg

func (cli *Client) SendUniformMsg(msg *UniformMsgSender) (*request.CommonError, error)

Send 统一服务消息

func (*Client) SetDevPluginApplyStatus

func (cli *Client) SetDevPluginApplyStatus(appID, reason string, action DevAction) (*request.CommonError, error)

SetDevPluginApplyStatus 修改插件使用申请的状态 accessToken 接口调用凭证 appID 使用者的 appid。同意申请时填写。 reason 拒绝理由。拒绝申请时填写。 action 修改操作

func (*Client) SetLogLevel added in v3.2.2

func (cli *Client) SetLogLevel(lv logger.Level)

设置日志等级

func (*Client) SetNearbyPoiShowStatus

func (cli *Client) SetNearbyPoiShowStatus(poiID string, status NearbyPoiShowStatus) (*request.CommonError, error)

SetNearbyPoiShowStatus 展示/取消展示附近小程序 token 接口调用凭证 poiID 附近地点 ID status 是否展示

func (*Client) SetTyping

func (cli *Client) SetTyping(openID string, cmd SetTypingCommand) (*request.CommonError, error)

SetTyping 下发客服当前输入状态给用户。

token 接口调用凭证 openID 用户的 OpenID cmd 命令

func (*Client) SetUpdatableMsg

func (cli *Client) SetUpdatableMsg(msg *UpdatableMsg) (*request.CommonError, error)

修改被分享的动态消息。 accessToken 接口调用凭证

func (*Client) SuperResolution

func (cli *Client) SuperResolution(filename string) (*SuperResolutionResponse, error)

SuperResolution 本接口提供基于小程序的图片高清化能力。

func (*Client) SuperResolutionByURL

func (cli *Client) SuperResolutionByURL(imgURL string) (*SuperResolutionResponse, error)

SuperResolutionByURL 把网络文件上传到微信服务器。目前仅支持图片。用于发送客服消息或被动回复用户消息。

func (*Client) TestUpdateExpressOrder

func (cli *Client) TestUpdateExpressOrder(tester *UpdateExpressOrderTester) (*request.CommonError, error)

Test 模拟快递公司更新订单状态, 该接口只能用户测试

func (*Client) UnbindPlugin

func (cli *Client) UnbindPlugin(appID string) (*request.CommonError, error)

UnbindPlugin 查询已添加的插件 accessToken 接口调用凭证 appID 插件 appId

func (*Client) UpdateExpressOrder

func (cli *Client) UpdateExpressOrder(updater *PrinterUpdater) (*request.CommonError, error)

Update 更新打印员。若需要使用微信打单 PC 软件,才需要调用。

func (*Client) UpdateImmediateDeliveryOrder

func (cli *Client) UpdateImmediateDeliveryOrder(updater *DeliveryOrderUpdater) (*request.CommonResult, error)

Update 模拟配送公司更新配送单状态

func (*Client) UpdateLogisticsBusiness

func (cli *Client) UpdateLogisticsBusiness(updater *BusinessUpdater) (*request.CommonError, error)

Update 更新商户审核结果 token 接口调用凭证

func (*Client) UpdateLogisticsPath

func (cli *Client) UpdateLogisticsPath(updater *ExpressPathUpdater) (*request.CommonError, error)

Update 更新运单轨迹 token 接口调用凭证

func (*Client) UploadTempMedia

func (cli *Client) UploadTempMedia(mediaType TempMediaType, medianame string) (*UploadTempMediaResponse, error)

UploadTempMedia 把媒体文件上传到微信服务器。目前仅支持图片。用于发送客服消息或被动回复用户消息。

token 接口调用凭证 mediaType 文件类型 medianame 媒体文件名

func (*Client) VehicleLicense

func (cli *Client) VehicleLicense(filename string, mode RecognizeMode) (*VehicleLicenseResponse, error)

VehicleLicense 通过文件识别行驶证

func (*Client) VehicleLicenseByURL

func (cli *Client) VehicleLicenseByURL(cardURL string, mode RecognizeMode) (*VehicleLicenseResponse, error)

VehicleLicenseByURL 行驶证 OCR 识别

func (*Client) VerifySignature

func (cli *Client) VerifySignature(openID, data, signature string) (*VerifySignatureResponse, error)

VerifySignature 生物认证秘钥签名验证 accessToken 接口调用凭证 openID 用户 openid data 通过 wx.startSoterAuthentication 成功回调获得的 resultJSON 字段 signature 通过 wx.startSoterAuthentication 成功回调获得的 resultJSONSignature 字段

type Color

type Color struct {
	R string `json:"r"`
	G string `json:"g"`
	B string `json:"b"`
}

Color QRCode color

type ContactUser

type ContactUser struct {
	Address string `json:"address"` //地址,已经将省市区信息合并
	Name    string `json:"name"`    //用户姓名
	Tel     string `json:"tel"`     //座机号码
	Mobile  string `json:"mobile"`  //手机号码
}

ContactUser 联系人

type CreateActivityIDResponse

type CreateActivityIDResponse struct {
	request.CommonError
	ActivityID     string `json:"activity_id"`     //	动态消息的 ID
	ExpirationTime uint   `json:"expiration_time"` //	activity_id 的过期时间戳。默认24小时后过期。
}

CreateActivityIDResponse 动态消息

type CreateDeliveryOrderResponse

type CreateDeliveryOrderResponse struct {
	*request.CommonResult
	Fee              uint    `json:"fee"`               //实际运费(单位:元),运费减去优惠券费用
	Deliverfee       uint    `json:"deliverfee"`        //运费(单位:元)
	Couponfee        uint    `json:"couponfee"`         //优惠券费用(单位:元)
	Tips             uint    `json:"tips"`              //小费(单位:元)
	Insurancefee     uint    `json:"insurancefee"`      //保价费(单位:元)
	Distance         float64 `json:"distance"`          //	配送距离(单位:米)
	WaybillID        string  `json:"waybill_id"`        //配送单号
	OrderStatus      int     `json:"order_status"`      //配送状态
	FinishCode       uint    `json:"finish_code"`       //	收货码
	PickupCode       uint    `json:"pickup_code"`       //取货码
	DispatchDuration uint    `json:"dispatch_duration"` //	预计骑手接单时间,单位秒,比如5分钟,就填300, 无法预计填0
}

CreateDeliveryOrderResponse 返回数据

type CreateExpressOrderResponse

type CreateExpressOrderResponse struct {
	request.CommonError
	OrderID     string `json:"order_id"`   //	订单ID,下单成功时返回
	WaybillID   string `json:"waybill_id"` //	运单ID,下单成功时返回
	WaybillData []struct {
		Key   string `json:"key"`   // 运单信息 key
		Value string `json:"value"` // 运单信息 value
	} `json:"waybill_data"` //	运单信息,下单成功时返回
	DeliveryResultcode int    `json:"delivery_resultcode"` //	快递侧错误码,下单失败时返回
	DeliveryResultmsg  string `json:"delivery_resultmsg"`  //	快递侧错误信息,下单失败时返回
}

CreateExpressOrderResponse 创建订单返回数据

type CreateLiveRoomResponse

type CreateLiveRoomResponse struct {
	request.CommonError
	RoomID string `json:"roomId"` //房间ID
	// 当主播微信号没有在 “小程序直播“ 小程序实名认证 返回该字段
	QRCodeURL string `json:"qrcode_url"`
}

type DailySummary

type DailySummary struct {
	request.CommonError
	List []Summary `json:"list"`
}

DailySummary 用户访问小程序数据概况

type DeliveryAgent

type DeliveryAgent struct {
	Name      string `json:"name"`                         // 骑手姓名
	Phone     string `json:"phone"`                        // 骑手电话
	Encrypted uint8  `json:"is_phone_encrypted,omitempty"` // 电话是否加密
}

DeliveryAgent 骑手信息

type DeliveryCargo

type DeliveryCargo struct {
	GoodsValue        float64             `json:"goods_value"`         // 货物价格,单位为元,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-5000]
	GoodsHeight       float64             `json:"goods_height"`        // 货物高度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-45]
	GoodsLength       float64             `json:"goods_length"`        // 货物长度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-65]
	GoodsWidth        float64             `json:"goods_width"`         // 货物宽度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-50]
	GoodsWeight       float64             `json:"goods_weight"`        // 货物重量,单位为kg,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-50]
	GoodsDetail       DeliveryGoodsDetail `json:"goods_detail"`        // 货物详情,最长不超过10240个字符
	GoodsPickupInfo   string              `json:"goods_pickup_info"`   // 货物取货信息,用于骑手到店取货,最长不超过100个字符
	GoodsDeliveryInfo string              `json:"goods_delivery_info"` // 货物交付信息,最长不超过100个字符
	CargoFirstClass   string              `json:"cargo_first_class"`   // 品类一级类目
	CargoSecondClass  string              `json:"cargo_second_class"`  // 品类二级类目
}

DeliveryCargo 货物信息

type DeliveryGoods

type DeliveryGoods struct {
	Count uint    `json:"good_count"` // 货物数量
	Name  string  `json:"good_name"`  // 货品名称
	Price float32 `json:"good_price"` // 货品单价,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数)
	Unit  string  `json:"good_unit"`  // 货品单位,最长不超过20个字符
}

DeliveryGoods 货物

type DeliveryGoodsDetail

type DeliveryGoodsDetail struct {
	Goods []DeliveryGoods `json:"goods"` // 货物交付信息,最长不超过100个字符
}

DeliveryGoodsDetail 货物详情

type DeliveryList

type DeliveryList struct {
	request.CommonError
	Count uint `json:"count"` // 快递公司数量
	Data  []struct {
		ID   string `json:"delivery_id"`   // 快递公司 ID
		Name string `json:"delivery_name"` // 快递公司名称
	} `json:"data"` // 快递公司信息列表
}

DeliveryList 支持的快递公司列表

type DeliveryOrderCanceler

type DeliveryOrderCanceler struct {
	ShopID       string `json:"shopid"`           // 商家id, 由配送公司分配的appkey
	ShopOrderID  string `json:"shop_order_id"`    // 唯一标识订单的 ID,由商户生成
	ShopNo       string `json:"shop_no"`          // 商家门店编号, 在配送公司登记,如果只有一个门店,可以不填
	DeliverySign string `json:"delivery_sign"`    // 用配送公司提供的appSecret加密的校验串
	DeliveryID   string `json:"delivery_id"`      // 快递公司ID
	WaybillID    string `json:"waybill_id"`       // 配送单id
	ReasonID     uint8  `json:"cancel_reason_id"` // 取消原因Id
	Reason       string `json:"cancel_reason"`    // 取消原因
}

DeliveryOrderCanceler 取消配送单参数

type DeliveryOrderCreator

type DeliveryOrderCreator struct {
	DeliveryToken string            `json:"delivery_token,omitempty"` // 预下单接口返回的参数,配送公司可保证在一段时间内运费不变
	ShopID        string            `json:"shopid"`                   // 商家id, 由配送公司分配的appkey
	ShopOrderID   string            `json:"shop_order_id"`            // 唯一标识订单的 ID,由商户生成
	ShopNo        string            `json:"shop_no"`                  // 商家门店编号, 在配送公司登记,如果只有一个门店,可以不填
	DeliverySign  string            `json:"delivery_sign"`            // 用配送公司提供的appSecret加密的校验串
	DeliveryID    string            `json:"delivery_id"`              // 配送公司ID
	OpenID        string            `json:"openid"`                   // 下单用户的openid
	Sender        DeliveryUser      `json:"sender"`                   // 发件人信息,闪送、顺丰同城急送必须填写,美团配送、达达,若传了shop_no的值可不填该字段
	Receiver      DeliveryUser      `json:"receiver"`                 // 收件人信息
	Cargo         DeliveryCargo     `json:"cargo"`                    // 货物信息
	OrderInfo     DeliveryOrderInfo `json:"order_info"`               // 订单信息
	Shop          DeliveryShop      `json:"shop"`                     // 商品信息,会展示到物流通知消息中
	SubBizID      string            `json:"sub_biz_id"`               // 子商户id,区分小程序内部多个子商户
}

DeliveryOrderCreator 下配送单参数

type DeliveryOrderGetter

type DeliveryOrderGetter struct {
	ShopID       string `json:"shopid"`        // 商家id, 由配送公司分配的appkey
	ShopOrderID  string `json:"shop_order_id"` // 唯一标识订单的 ID,由商户生成
	ShopNo       string `json:"shop_no"`       // 商家门店编号, 在配送公司登记,如果只有一个门店,可以不填
	DeliverySign string `json:"delivery_sign"` // 用配送公司提供的appSecret加密的校验串说明
}

DeliveryOrderGetter 请求参数

type DeliveryOrderInfo

type DeliveryOrderInfo struct {
	DeliveryServiceCode  string  `json:"delivery_service_code"`  // 配送服务代码 不同配送公司自定义,微信侧不理解
	OrderType            uint8   `json:"order_type"`             // 订单类型, 0: 即时单 1 预约单,如预约单,需要设置expected_delivery_time或expected_finish_time或expected_pick_time
	ExpectedDeliveryTime uint    `json:"expected_delivery_time"` // 期望派单时间(顺丰同城急送、达达、支持),unix-timestamp
	ExpectedFinishTime   uint    `json:"expected_finish_time"`   // 期望送达时间(顺丰同城急送、美团配送支持),unix-timestamp
	ExpectedPickTime     uint    `json:"expected_pick_time"`     // 期望取件时间(闪送支持),unix-timestamp
	PoiSeq               string  `json:"poi_seq"`                // 门店订单流水号,建议提供,方便骑手门店取货,最长不超过32个字符
	Note                 string  `json:"note"`                   // 备注,最长不超过200个字符
	OrderTime            uint    `json:"order_time"`             // 用户下单付款时间
	IsInsured            uint8   `json:"is_insured"`             // 是否保价,0,非保价,1.保价
	DeclaredValue        float64 `json:"declared_value"`         // 保价金额,单位为元,精确到分
	Tips                 float64 `json:"tips"`                   // 小费,单位为元, 下单一般不加小费
	IsDirectDelivery     uint    `json:"is_direct_delivery"`     // 是否选择直拿直送(0:不需要;1:需要。选择直拿直送后,同一时间骑手只能配送此订单至完成,配送费用也相应高一些,闪送必须选1,达达可选0或1,其余配送公司不支持直拿直送)
	CashOnDelivery       uint    `json:"cash_on_delivery"`       // 骑手应付金额,单位为元,精确到分
	CashOnPickup         uint    `json:"cash_on_pickup"`         // 骑手应收金额,单位为元,精确到分
	RiderPickMethod      uint8   `json:"rider_pick_method"`      // 物流流向,1:从门店取件送至用户;2:从用户取件送至门店
	IsFinishCodeNeeded   uint8   `json:"is_finish_code_needed"`  // 收货码(0:不需要;1:需要。收货码的作用是:骑手必须输入收货码才能完成订单妥投)
	IsPickupCodeNeeded   uint8   `json:"is_pickup_code_needed"`  // 取货码(0:不需要;1:需要。取货码的作用是:骑手必须输入取货码才能从商家取货)
}

DeliveryOrderInfo 订单信息

type DeliveryOrderUpdater

type DeliveryOrderUpdater struct {
	WXToken              string        `json:"wx_token"`                         // 下单事件中推送的wx_token字段
	ShopID               string        `json:"shopid"`                           // 商家id, 由配送公司分配,可以是dev_id或者appkey
	ShopOrderID          string        `json:"shop_order_id"`                    // 唯一标识订单的 ID,由商户生成
	ShopNo               string        `json:"shop_no,omitempty"`                // 商家门店编号, 在配送公司侧登记
	WaybillID            string        `json:"waybill_id"`                       // 配送单id
	ActionTime           uint          `json:"action_time"`                      // 状态变更时间点,Unix秒级时间戳
	OrderStatus          int           `json:"order_status"`                     // 订单状态,枚举值,下附枚举值列表及说明
	ActionMsg            string        `json:"action_msg,omitempty"`             // 附加信息
	WxaPath              string        `json:"wxa_path"`                         // 配送公司小程序跳转路径,用于用户收到消息会间接跳转到这个页面
	Agent                DeliveryAgent `json:"agent,omitempty"`                  // 骑手信息, 骑手接单时需返回
	ExpectedDeliveryTime uint          `json:"expected_delivery_time,omitempty"` // 预计送达时间戳, 骑手接单时需返回
}

DeliveryOrderUpdater 请求参数

type DeliveryShop

type DeliveryShop struct {
	WxaPath    string `json:"wxa_path"`    // 商家小程序的路径,建议为订单页面
	ImgURL     string `json:"img_url"`     // 商品缩略图 url
	GoodsName  string `json:"goods_name"`  // 商品名称
	GoodsCount uint   `json:"goods_count"` // 商品数量
}

DeliveryShop 商品信息,会展示到物流通知消息中

type DeliveryTipAdder

type DeliveryTipAdder struct {
	ShopID       string  `json:"shopid"`        // 商家id, 由配送公司分配的appkey
	ShopOrderID  string  `json:"shop_order_id"` // 唯一标识订单的 ID,由商户生成
	ShopNo       string  `json:"shop_no"`       // 商家门店编号, 在配送公司登记,如果只有一个门店,可以不填
	DeliverySign string  `json:"delivery_sign"` // 用配送公司提供的appSecret加密的校验串
	WaybillID    string  `json:"waybill_id"`    // 配送单id
	OpenID       string  `json:"openid"`        // 下单用户的openid
	Tips         float64 `json:"tips"`          // 小费金额(单位:元) 各家配送公司最大值不同
	Remark       string  `json:"Remark"`        // 备注
}

DeliveryTipAdder 增加小费参数

type DeliveryUser

type DeliveryUser struct {
	Name           string  `json:"name"`            // 姓名,最长不超过256个字符
	City           string  `json:"city"`            // 城市名称,如广州市
	Address        string  `json:"address"`         // 地址(街道、小区、大厦等,用于定位)
	AddressDetail  string  `json:"address_detail"`  // 地址详情(楼号、单元号、层号)
	Phone          string  `json:"phone"`           // 电话/手机号,最长不超过64个字符
	Lng            float64 `json:"lng"`             // 经度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,确到小数点后6位
	Lat            float64 `json:"lat"`             // 纬度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,精确到小数点后6位)
	CoordinateType uint8   `json:"coordinate_type"` // 坐标类型,0:火星坐标(高德,腾讯地图均采用火星坐标) 1:百度坐标
}

DeliveryUser 发件人信息,闪送、顺丰同城急送必须填写,美团配送、达达,若传了shop_no的值可不填该字段

type DevAction

type DevAction string

DevAction 修改操作

const (
	DevAgree  DevAction = "dev_agree"  // 同意申请
	DevRefuse DevAction = "dev_refuse" // 拒绝申请
	DevDelete DevAction = "dev_refuse" // 删除已拒绝的申请者
)

所有修改操作

type Distribution

type Distribution struct {
	// 分布类型
	// 	index 的合法值
	// access_source_session_cnt	访问来源分布
	// access_staytime_info	访问时长分布
	// access_depth_info	访问深度的分布
	Index    string             `json:"index"`
	ItemList []DistributionItem `json:"item_list"` // 分布数据列表
}

Distribution 分布数据

type DistributionItem

type DistributionItem struct {
	Key   uint `json:"key"`   // 场景 id,定义在各个 index 下不同,具体参见下方表格
	Value uint `json:"value"` // 该场景 id 访问 pv
	// TODO: 确认后删除该字段
	AccessSourceVisitUV uint `json:"access_source_visit_uv"` // 该场景 id 访问 uv
}

DistributionItem 分布数据项

type DrivingLicenseResponse

type DrivingLicenseResponse struct {
	request.CommonError
	IDNum        string `json:"id_num"`        // 证号
	Name         string `json:"name"`          // 姓名
	Nationality  string `json:"nationality"`   // 国家
	Sex          string `json:"sex"`           // 性别
	Address      string `json:"address"`       // 地址
	BirthDate    string `json:"birth_date"`    // 出生日期
	IssueDate    string `json:"issue_date"`    // 初次领证日期
	CarClass     string `json:"car_class"`     // 准驾车型
	ValidFrom    string `json:"valid_from"`    // 有效期限起始日
	ValidTo      string `json:"valid_to"`      // 有效期限终止日
	OfficialSeal string `json:"official_seal"` // 印章文构
}

DrivingLicenseResponse 识别行驶证返回数据

type ExpreseeUserInfo

type ExpreseeUserInfo struct {
	Name     string `json:"name"`                // 收件人/发件人姓名,不超过64字节
	Tel      string `json:"tel,omitempty"`       // 收件人/发件人座机号码,若不填写则必须填写 mobile,不超过32字节
	Mobile   string `json:"mobile,omitempty"`    // 收件人/发件人手机号码,若不填写则必须填写 tel,不超过32字节
	Company  string `json:"company,omitempty"`   // 收件人/发件人公司名称,不超过64字节
	PostCode string `json:"post_code,omitempty"` // 收件人/发件人邮编,不超过10字节
	Country  string `json:"country,omitempty"`   // 收件人/发件人国家,不超过64字节
	Province string `json:"province"`            // 收件人/发件人省份,比如:"广东省",不超过64字节
	City     string `json:"city"`                // 收件人/发件人市/地区,比如:"广州市",不超过64字节
	Area     string `json:"area"`                // 收件人/发件人区/县,比如:"海珠区",不超过64字节
	Address  string `json:"address"`             // 收件人/发件人详细地址,比如:"XX路XX号XX大厦XX",不超过512字节
}

ExpreseeUserInfo 收件人/发件人信息

type ExpressAccount

type ExpressAccount struct {
	Type          BindType `json:"type"`           // bind表示绑定,unbind表示解除绑定
	BizID         string   `json:"biz_id"`         // 快递公司客户编码
	DeliveryID    string   `json:"delivery_id"`    // 快递公司 ID
	Password      string   `json:"password"`       // 快递公司客户密码
	RemarkContent string   `json:"remark_content"` // 备注内容(提交EMS审核需要)
}

ExpressAccount 物流账号

type ExpressCargo

type ExpressCargo struct {
	Count      uint          `json:"count"`       // 包裹数量
	Weight     float64       `json:"weight"`      // 包裹总重量,单位是千克(kg)
	SpaceX     float64       `json:"space_x"`     // 包裹长度,单位厘米(cm)
	SpaceY     float64       `json:"space_y"`     // 包裹宽度,单位厘米(cm)
	SpaceZ     float64       `json:"space_z"`     // 包裹高度,单位厘米(cm)
	DetailList []CargoDetail `json:"detail_list"` // 包裹中商品详情列表
}

ExpressCargo 包裹信息

type ExpressInsure

type ExpressInsure struct {
	Used  InsureStatus `json:"use_insured"`   // 是否保价,0 表示不保价,1 表示保价
	Value uint         `json:"insured_value"` // 保价金额,单位是分,比如: 10000 表示 100 元
}

ExpressInsure 订单保价

type ExpressOrder

type ExpressOrder struct {
	OrderID      string           `json:"order_id"`                // 订单ID,须保证全局唯一,不超过512字节
	OpenID       string           `json:"openid,omitempty"`        //	用户openid,当add_source=2时无需填写(不发送物流服务通知)
	DeliveryID   string           `json:"delivery_id"`             // 快递公司ID,参见getAllDelivery
	BizID        string           `json:"biz_id"`                  // 快递客户编码或者现付编码
	CustomRemark string           `json:"custom_remark,omitempty"` //	快递备注信息,比如"易碎物品",不超过1024字节
	Sender       ExpreseeUserInfo `json:"sender"`                  // 发件人信息
	Receiver     ExpreseeUserInfo `json:"receiver"`                // 收件人信息
	Cargo        ExpressCargo     `json:"cargo"`                   // 包裹信息,将传递给快递公司
	Shop         ExpressShop      `json:"shop,omitempty"`          //	商家信息,会展示到物流服务通知中,当add_source=2时无需填写(不发送物流服务通知)
	Insured      ExpressInsure    `json:"insured"`                 // 保价信息
	Service      ExpressService   `json:"service"`                 // 服务类型
}

ExpressOrder 物流订单

type ExpressOrderCanceler

type ExpressOrderCanceler ExpressOrderGetter

ExpressOrderCanceler 订单取消器

type ExpressOrderCreator

type ExpressOrderCreator struct {
	ExpressOrder
	AddSource  ExpressOrderSource `json:"add_source"`            // 订单来源,0为小程序订单,2为App或H5订单,填2则不发送物流服务通知
	WXAppID    string             `json:"wx_appid,omitempty"`    // App或H5的appid,add_source=2时必填,需和开通了物流助手的小程序绑定同一open帐号
	ExpectTime uint               `json:"expect_time,omitempty"` //	顺丰必须填写此字段。预期的上门揽件时间,0表示已事先约定取件时间;否则请传预期揽件时间戳,需大于当前时间,收件员会在预期时间附近上门。例如expect_time为“1557989929”,表示希望收件员将在2019年05月16日14:58:49-15:58:49内上门取货。
	TagID      uint               `json:"tagid,omitempty"`       //订单标签id,用于平台型小程序区分平台上的入驻方,tagid须与入驻方账号一一对应,非平台型小程序无需填写该字段
}

ExpressOrderCreator 订单创建器

type ExpressOrderGetter

type ExpressOrderGetter struct {
	OrderID    string `json:"order_id"`         // 订单 ID,需保证全局唯一
	OpenID     string `json:"openid,omitempty"` // 用户openid,当add_source=2时无需填写(不发送物流服务通知)
	DeliveryID string `json:"delivery_id"`      // 快递公司ID,参见getAllDelivery
	WaybillID  string `json:"waybill_id"`       // 运单ID
}

ExpressOrderGetter 订单获取器

type ExpressOrderSource

type ExpressOrderSource = uint8

ExpressOrderSource 订单来源

const (
	FromWeapp   ExpressOrderSource = 0 // 小程序订单
	FromAppOrH5                    = 2 // APP或H5订单
)

所有订单来源

type ExpressPathGetter

type ExpressPathGetter ExpressOrderGetter

ExpressPathGetter 查询运单轨迹所需参数

type ExpressPathNode

type ExpressPathNode struct {
	ActionTime uint   `json:"action_time"` // 轨迹节点 Unix 时间戳
	ActionType uint   `json:"action_type"` // 轨迹节点类型
	ActionMsg  string `json:"action_msg"`  // 轨迹节点详情
}

ExpressPathNode 运单轨迹节点

type ExpressPathUpdater

type ExpressPathUpdater struct {
	Token      string `json:"token"`       // 商户侧下单事件中推送的 Token 字段
	WaybillID  string `json:"waybill_id"`  // 运单 ID
	ActionTime uint   `json:"action_time"` // 轨迹变化 Unix 时间戳
	ActionType uint   `json:"action_type"` // 轨迹变化类型
	ActionMsg  string `json:"action_msg"`  // 轨迹变化具体信息说明,展示在快递轨迹详情页中。若有手机号码,则直接写11位手机号码。使用UTF-8编码。
}

ExpressPathUpdater 运单轨迹更新器

type ExpressService

type ExpressService struct {
	Type uint8  `json:"service_type"` // 服务类型ID
	Name string `json:"service_name"` // 服务名称
}

ExpressService 服务类型

type ExpressShop

type ExpressShop struct {
	WXAPath    string `json:"wxa_path"`    // 商家小程序的路径,建议为订单页面
	IMGUrl     string `json:"img_url"`     // 商品缩略图 url
	GoodsName  string `json:"goods_name"`  // 商品名称
	GoodsCount uint   `json:"goods_count"` // 商品数量
}

ExpressShop 商家信息

type ExpressTemplatePreviewer

type ExpressTemplatePreviewer struct {
	WaybillID       string       `json:"waybill_id"`       // 运单 ID
	WaybillTemplate string       `json:"waybill_template"` // 面单 HTML 模板内容(需经 Base64 编码)
	WaybillData     string       `json:"waybill_data"`     // 面单数据。详情参考下单事件返回值中的 WaybillData
	Custom          ExpressOrder `json:"custom"`           // 商户下单数据,格式是商户侧下单 API 中的请求体
}

ExpressTemplatePreviewer 面单模板预览器

type FaceIdentifyResponse

type FaceIdentifyResponse struct {
	request.CommonError
	Result          int    `json:"identify_ret"`       // 认证结果
	Time            uint32 `json:"identify_time"`      // 认证时间
	Data            string `json:"validate_data"`      // 用户读的数字(如是读数字)
	OpenID          string `json:"openid"`             // 用户openid
	UserIDKey       string `json:"user_id_key"`        // 用于后台交户表示用户姓名、身份证的凭证
	FinishTime      uint32 `json:"finish_time"`        // 认证结束时间
	IDCardNumberMD5 string `json:"id_card_number_md5"` // 身份证号的md5(最后一位X为大写)
	NameUTF8MD5     string `json:"name_utf8_md5"`      // 姓名MD5
}

FaceIdentifyResponse 人脸识别结果返回

type FetchLiveRoomListResponse

type FetchLiveRoomListResponse struct {
	request.CommonError
	// 拉取房间总数
	Total int             `json:"total"`
	List  []*LiveRoomItem `json:"room_info"`
}

type GetAllImmediateDeliveryResponse

type GetAllImmediateDeliveryResponse struct {
	*request.CommonResult
	List []struct {
		ID   string `json:"delivery_id"`   //配送公司Id
		Name string `json:"delivery_name"` //	配送公司名称
	} `json:"list"` // 配送公司列表
}

GetAllImmediateDeliveryResponse 获取已支持的配送公司列表接口返回数据

type GetBindAccountResponse

type GetBindAccountResponse struct {
	*request.CommonResult
	ShopList []struct {
		DeliveryID  string `json:"delivery_id"`  // 配送公司Id
		ShopID      string `json:"shopid"`       // 商家id
		AuditResult uint8  `json:"audit_result"` // 审核状态
	} `json:"shop_list"` // 配送公司列表
}

GetBindAccountResponse 返回数据

type GetContactResponse

type GetContactResponse struct {
	request.CommonError
	WaybillID string      `json:"waybill_id"` // 运单 ID
	Sender    ContactUser `json:"sender"`     // 发件人信息
	Receiver  ContactUser `json:"receiver"`   // 收件人信息
}

GetContactResponse 获取面单联系人信息返回数据

type GetDeliveryOrderResponse

type GetDeliveryOrderResponse struct {
	*request.CommonResult
	OrderStatus int     `json:"order_status"` // 	配送状态,枚举值
	WaybillID   string  `json:"waybill_id"`   // 配送单号
	RiderName   string  `json:"rider_name"`   // 骑手姓名
	RiderPhone  string  `json:"rider_phone"`  // 骑手电话
	RiderLng    float64 `json:"rider_lng"`    // 骑手位置经度, 配送中时返回
	RiderLat    float64 `json:"rider_lat"`    // 骑手位置纬度, 配送中时返回
}

GetDeliveryOrderResponse 返回数据

type GetExpressOrderResponse

type GetExpressOrderResponse struct {
	request.CommonError
	PrintHTML   string `json:"print_html"` // 运单 html 的 BASE64 结果
	WaybillData []struct {
		Key   string `json:"key"`   // 运单信息 key
		Value string `json:"value"` // 运单信息 value
	} `json:"waybill_data"` // 运单信息
}

GetExpressOrderResponse 获取运单返回数据

type GetExpressPathResponse

type GetExpressPathResponse struct {
	request.CommonError
	OpenID       string            `json:"openid"`         // 用户openid
	DeliveryID   string            `json:"delivery_id"`    // 快递公司 ID
	WaybillID    string            `json:"waybill_id"`     // 运单 ID
	PathItemNum  uint              `json:"path_item_num"`  // 轨迹节点数量
	PathItemList []ExpressPathNode `json:"path_item_list"` // 轨迹节点列表
}

GetExpressPathResponse 运单轨迹

type GetPaidUnionIDResponse

type GetPaidUnionIDResponse struct {
	request.CommonError
	UnionID string `json:"unionid"`
}

GetPaidUnionIDResponse response data

type GetPluginDevApplyListResponse

type GetPluginDevApplyListResponse struct {
	request.CommonError
	ApplyList []struct {
		AppID      string `json:"appid"`      // 插件 appId
		Status     uint8  `json:"status"`     // 插件状态
		Nickname   string `json:"nickname"`   // 插件昵称
		HeadImgURL string `json:"headimgurl"` // 插件头像
		Categories []struct {
			First  string `json:"first"`
			Second string `json:"second"`
		} `json:"categories"` // 使用者的类目
		CreateTime string `json:"create_time"` // 使用者的申请时间
		ApplyURL   string `json:"apply_url"`   // 使用者的小程序码
		Reason     string `json:"reason"`      // 使用者的申请说明
	} `json:"apply_list"` // 申请或使用中的插件列表
}

GetPluginDevApplyListResponse 查询已添加的插件返回数据

type GetPluginListResponse

type GetPluginListResponse struct {
	request.CommonError
	PluginList []struct {
		AppID      string `json:"appid"`      // 插件 appId
		Status     int8   `json:"status"`     // 插件状态
		Nickname   string `json:"nickname"`   // 插件昵称
		HeadImgURL string `json:"headimgurl"` // 插件头像
	} `json:"plugin_list"` // 申请或使用中的插件列表
}

GetPluginListResponse 查询已添加的插件返回数据

type GetPrinterResponse

type GetPrinterResponse struct {
	request.CommonError
	Count     uint     `json:"count"`  // 已经绑定的打印员数量
	OpenID    []string `json:"openid"` // 打印员 openid 列表
	TagIDList []string `json:"tagid_list"`
}

GetPrinterResponse 获取打印员返回数据

type GetPubTemplateKeyWordsByIdResponse

type GetPubTemplateKeyWordsByIdResponse struct {
	request.CommonError
	Count int32 `json:"count"` // 模版标题列表总数
	Data  []struct {
		Kid     int    `json:"kid"`     // 关键词 id,选用模板时需要
		Name    string `json:"name"`    // 关键词内容
		Example string `json:"example"` // 关键词内容对应的示例
		Rule    string `json:"rule"`    // 参数类型
	} `json:"data"` // 关键词列表
}

GetPubTemplateKeyWordsByIdResponse 模板标题下的关键词列表

type GetPubTemplateTitleListResponse

type GetPubTemplateTitleListResponse struct {
	request.CommonError
	Count uint `json:"count"` // 模版标题列表总数
	Data  []struct {
		Tid        int    `json:"tid"`        // 模版标题 id
		Title      string `json:"title"`      // 模版标题
		Type       int32  `json:"type"`       // 模版类型,2 为一次性订阅,3 为长期订阅
		CategoryId string `json:"categoryId"` // 模版所属类目 id
	} `json:"data"` // 模板标题列表
}

GetPubTemplateTitleListResponse 帐号所属类目下的公共模板标题

type GetTemplateCategoryResponse

type GetTemplateCategoryResponse struct {
	request.CommonError
	Data []struct {
		ID   int    `json:"id"`   // 类目id,查询公共库模版时需要
		Name string `json:"name"` // 类目的中文名
	} `json:"data"` // 类目列表
}

GetTemplateCategoryResponse 删除帐号下的某个模板返回数据

type GetTemplateListResponse

type GetTemplateListResponse struct {
	request.CommonError
	Data []struct {
		Pid     string `json:"priTmplId"` // 添加至帐号下的模板 id,发送小程序订阅消息时所需
		Title   string `json:"title"`     // 模版标题
		Content string `json:"content"`   // 模版内容
		Example string `json:"example"`   // 模板内容示例
		Type    int32  `json:"type"`      // 模版类型,2 为一次性订阅,3 为长期订阅
	} `json:"data"` // 个人模板列表
}

GetTemplateListResponse 获取模板列表返回的数据

type IDCardResponse

type IDCardResponse = CardResponse

IDCardResponse 识别身份证返回数据

type InsureStatus

type InsureStatus = uint8

InsureStatus 保价状态

type KFInfo

type KFInfo struct {
	OpenKF    bool   `json:"open_kf"`
	KFHeading string `json:"kf_headimg"`
	KFName    string `json:"kf_name"`
}

KFInfo // 客服信息

type LicensePoint

type LicensePoint struct {
	X uint `json:"x"`
	Y uint `json:"y"`
}

LicensePoint 证件点

type LicensePosition

type LicensePosition struct {
	LeftTop     LicensePoint `json:"left_top"`
	RightTop    LicensePoint `json:"right_top"`
	RightBottom LicensePoint `json:"right_bottom"`
	LeftBottom  LicensePoint `json:"left_bottom"`
}

LicensePosition 证件位置

type LiveRoomCreator

type LiveRoomCreator struct {
	Name            string   // 房间名字
	CoverImg        string   // 通过 uploadfile 上传,填写 mediaID
	StartTime       int64    // 开始时间
	EndTime         int64    // 结束时间
	AnchorName      string   // 主播昵称
	AnchorWechat    string   // 主播微信号
	SubAnchorWechat string   // 主播副号微信号
	CreatorWechat   string   // 创建者微信号
	ShareIMGMediaID string   //通过 uploadfile 上传,填写 mediaID
	FeedsIMGMediaID string   // 通过 uploadfile 上传,填写 mediaID
	IsFeedsPublic   bool     // 是否开启官方收录,1 开启,0 关闭
	Type            LiveType // 直播类型,1 推流 0 手机直播
	CloseLike       bool     // 是否关闭点赞
	CloseGoods      bool     // 是否关闭商品货架
	CloseComment    bool     //是否开启评论
	CloseReplay     bool     // 是否关闭回放
	CloseShare      bool     // 是否关闭分享
	CloseKf         bool     // 是否关闭客服
}

直播间创建器

type LiveRoomGoods

type LiveRoomGoods struct {
	// 商品封面图链接
	CoverIMG string `json:"cover_img"`
	// 商品小程序路径
	URL string `json:"url"`
	// 商品名称
	Name string `json:"name"`
	// 商品价格(分)
	Price int64 `json:"price"`
	// 商品价格(参考价格类型)
	Price2 int64 `json:"price2"`
	// 价格类型,1:一口价(只需要传入price,price2不传) 2:价格区间(price字段为左边界,price2字段为右边界,price和price2必填) 3:显示折扣价(price字段为原价,price2字段为现价, price和price2必填)
	Price_type PriceType `json:"price_type"`
	// 商品id
	GoodsID int `json:"goods_id"`
	//第三方商品appid ,当前小程序商品则为空
	ThirdPartyAppID string `json:"third_party_appid"`
}

type LiveRoomItem

type LiveRoomItem struct {
	// 直播间名称
	Name string `json:"name"`
	// 直播间ID
	RoomID int `json:"roomid"`
	// 直播间背景图链接
	CoverIMG string `json:"cover_img"`
	// 直播间分享图链接
	ShareIMG string `json:"share_img"`
	// 直播间状态
	LiveStatus LiveStatus `json:"live_status"`
	// 直播间开始时间
	StartTime int `json:"start_time"`
	// 直播计划结束时间
	EndTime int `json:"end_time"`
	// 主播名
	AnchorName string           `json:"anchor_name"`
	Goods      []*LiveRoomGoods `json:"goods"`
	// 直播类型
	LiveType LiveType `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"`
	// 创建者openid
	CreatorOpenID string `json:"creater_openid"`
	// 官方收录封面
	FeedsIMG string `json:"feeds_img"`
}

type LiveStatus

type LiveStatus uint8

直播间状态

const (
	LiveStatusLiving    LiveStatus // 直播中
	LiveStatusNotStated            // 未开始
	LiveStatusFinished             // 已结束
	LiveStatusBan                  // 禁播
	LiveStatusPause                // 暂停
	LiveStatusException            // 异常
	LiveStatusExpired              // 已过期
)

type LiveType

type LiveType uint8
const (
	// 手机直播
	LiveTypePhone LiveType = iota
	// 推流
	LiveTypePushFlow
)

type LoginResponse

type LoginResponse struct {
	request.CommonError
	OpenID     string `json:"openid"`
	SessionKey string `json:"session_key"`
	// 用户在开放平台的唯一标识符
	// 只在满足一定条件的情况下返回
	UnionID string `json:"unionid"`
}

LoginResponse 返回给用户的数据

type MediaType

type MediaType = uint8

MediaType 检测内容类型

const (
	MediaTypeAudio MediaType // 音频
	MediaTypeImage           // 图片
)

所有检测内容类型

type Miniprogram

type Miniprogram struct {
	AppID    string `json:"appid"`
	PagePath string `json:"pagepath"`
}

Miniprogram 小程序

type MiniprogramState

type MiniprogramState = string

MiniprogramState 跳转小程序类型

type Mobile

type Mobile struct {
	PhoneNumber     string    `json:"phoneNumber"`
	PurePhoneNumber string    `json:"purePhoneNumber"`
	CountryCode     string    `json:"countryCode"`
	Watermark       watermark `json:"watermark"`
}

Mobile 解密后的用户手机号码信息

type NearbyPoi

type NearbyPoi struct {
	PicList           PicList      `json:"pic_list"`           // 门店图片,最多9张,最少1张,上传门店图片如门店外景、环境设施、商品服务等,图片将展示在微信客户端的门店页。图片链接通过文档https://mpoi.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738729中的《上传图文消息内的图片获取URL》接口获取。必填,文件格式为bmp、png、jpeg、jpg或gif,大小不超过5M pic_list是字符串,内容是一个json!
	ServiceInfos      ServiceInfos `json:"service_infos"`      // 必服务标签列表 选填,需要填写服务标签ID、APPID、对应服务落地页的path路径,详细字段格式见下方示例
	StoreName         string       `json:"store_name"`         // 门店名字 必填,门店名称需按照所选地理位置自动拉取腾讯地图门店名称,不可修改,如需修改请重现选择地图地点或重新创建地点
	Hour              string       `json:"hour"`               // 营业时间,格式11:11-12:12 必填
	Credential        string       `json:"credential"`         // 资质号 必填, 15位营业执照注册号或9位组织机构代码
	Address           string       `json:"address"`            // 地址 必填
	CompanyName       string       `json:"company_name"`       // 主体名字 必填
	QualificationList string       `json:"qualification_list"` // 证明材料 必填 如果company_name和该小程序主体不一致,需要填qualification_list,详细规则见附近的小程序使用指南-如何证明门店的经营主体跟公众号或小程序帐号主体相关http://kf.qq.com/faq/170401MbUnim17040122m2qY.html
	KFInfo            KFInfo       `json:"kf_info"`            // 客服信息 选填,可自定义服务头像与昵称,具体填写字段见下方示例kf_info pic_list是字符串,内容是一个json!
	PoiID             string       `json:"poi_id"`             // 如果创建新的门店,poi_id字段为空 如果更新门店,poi_id参数则填对应门店的poi_id 选填
}

NearbyPoi 附近地点

type NearbyPoiShowStatus

type NearbyPoiShowStatus int8

NearbyPoiShowStatus 展示状态

const (
	HideNearbyPoi NearbyPoiShowStatus = iota // 不展示
	ShowNearbyPoi                            // 展示
)

所有展示状态

type Page

type Page struct {
	PagePath       string  `json:"Page_path"`        // 页面路径
	PageVisitPV    uint    `json:"Page_visit_pv"`    // 访问次数
	PageVisitUV    uint    `json:"Page_visit_uv"`    // 访问人数
	PageStaytimePV float64 `json:"page_staytime_pv"` // 次均停留时长
	EntrypagePV    uint    `json:"entrypage_pv"`     // 进入页次数
	ExitpagePV     uint    `json:"exitpage_pv"`      // 退出页次数
	PageSharePV    uint    `json:"page_share_pv"`    // 转发次数
	PageShareUV    uint    `json:"page_share_uv"`    // 转发人数

}

Page 页面

type PageAble

type PageAble struct {
	Start int `json:"start"`
	Limit int `json:"limit"`
}

分页器

type PicList

type PicList struct {
	List []string `json:"list"`
}

PicList 门店图片

type Portrait

type Portrait struct {
	Index     uint        `json:"index"`     // 分布类型
	Province  []Attribute `json:"province"`  // 省份,如北京、广东等
	City      []Attribute `json:"city"`      // 城市,如北京、广州等
	Genders   []Attribute `json:"genders"`   // 性别,包括男、女、未知
	Platforms []Attribute `json:"platforms"` // 终端类型,包括 iPhone,android,其他
	Devices   []Attribute `json:"devices"`   // 机型,如苹果 iPhone 6,OPPO R9 等
	Ages      []Attribute `json:"ages"`      // 年龄,包括17岁以下、18-24岁等区间
}

Portrait 肖像

type PositionList

type PositionList struct {
	request.CommonError
	Data struct {
		LeftApplyNum uint `json:"left_apply_num"` // 剩余可添加地点个数
		MaxApplyNum  uint `json:"max_apply_num"`  // 最大可添加地点个数
		Data         struct {
			List []struct {
				PoiID                string `json:"poi_id"`                // 附近地点 ID
				QualificationAddress string `json:"qualification_address"` // 资质证件地址
				QualificationNum     string `json:"qualification_num"`     // 资质证件证件号
				AuditStatus          int    `json:"audit_status"`          // 地点审核状态
				DisplayStatus        int    `json:"display_status"`        // 地点展示在附近状态
				RefuseReason         string `json:"refuse_reason"`         // 审核失败原因,audit_status=4 时返回
			} `json:"poi_list"` // 地址列表
		} `json:"-"`
		RawData string `json:"data"` // 地址列表的 JSON 格式字符串
	} `json:"data"` // 返回数据
}

PositionList 地点列表

type PreDeliveryOrderResponse

type PreDeliveryOrderResponse struct {
	Fee              float64 `json:"fee"`               // 实际运费(单位:元),运费减去优惠券费用
	Deliverfee       float64 `json:"deliverfee"`        // 运费(单位:元)
	Couponfee        float64 `json:"couponfee"`         // 优惠券费用(单位:元)
	Tips             float64 `json:"tips"`              // 小费(单位:元)
	Insurancefee     float64 `json:"insurancefee"`      // 保价费(单位:元)
	Distance         float64 `json:"distance"`          // 配送距离(单位:米)
	DispatchDuration uint    `json:"dispatch_duration"` // 预计骑手接单时间,单位秒,比如5分钟,就填300, 无法预计填0
	DeliveryToken    string  `json:"delivery_token"`    // 配送公司可以返回此字段,当用户下单时候带上这个字段,保证在一段时间内运费不变
}

PreDeliveryOrderResponse 返回数据

type PreviewTemplateResponse

type PreviewTemplateResponse struct {
	request.CommonError
	WaybillID               string `json:"waybill_id"`                // 运单 ID
	RenderedWaybillTemplate string `json:"rendered_waybill_template"` // 渲染后的面单 HTML 文件(已经过 Base64 编码)
}

PreviewTemplateResponse 预览面单模板返回数据

type PriceType

type PriceType uint8
const (
	PriceTypeOne      PriceType // 一口价
	PriceTypeRange              // 区间价格
	PriceTypeDiscount           // 折扣价格
)

type PrintedTextResponse

type PrintedTextResponse struct {
	request.CommonError
	Items []struct {
		Text     string          `json:"text"`
		Position LicensePosition `json:"pos"`
	} `json:"items"` //	识别结果
	ImgSize LicensePoint `json:"img_size"` //	图片大小
}

PrintedTextResponse 通用印刷体 OCR 识别返回数据

type PrinterUpdater

type PrinterUpdater struct {
	OpenID    string   `json:"openid"`      // 打印员 openid
	Type      BindType `json:"update_type"` // 更新类型
	TagIDList string   `json:"tagid_list"`  // 用于平台型小程序设置入驻方的打印员面单打印权限,同一打印员最多支持10个tagid,使用逗号分隔,如填写123,456,表示该打印员可以拉取到tagid为123和456的下的单,非平台型小程序无需填写该字段
}

PrinterUpdater 打印员更新器

type QRCode

type QRCode struct {
	Path      string `json:"path"`
	Width     int    `json:"width,omitempty"`
	AutoColor bool   `json:"auto_color,omitempty"`
	LineColor Color  `json:"line_color,omitempty"`
	IsHyaline bool   `json:"is_hyaline,omitempty"`
}

QRCode 小程序码参数

type QRCodeCreator

type QRCodeCreator struct {
	Path  string `json:"path"`            // 扫码进入的小程序页面路径,最大长度 128 字节,不能为空;对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。
	Width int    `json:"width,omitempty"` // 二维码的宽度,单位 px。最小 280px,最大 1280px
}

QRCodeCreator 二维码创建器

type QRCodePoint

type QRCodePoint struct {
	X uint `json:"x"`
	Y uint `json:"y"`
}

QRCodePoint 二维码角的位置

type QuotaGetResponse

type QuotaGetResponse struct {
	request.CommonError
	QuotaNum int `json:"quota_num"` // 电子面单余额
}

QuotaGetResponse 电子面单余额

type QuotaGetter

type QuotaGetter struct {
	DeliveryID string `json:"delivery_id"` // 快递公司ID,参见getAllDelivery
	BizID      string `json:"biz_id"`      // 快递公司客户编码
}

QuotaGetter 电子面单余额获取器

type RecognizeMode

type RecognizeMode = string

RecognizeMode 图片识别模式

const (
	RecognizeModePhoto RecognizeMode = "photo" // 拍照模式
	RecognizeModeScan  RecognizeMode = "scan"  // 扫描模式
)

所有图片识别模式

type Retain

type Retain struct {
	Key   uint8 `json:"key"`   // 标识,0开始,表示当月,1表示1月后。key取值分别是:0,1
	Value uint  `json:"value"` // key对应日期的新增用户数/活跃用户数(key=0时)或留存用户数(k>0时)
}

Retain 用户留存

type RetainResponse

type RetainResponse struct {
	request.CommonError
	RefDate    string   `json:"ref_date"`     // 时间,月格式为 yyyymm | 周格式为 yyyymmdd-yyyymmdd | 天格式为 yyyymmdd
	VisitUV    []Retain `json:"visit_uv"`     // 活跃用户留存
	VisitUVNew []Retain `json:"visit_uv_new"` // 新增用户留存
}

RetainResponse 生物认证秘钥签名验证请求返回数据

type RunData

type RunData struct {
	StepInfoList []SetpInfo `json:"stepInfoList"`
}

RunData 解密后的最近30天微信运动步数

type ScanQRCodeResponse

type ScanQRCodeResponse struct {
	request.CommonError
	CodeResults []struct {
		TypeName string `json:"type_name"`
		Data     string `json:"data"`
		Position struct {
			LeftTop     QRCodePoint `json:"left_top"`
			RightTop    QRCodePoint `json:"right_top"`
			RightBottom QRCodePoint `json:"right_bottom"`
			LeftBottom  QRCodePoint `json:"left_bottom"`
		} `json:"pos"`
	} `json:"code_results"`
	IMGSize struct {
		Width  uint `json:"w"`
		Height uint `json:"h"`
	} `json:"img_size"`
}

ScanQRCodeResponse 小程序的条码/二维码识别后的返回数据

type SchemedInfo

type SchemedInfo struct {
	// 通过scheme码进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带query。path为空时会跳转小程序主页。
	Path string `json:"path"`
	// 通过scheme码进入小程序时的query,最大128个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~
	Query string `json:"query"`
}

type SearchImageResponse

type SearchImageResponse struct {
	request.CommonError
	// 生成的小程序 URL Link
	URLLink string `json:"url_link"`
}

type SearchSiteRequest

type SearchSiteRequest struct {
	// 必填	关键词
	Keyword string `json:"keyword"`
	// 必填	请求下一页的参数,开发者无需理解。为空时查询的是第一页内容,如需查询下一页,把返回参数的next_page_info填充到这里即可
	NextPageInfo string `json:"next_page_info"`
}

type SearchSiteResponse

type SearchSiteResponse struct {
	request.CommonError
	// 生成的小程序 URL Link
	URLLink string `json:"url_link"`
}

type SearchSubmitPage

type SearchSubmitPage struct {
	Path  string `json:"path"`
	Query string `json:"query"`
}

SearchSubmitPage 请求收录的页面

type SearchSubmitPagesRequest

type SearchSubmitPagesRequest struct {
	Pages []SearchSubmitPage `json:"pages"`
}

SearchSubmitPagesRequest 小程序页面收录请求

type ServiceInfo

type ServiceInfo struct {
	ID    uint   `json:"id"`
	Type  uint8  `json:"type"`
	Name  string `json:"name"`
	AppID string `json:"appid"`
	Path  string `json:"path"`
}

ServiceInfo 必服务标签

type ServiceInfos

type ServiceInfos struct {
	ServiceInfos []ServiceInfo `json:"service_infos"`
}

ServiceInfos 必服务标签列表

type SetTypingCommand

type SetTypingCommand = string

SetTypingCommand 下发客服当前输入状态命令

const (
	SetTypingCommandTyping       SetTypingCommand = "Typing"       // 对用户下发"正在输入"状态
	SetTypingCommandCancelTyping SetTypingCommand = "CancelTyping" // 取消对用户的"正在输入"状态
)

所有下发客服当前输入状态命令

type SetpInfo

type SetpInfo struct {
	Step      int   `json:"step"`
	Timestamp int64 `json:"timestamp"`
}

SetpInfo 运动步数

type ShareInfo

type ShareInfo struct {
	GID string `json:"openGId"`
}

ShareInfo 解密后的分享信息

type ShortLinkRequest

type ShortLinkRequest struct {
	// 必填	通过 Short Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,可携带 query,最大1024个字符
	PageURL string `json:"page_url"`
	// 必填	页面标题,不能包含违法信息,超过20字符会用... 截断代替
	PageTitle string `json:"page_title"`
	// 非必填	生成的 Short Link 类型,短期有效:false,永久有效:true
	IsPermanent bool `json:"is_permanent"`
}

type ShortLinkResponse

type ShortLinkResponse struct {
	request.CommonError
	// 生成的小程序 Short Link
	Link string `json:"link"`
}

type SubscribeMessage

type SubscribeMessage struct {
	ToUser           string           `json:"touser"`
	TemplateID       string           `json:"template_id"`
	Page             string           `json:"page,omitempty"`
	MiniprogramState MiniprogramState `json:"miniprogram_state,omitempty"`
	Data             string           `json:"data"`
}

SubscribeMessage 订阅消息

type Summary

type Summary struct {
	RefDate    string `json:"ref_date"`    // 	日期,格式为 yyyymmdd
	VisitTotal uint   `json:"visit_total"` //	累计用户数
	SharePV    uint   `json:"share_pv"`    //	转发次数
	ShareUV    uint   `json:"share_uv"`    //	转发人数
}

Summary 概况

type SuperResolutionResponse

type SuperResolutionResponse struct {
	request.CommonError
	MediaID string `json:"media_id"`
}

SuperResolutionResponse 图片高清化后的返回数据

type TempMediaType

type TempMediaType = string

TempMediaType 文件类型

const (
	TempMediaTypeImage TempMediaType = "image" // 图片
)

所有文件类型

type TokenResponse

type TokenResponse struct {
	request.CommonError
	AccessToken string `json:"access_token"` // 获取到的凭证
	ExpiresIn   uint   `json:"expires_in"`   // 凭证有效时间,单位:秒。目前是7200秒之内的值。
}

TokenResponse 获取 access_token 成功返回数据

type Trend

type Trend struct {
	RefDate         string  `json:"ref_date"`          // 时间,月格式为 yyyymm | 周格式为 yyyymmdd-yyyymmdd | 天格式为 yyyymmdd
	SessionCNT      uint    `json:"session_cnt"`       // 打开次数(自然月内汇总)
	VisitPV         uint    `json:"visit_pv"`          // 访问次数(自然月内汇总)
	VisitUV         uint    `json:"visit_uv"`          // 访问人数(自然月内去重)
	VisitUVNew      uint    `json:"visit_uv_new"`      // 新用户数(自然月内去重)
	StayTimeUV      float64 `json:"stay_time_uv"`      // 人均停留时长 (浮点型,单位:秒)
	StayTimeSession float64 `json:"stay_time_session"` // 次均停留时长 (浮点型,单位:秒)
	VisitDepth      float64 `json:"visit_depth"`       // 平均访问深度 (浮点型)
}

Trend 用户趋势

type URLLinkCloudBase

type URLLinkCloudBase struct {
	// 必填	云开发环境
	Env string `json:"env"`
	// 非必填	静态网站自定义域名,不填则使用默认域名
	Domain string `json:"domain"`
	// 非必填	云开发静态网站 H5 页面路径,不可携带 query
	Path string `json:"path"`
	// 非必填	云开发静态网站 H5 页面 query 参数,最大 1024 个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~%
	Query string `json:"query"`
	// 非必填	第三方批量代云开发时必填,表示创建该 env 的 appid (小程序/第三方平台)
	ResourceAppid string `json:"resource_appid"`
}

type URLLinkExpireType

type URLLinkExpireType = uint8

URLLink 有效期类型

const (
	URLLinkExpireTypeTime URLLinkExpireType = 0
	URLLinkExpireTypeDate URLLinkExpireType = 1
)

type URLLinkRequest

type URLLinkRequest struct {
	// 非必填	通过 URL Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带 query 。path 为空时会跳转小程序主页
	Path string `json:"path"`
	// 非必填	通过 URL Link 进入小程序时的query,最大1024个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~%
	Query string `json:"query"`
	// 非必填	生成的 URL Link 类型,到期失效:true,永久有效:false
	IsExpired bool `json:"is_expire"`
	// 非必填	小程序 URL Link 失效类型,失效时间:0,失效间隔天数:1
	ExpireType URLLinkExpireType `json:"expire_type"`
	// 非必填	到期失效的 URL Link 的失效时间,为 Unix 时间戳。生成的到期失效 URL Link 在该时间前有效。最长有效期为1年。expire_type 为 0 必填
	ExpireTime int64 `json:"expire_time"`
	// 非必填	到期失效的URL Link的失效间隔天数。生成的到期失效URL Link在该间隔时间到达前有效。最长间隔天数为365天。expire_type 为 1 必填
	ExpireInterval int64 `json:"expire_interval"`
	// 非必填	云开发静态网站自定义 H5 配置参数,可配置中转的云开发 H5 页面。不填默认用官方 H5 页面
	CloudBase *URLLinkCloudBase `json:"cloud_base"`
}

type URLLinkResponse

type URLLinkResponse struct {
	request.CommonError
	// 生成的小程序 URL Link
	URLLink string `json:"url_link"`
}

type URLSchemeRequest

type URLSchemeRequest struct {
	// 跳转到的目标小程序信息。
	SchemedInfo *SchemedInfo `json:"jump_wxa,omitempty"`
	// 成的scheme码类型,到期失效:true,永久有效:false。
	IsExpire bool `json:"is_expire,omitempty"`
	// 到期失效的scheme码的失效时间,为Unix时间戳。生成的到期失效scheme码在该时间前有效。最长有效期为1年。生成到期失效的scheme时必填。
	ExpireTime int64 `json:"expire_time,omitempty"`
}

type URLSchemeResponse

type URLSchemeResponse struct {
	request.CommonError
	// 生成的小程序scheme码
	Openlink string `json:"openlink"`
}

type UniformMpTmpMsg

type UniformMpTmpMsg struct {
	AppID       string                `json:"appid"`
	TemplateID  string                `json:"template_id"`
	URL         string                `json:"url"`
	Miniprogram UniformMsgMiniprogram `json:"miniprogram"`
	Data        UniformMsgData        `json:"data"`
}

UniformMpTmpMsg 公众号模板消息

type UniformMsgData

type UniformMsgData map[string]UniformMsgKeyword

UniformMsgData 模板消息内容

type UniformMsgKeyword

type UniformMsgKeyword struct {
	Value string `json:"value"`
	Color string `json:"color,omitempty"`
}

UniformMsgKeyword 关键字

type UniformMsgMiniprogram

type UniformMsgMiniprogram struct {
	AppID    string `json:"appid"`
	PagePath string `json:"pagepath"`
}

UniformMsgMiniprogram 小程序

type UniformMsgSender

type UniformMsgSender struct {
	ToUser             string             `json:"touser"` // 用户 openid
	UniformWeappTmpMsg UniformWeappTmpMsg `json:"weapp_template_msg,omitempty"`
	UniformMpTmpMsg    UniformMpTmpMsg    `json:"mp_template_msg,omitempty"`
}

UniformMsgSender 统一服务消息

type UniformWeappTmpMsg

type UniformWeappTmpMsg struct {
	TemplateID      string         `json:"template_id"`
	Page            string         `json:"page"`
	FormID          string         `json:"form_id"`
	Data            UniformMsgData `json:"data"`
	EmphasisKeyword string         `json:"emphasis_keyword,omitempty"`
}

UniformWeappTmpMsg 小程序模板消息

type UnlimitedQRCode

type UnlimitedQRCode struct {
	Scene      string `json:"scene"`
	Page       string `json:"page,omitempty"`
	CheckPath  bool   `json:"check_path"`
	EnvVersion string `json:"env_version,omitempty"`
	Width      int    `json:"width,omitempty"`
	AutoColor  bool   `json:"auto_color,omitempty"`
	LineColor  Color  `json:"line_color,omitempty"`
	IsHyaline  bool   `json:"is_hyaline,omitempty"`
}

UnlimitedQRCode 小程序码参数

type UpdatableMsg

type UpdatableMsg struct {
	ActivityID   string                  `json:"activity_id"`   // 动态消息的 ID,通过 updatableMessage.createActivityId 接口获取
	TargetState  UpdatableMsgTargetState `json:"target_state"`  // 动态消息修改后的状态(具体含义见后文)
	TemplateInfo UpdatableMsgTempInfo    `json:"template_info"` // 动态消息对应的模板信息
}

UpdatableMsg 动态消息

type UpdatableMsgParamName

type UpdatableMsgParamName = string

UpdatableMsgParamName 参数 name 的合法值

type UpdatableMsgParameter

type UpdatableMsgParameter struct {
	Name  UpdatableMsgParamName `json:"name"`  // 要修改的参数名
	Value string                `json:"value"` // 修改后的参数值
}

UpdatableMsgParameter 参数 member_count target_state = 0 时必填,文字内容模板中 member_count 的值 room_limit target_state = 0 时必填,文字内容模板中 room_limit 的值 path target_state = 1 时必填,点击「进入」启动小程序时使用的路径。 对于小游戏,没有页面的概念,可以用于传递查询字符串(query),如 "?foo=bar" version_type target_state = 1 时必填,点击「进入」启动小程序时使用的版本。 有效参数值为:develop(开发版),trial(体验版),release(正式版)

type UpdatableMsgTargetState

type UpdatableMsgTargetState = uint8

UpdatableMsgTargetState 动态消息修改后的状态

const (
	UpdatableMsgJoining UpdatableMsgTargetState = iota // 未开始
	UpdatableMsgStarted                                // 已开始
)

动态消息状态

type UpdatableMsgTempInfo

type UpdatableMsgTempInfo struct {
	ParameterList []UpdatableMsgParameter `json:"parameter_list"` // 模板中需要修改的参数列表
}

UpdatableMsgTempInfo 动态消息对应的模板信息

type UpdateDeliveryOrderMocker

type UpdateDeliveryOrderMocker struct {
	ShopID      string `json:"shopid"`        // 商家id, 必须是 "test_shop_id"
	ShopOrderID string `json:"shop_order_id"` // 唯一标识订单的 ID,由商户生成
	ActionTime  uint   `json:"action_time"`   // 状态变更时间点,Unix秒级时间戳
	OrderStatus int    `json:"order_status"`  // 配送状态,枚举值
	ActionMsg   string `json:"action_msg"`    // 附加信息
}

UpdateDeliveryOrderMocker 请求参数

type UpdateExpressOrderTester

type UpdateExpressOrderTester struct {
	BizID      string `json:"biz_id"`      // 商户id,需填test_biz_id
	OrderID    string `json:"order_id"`    //	订单ID,下单成功时返回
	WaybillID  string `json:"waybill_id"`  // 运单 ID
	DeliveryID string `json:"delivery_id"` // 快递公司 ID
	ActionTime uint   `json:"action_time"` // 轨迹变化 Unix 时间戳
	ActionType uint   `json:"action_type"` // 轨迹变化类型
	ActionMsg  string `json:"action_msg"`  // 轨迹变化具体信息说明,展示在快递轨迹详情页中。若有手机号码,则直接写11位手机号码。使用UTF-8编码。
}

UpdateExpressOrderTester 模拟的快递公司更新订单

type UploadTempMediaResponse

type UploadTempMediaResponse struct {
	request.CommonError
	Type      string `json:"type"`       // 文件类型
	MediaID   string `json:"media_id"`   // 媒体文件上传后,获取标识,3天内有效。
	CreatedAt uint   `json:"created_at"` // 媒体文件上传时间戳
}

UploadTempMediaResponse 上传媒体文件返回

type UserInfo

type UserInfo struct {
	// 用户昵称
	// 用户头像图片的 URL。URL 最后一个数值代表正方形头像大小(有 0、46、64、96、132 数值可选,0 代表 640x640 的正方形头像,46 表示 46x46 的正方形头像,剩余数值以此类推。默认132),用户没有头像时该项为空。若用户更换头像,原有头像 URL 将失效。
	Avatar string `json:"avatarUrl"`
	// 用户性别
	// 0	未知
	// 1	男性
	// 2	女性
	Gender int `json:"gender"`
	// 用户所在国家
	Country string `json:"country"`
	// 用户所在城市
	City string `json:"city"`
	// 显示 country,province,city 所用的语言
	// 	en	英文
	// zh_CN	简体中文
	// zh_TW	繁体中文
	Language string `json:"language"`
	// 用户昵称
	Nickname string `json:"nickName"`
	// 用户所在省份
	Province string `json:"province"`
}

UserInfo 解密后的用户信息

type UserPortrait

type UserPortrait struct {
	request.CommonError
	RefDate    string   `json:"ref_date"`
	VisitUV    Portrait `json:"visit_uv"`     // 活跃用户画像
	VisitUVNew Portrait `json:"visit_uv_new"` // 新用户画像
}

UserPortrait response data of get user portrait

type VehicleLicenseResponse

type VehicleLicenseResponse struct {
	request.CommonError
	VehicleType                string `json:"vehicle_type"`
	Owner                      string `json:"owner"`
	Addr                       string `json:"addr"`
	UseCharacter               string `json:"use_character"`
	Model                      string `json:"model"`
	Vin                        string `json:"vin"`
	EngineNum                  string `json:"engine_num"`
	RegisterDate               string `json:"register_date"`
	IssueDate                  string `json:"issue_date"`
	PlateNumB                  string `json:"plate_num_b"`
	Record                     string `json:"record"`
	PassengersNum              string `json:"passengers_num"`
	TotalQuality               string `json:"total_quality"`
	TotalprepareQualityQuality string `json:"totalprepare_quality_quality"`
}

VehicleLicenseResponse 识别卡片返回数据

type VerifySignatureResponse

type VerifySignatureResponse struct {
	request.CommonError
	IsOk bool `json:"is_ok"`
}

VerifySignatureResponse 生物认证秘钥签名验证请求返回数据

type VisitDistribution

type VisitDistribution struct {
	request.CommonError
	RefDate string         `json:"ref_date"`
	List    []Distribution `json:"list"`
}

VisitDistribution 用户小程序访问分布数据

type VisitPage

type VisitPage struct {
	request.CommonError
	RefDate string `json:"ref_date"`
	List    []Page `json:"list"`
}

VisitPage 页面访问数据

type VisitTrend

type VisitTrend struct {
	request.CommonError
	List []Trend `json:"list"`
}

VisitTrend 生物认证秘钥签名验证请求返回数据

Jump to

Keyboard shortcuts

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