Documentation ¶
Index ¶
- Constants
- type AICropResponse
- type AbnormalConfirmer
- type AccountList
- type AddExpressOrderResult
- type AddExpressOrderReturn
- type AddNearbyPoiResponse
- type AddNearbyPoiResult
- type AddTemplateResponse
- type AgentPosQueryResult
- type AgentPosQueryReturn
- type Attribute
- type AuthInfoGetResult
- type AuthInfoGetReturn
- type BankCardResponse
- type BindStatus
- type BindType
- type BusinessLicenseResponse
- type BusinessResultCode
- type BusinessUpdater
- type CSMsgImage
- type CSMsgLink
- type CSMsgMPCard
- type CSMsgText
- type CancelAuthResult
- type CancelAuthReturn
- type CancelDeliveryOrderResponse
- type CancelExpressOrderResult
- type CancelExpressOrderReturn
- type CancelOrderResponse
- type CardMessageResult
- type CardResponse
- type CardType
- type CargoDetail
- type CheckExpressBusinessResult
- type CheckExpressBusinessReturn
- type CheckMediaResponse
- type Color
- type CommonError
- func ApplyPlugin(token, appID, reason string) (*CommonError, error)
- func DeleteNearbyPoi(token, id string) (*CommonError, error)
- func DeleteTemplate(token, pid string) (*CommonError, error)
- func GetTempMedia(token, mediaID string) (*http.Response, *CommonError, error)
- func IMGSecCheck(token, filename string) (*CommonError, error)
- func MSGSecCheck(token, content string) (*CommonError, error)
- func SetDevPluginApplyStatus(token, appID, reason string, action DevAction) (*CommonError, error)
- func SetNearbyPoiShowStatus(token, poiID string, status NearbyPoiShowStatus) (*CommonError, error)
- func SetTyping(token, openID string, cmd SetTypingCommand) (*CommonError, error)
- func UnbindPlugin(token, appID string) (*CommonError, error)
- type CommonResult
- type CommonServerResult
- type CommonServerReturn
- type ContactUser
- type CreateActivityIDResponse
- type CreateDeliveryOrderResponse
- type CreateExpressOrderResponse
- type DailySummary
- type DeliveryAgent
- type DeliveryCargo
- type DeliveryGoods
- type DeliveryGoodsDetail
- type DeliveryList
- type DeliveryOrderAddResult
- type DeliveryOrderAddReturn
- type DeliveryOrderAddTipsResult
- type DeliveryOrderAddTipsReturn
- type DeliveryOrderCancelResult
- type DeliveryOrderCancelReturn
- type DeliveryOrderCanceler
- type DeliveryOrderCreator
- type DeliveryOrderGetter
- type DeliveryOrderInfo
- type DeliveryOrderPreAddResult
- type DeliveryOrderPreAddReturn
- type DeliveryOrderPreCancelResult
- type DeliveryOrderPreCancelReturn
- type DeliveryOrderQueryResult
- type DeliveryOrderQueryReturn
- type DeliveryOrderReaddResult
- type DeliveryOrderReaddReturn
- type DeliveryOrderReturnConfirmResult
- type DeliveryOrderReturnConfirmReturn
- type DeliveryOrderStatusUpdateResult
- type DeliveryOrderStatusUpdateReturn
- type DeliveryOrderUpdater
- type DeliveryShop
- type DeliveryTipAdder
- type DeliveryUser
- type DevAction
- type Distribution
- type DistributionItem
- type DrivingLicenseResponse
- type EncryptedMsgRequest
- type EncryptedResult
- type EventType
- type ExpreseeUserInfo
- type ExpressAccount
- type ExpressCargo
- type ExpressInsure
- type ExpressOrder
- type ExpressOrderCanceler
- type ExpressOrderCreator
- type ExpressOrderGetter
- type ExpressOrderSource
- type ExpressPathGetter
- type ExpressPathNode
- type ExpressPathUpdateResult
- type ExpressPathUpdater
- type ExpressService
- type ExpressShop
- type ExpressTemplatePreviewer
- type FaceIdentifyResponse
- type GetAllImmediateDeliveryResponse
- type GetBindAccountResponse
- type GetContactResponse
- type GetDeliveryOrderResponse
- type GetExpressOrderResponse
- type GetExpressPathResponse
- type GetExpressQuotaResult
- type GetExpressQuotaReturn
- type GetPaidUnionIDResponse
- type GetPluginDevApplyListResponse
- type GetPluginListResponse
- type GetPrinterResponse
- type GetPubTemplateKeyWordsByIdResponse
- type GetPubTemplateTitleListResponse
- type GetTemplateCategoryResponse
- type GetTemplateListResponse
- type IDCardResponse
- type ImageMessageResult
- type InsureStatus
- type KFInfo
- type LicensePoint
- type LicensePosition
- type LoginResponse
- type MediaCheckAsyncResult
- type MediaType
- type Miniprogram
- type MiniprogramState
- type Mobile
- type MsgType
- type NearbyPoi
- type NearbyPoiShowStatus
- type Page
- type PicList
- type Portrait
- type PositionList
- type PreAuthCodeGetResult
- type PreAuthCodeGetReturn
- type PreDeliveryOrderResponse
- type PreviewTemplateResponse
- type PrintedTextResponse
- type PrinterUpdater
- type QRCode
- type QRCodeCreator
- type QRCodePoint
- type QuotaGetResponse
- type QuotaGetter
- type RecognizeMode
- type Retain
- type RetainResponse
- type RiderScoreSetResult
- type RiderScoreSetReturn
- type RunData
- type ScanQRCodeResponse
- type SearchSubmitPage
- type SearchSubmitPages
- type Server
- func (srv *Server) OnAddExpressOrder(fn func(*AddExpressOrderResult) *AddExpressOrderReturn)
- func (srv *Server) OnAddNearbyPoi(fn func(*AddNearbyPoiResult))
- func (srv *Server) OnAgentPosQuery(fn func(*AgentPosQueryResult) *AgentPosQueryReturn)
- func (srv *Server) OnAuthInfoGet(fn func(*AuthInfoGetResult) *AuthInfoGetReturn)
- func (srv *Server) OnCancelAuth(fn func(*CancelAuthResult) *CancelAuthReturn)
- func (srv *Server) OnCancelExpressOrder(fn func(*CancelExpressOrderResult) *CancelExpressOrderReturn)
- func (srv *Server) OnCheckExpressBusiness(fn func(*CheckExpressBusinessResult) *CheckExpressBusinessReturn)
- func (srv *Server) OnCustomerServiceCardMessage(fn func(*CardMessageResult) *TransferCustomerMessage)
- func (srv *Server) OnCustomerServiceImageMessage(fn func(*ImageMessageResult) *TransferCustomerMessage)
- func (srv *Server) OnCustomerServiceTextMessage(fn func(*TextMessageResult) *TransferCustomerMessage)
- func (srv *Server) OnDeliveryOrderAdd(fn func(*DeliveryOrderAddResult) *DeliveryOrderAddReturn)
- func (srv *Server) OnDeliveryOrderAddTips(fn func(*DeliveryOrderAddTipsResult) *DeliveryOrderAddTipsReturn)
- func (srv *Server) OnDeliveryOrderCancel(fn func(*DeliveryOrderCancelResult) *DeliveryOrderCancelReturn)
- func (srv *Server) OnDeliveryOrderPreAdd(fn func(*DeliveryOrderPreAddResult) *DeliveryOrderPreAddReturn)
- func (srv *Server) OnDeliveryOrderPreCancel(fn func(*DeliveryOrderPreCancelResult) *DeliveryOrderPreCancelReturn)
- func (srv *Server) OnDeliveryOrderQuery(fn func(*DeliveryOrderQueryResult) *DeliveryOrderQueryReturn)
- func (srv *Server) OnDeliveryOrderReadd(fn func(*DeliveryOrderReaddResult) *DeliveryOrderReaddReturn)
- func (srv *Server) OnDeliveryOrderReturnConfirm(fn func(*DeliveryOrderReturnConfirmResult) *DeliveryOrderReturnConfirmReturn)
- func (srv *Server) OnDeliveryOrderStatusUpdate(fn func(*DeliveryOrderStatusUpdateResult) *DeliveryOrderStatusUpdateReturn)
- func (srv *Server) OnExpressPathUpdate(fn func(*ExpressPathUpdateResult))
- func (srv *Server) OnGetExpressQuota(fn func(*GetExpressQuotaResult) *GetExpressQuotaReturn)
- func (srv *Server) OnMediaCheckAsync(fn func(*MediaCheckAsyncResult))
- func (srv *Server) OnPreAuthCodeGet(fn func(*PreAuthCodeGetResult) *PreAuthCodeGetReturn)
- func (srv *Server) OnRiderScoreSet(fn func(*RiderScoreSetResult) *RiderScoreSetReturn)
- func (srv *Server) OnUserTempsessionEnter(fn func(*UserTempsessionEnterResult))
- func (srv *Server) Serve(w http.ResponseWriter, r *http.Request) error
- type ServiceInfo
- type ServiceInfos
- type SetTypingCommand
- type SetpInfo
- type ShareInfo
- type SubscribeMessage
- type SubscribeMessageData
- type Summary
- type SuperResolutionResponse
- type TempMediaType
- type TextMessageResult
- type TokenResponse
- type TransferCustomerMessage
- type Trend
- type UniformMpTmpMsg
- type UniformMsgData
- type UniformMsgKeyword
- type UniformMsgMiniprogram
- type UniformMsgSender
- type UniformWeappTmpMsg
- type UnlimitedQRCode
- type UpdatableMsgParamName
- type UpdatableMsgParameter
- type UpdatableMsgSetter
- type UpdatableMsgTargetState
- type UpdatableMsgTempInfo
- type UpdateDeliveryOrderMocker
- type UpdateExpressOrderTester
- type UploadTempMediaResponse
- type UserInfo
- type UserPortrait
- type UserTempsessionEnterResult
- type VehicleLicenseResponse
- type VerifySignatureResponse
- type VisitDistribution
- type VisitPage
- type VisitTrend
Constants ¶
const ( Bind = "bind" // 绑定 Unbind = "unbind" // 解除绑定 )
所有绑定动作类型
const ( BindSuccess = 0 // 成功 BindFailed = -1 // 系统失败 )
所有账号绑定状态
const ( Uninsured = 0 // 不保价 Insured = 1 // 保价 )
所有保价状态
const ( CardTypeFront = "Front" // 正面 CardTypeBack = "Back" // 背面 )
所有卡片方向
const ( MsgText MsgType = "text" // 文本消息类型 MsgImg = "image" // 图片消息类型 MsgCard = "miniprogrampage" // 小程序卡片消息类型 MsgEvent = "event" // 事件类型 MsgTrans = "transfer_customer_service" // 转发客服消息 )
所有消息类型
const ( EventQuotaGet EventType = "get_quota" // 查询商户余额 EventCheckBusiness = "check_biz" // 取消订单事件 EventMediaCheckAsync = "wxa_media_check" // 异步校验图片/音频 EventAddExpressOrder = "add_waybill" // 请求下单事件 EventExpressPathUpdate = "add_express_path" // 运单轨迹更新事件 EventExpressOrderCancel = "cancel_waybill" // 审核商户事件 EventUserTempsessionEnter = "user_enter_tempsession" // 用户进入临时会话状态 EventNearbyPoiAuditInfoAdd = "add_nearby_poi_audit_info" // 附近小程序添加地点审核状态通知 EventDeliveryOrderStatusUpdate = "update_waybill_status" // 配送单配送状态更新通知 EventAgentPosQuery = "transport_get_agent_pos" // 查询骑手当前位置信息 EventAuthInfoGet = "get_auth_info" // 使用授权码拉取授权信息 EventAuthAccountCancel = "cancel_auth_account" // 取消授权帐号 EventDeliveryOrderAdd = "transport_add_order" // 真实发起下单任务 EventDeliveryOrderTipsAdd = "transport_add_tips" // 对待接单状态的订单增加小费 EventDeliveryOrderCancel = "transport_cancel_order" // 取消订单操作 EventDeliveryOrderReturnConfirm = "transport_confirm_return_to_biz" // 异常妥投商户收货确认 EventDeliveryOrderPreAdd = "transport_precreate_order" // 预下单 EventDeliveryOrderPreCancel = "transport_precancel_order" // 预取消订单 EventDeliveryOrderQuery = "transport_query_order_status" // 查询订单状态 EventDeliveryOrderReadd = "transport_readd_order" // 下单 EventPreAuthCodeGet = "get_pre_auth_code" // 获取预授权码 EventRiderScoreSet = "transport_set_rider_score" // 给骑手评分 )
所有事件类型
const ( MiniprogramStateDeveloper = "developer" MiniprogramStateTrial = "trial" MiniprogramStateFormal = "formal" )
developer为开发版;trial为体验版;formal为正式版;默认为正式版
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 ¶
This section is empty.
Types ¶
type AICropResponse ¶
type AICropResponse struct { 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 图片智能裁剪后的返回数据
func AICrop ¶
func AICrop(token, filename string) (*AICropResponse, error)
AICrop 本接口提供基于小程序的图片智能裁剪能力。
func AICropByURL ¶
func AICropByURL(token, url string) (*AICropResponse, error)
AICropByURL 本接口提供基于小程序的图片智能裁剪能力。
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 异常件退回商家商家确认器
func (*AbnormalConfirmer) Confirm ¶
func (confirmer *AbnormalConfirmer) Confirm(token string) (*CommonResult, error)
Confirm 异常件退回商家商家确认收货
type AccountList ¶
type AccountList struct { 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 所有绑定的物流账号
func GetAllAccount ¶
func GetAllAccount(token string) (*AccountList, error)
GetAllAccount 获取所有绑定的物流账号 token 接口调用凭证
type AddExpressOrderResult ¶
type AddExpressOrderResult struct { CommonServerResult Token string `json:"Token" xml:"Token"` // 订单 Token。请保存该 Token,调用logistics.updatePath时需要传入 OrderID string `json:"OrderID" xml:"OrderID"` // 唯一标识订单的 ID,由商户生成。快递需要保证相同的 OrderID 生成相同的运单ID。 BizID string `json:"BizID" xml:"BizID"` // 商户 ID,即商户在快递注册的客户编码或月结账户名 BizPwd string `json:"BizPwd" xml:"BizPwd"` // BizID 对应的密码 ShopAppID string `json:"ShopAppID" xml:"ShopAppID"` // 商户的小程序 AppID WayBillID string `json:"WayBillID" xml:"WayBillID"` // 运单 ID,从微信号段中生成。若为 0,则表示需要快递来生成运单 ID。 Remark string `json:"Remark" xml:"Remark"` // 快递备注,会打印到面单上,比如"易碎物品" Sender struct { Name string `json:"Name" xml:"Name"` // 收件人/发件人姓名,不超过64字节 Tel string `json:"Tel" xml:"Tel"` // 收件人/发件人座机号码,若不填写则必须填写 mobile,不超过32字节 Mobile string `json:"Mobile" xml:"Mobile"` // 收件人/发件人手机号码,若不填写则必须填写 tel,不超过32字节 Company string `json:"Company" xml:"Company"` // 收件人/发件人公司名称,不超过64字节 PostCode string `json:"PostCode" xml:"PostCode"` // 收件人/发件人邮编,不超过10字节 Country string `json:"Country" xml:"Country"` // 收件人/发件人国家,不超过64字节 Province string `json:"Province" xml:"Province"` // 收件人/发件人省份,比如:"广东省",不超过64字节 City string `json:"City" xml:"City"` // 收件人/发件人市/地区,比如:"广州市",不超过64字节 Area string `json:"Area" xml:"Area"` // 收件人/发件人区/县,比如:"海珠区",不超过64字节 Address string `json:"Address" xml:"Address"` // 收件人/发件人详细地址,比如:"XX路XX号XX大厦XX",不超过512字节 } `json:"Sender" xml:"Sender"` // 发件人信息 Receiver struct { Name string `json:"Name" xml:"Name"` // 收件人/发件人姓名,不超过64字节 Tel string `json:"Tel" xml:"Tel"` // 收件人/发件人座机号码,若不填写则必须填写 mobile,不超过32字节 Mobile string `json:"Mobile" xml:"Mobile"` // 收件人/发件人手机号码,若不填写则必须填写 tel,不超过32字节 Company string `json:"Company" xml:"Company"` // 收件人/发件人公司名称,不超过64字节 PostCode string `json:"PostCode" xml:"PostCode"` // 收件人/发件人邮编,不超过10字节 Country string `json:"Country" xml:"Country"` // 收件人/发件人国家,不超过64字节 Province string `json:"Province" xml:"Province"` // 收件人/发件人省份,比如:"广东省",不超过64字节 City string `json:"City" xml:"City"` // 收件人/发件人市/地区,比如:"广州市",不超过64字节 Area string `json:"Area" xml:"Area"` // 收件人/发件人区/县,比如:"海珠区",不超过64字节 Address string `json:"Address" xml:"Address"` // 收件人/发件人详细地址,比如:"XX路XX号XX大厦XX",不超过512字节 } `json:"Receiver" xml:"Receiver"` // 收件人信息 Cargo struct { Weight float64 `json:"Weight" xml:"Weight"` // 包裹总重量,单位是千克(kg) SpaceX float64 `json:"Space_X" xml:"Space_X"` // 包裹长度,单位厘米(cm) SpaceY float64 `json:"Space_Y" xml:"Space_Y"` // 包裹宽度,单位厘米(cm) SpaceZ float64 `json:"Space_Z" xml:"Space_Z"` // 包裹高度,单位厘米(cm) Count uint `json:"Count" xml:"Count"` // 包裹数量 } `json:"Cargo" xml:"Cargo"` // 包裹信息 Insured struct { Used InsureStatus `json:"UseInsured" xml:"UseInsured"` // 是否保价,0 表示不保价,1 表示保价 Value uint `json:"InsuredValue" xml:"InsuredValue"` // 保价金额,单位是分,比如: 10000 表示 100 元 } `json:"Insured" xml:"Insured"` // 保价信息 Service struct { Type uint8 `json:"ServiceType" xml:"ServiceType"` // 服务类型 ID Name string `json:"ServiceName" xml:"ServiceName"` // 服务名称 } `json:"Service" xml:"Service"` // 服务类型 }
AddExpressOrderResult 请求下单事件参数
type AddExpressOrderReturn ¶
type AddExpressOrderReturn struct { CommonServerReturn Token string `json:"Token" xml:"Token"` // 传入的 Token,原样返回 OrderID string `json:"OrderID" xml:"OrderID"` // 传入的唯一标识订单的 ID,由商户生成,原样返回 BizID string `json:"BizID" xml:"BizID"` // 商户 ID,原样返回 WayBillID string `json:"WayBillID" xml:"WayBillID"` // 运单 ID WaybillData string `json:"WaybillData" xml:"WaybillData"` // 集包地、三段码、大头笔等信息,用于生成面单信息。详见后文返回值说明 }
AddExpressOrderReturn 请求下单事件需要返回的数据
type AddNearbyPoiResponse ¶
type AddNearbyPoiResponse struct { 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 AddNearbyPoiResult ¶
type AddNearbyPoiResult struct { CommonServerResult AuditID uint `xml:"audit_id"` // 审核单id Status uint8 `xml:"status"` // 审核状态(3:审核通过,2:审核失败) Reason string `xml:"reason"` // 如果status为2,会返回审核失败的原因 PoiID uint `xml:"poi_id"` }
AddNearbyPoiResult 附近小程序添加地点审核状态通知数据
type AddTemplateResponse ¶
type AddTemplateResponse struct { CommonError Pid string `json:"priTmplId"` // 添加至帐号下的模板id,发送小程序订阅消息时所需 }
AddTemplateResponse 添加模版消息返回数据
func AddTemplate ¶
func AddTemplate(token, tid, desc string, keywordIDList []int32) (*AddTemplateResponse, error)
AddTemplate 组合模板并添加至帐号下的个人模板库
token 微信 access_token tid 模板ID desc 服务场景描述,15个字以内 keywordIDList 关键词 ID 列表
type AgentPosQueryResult ¶
type AgentPosQueryResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配,可以是dev_id或者appkey ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 配送单id }
AgentPosQueryResult 服务器携带的参数
type AgentPosQueryReturn ¶
type AgentPosQueryReturn struct { CommonServerReturn Lng float64 `json:"lng" xml:"lng"` // 必填 经度,火星坐标,精确到小数点后6位 Lat float64 `json:"lat" xml:"lat"` // 必填 纬度,火星坐标,精确到小数点后6位 Distance float64 `json:"distance" xml:"distance"` // 必填 和目的地距离,已取货配送中需返回,单位米 ReachTime uint `json:"reach_time" xml:"reach_time"` // 必填 预计还剩多久送达时间, 单位秒, 已取货配送中需返回,比如5分钟后送达,填300 }
AgentPosQueryReturn 需要返回的数据
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 AuthInfoGetResult ¶
type AuthInfoGetResult struct { CommonServerResult WxAppID string `json:"wx_appid" xml:"wx_appid"` // 发起授权的商户小程序appid Code string `json:"code" xml:"code"` // 授权码 }
AuthInfoGetResult 服务器携带的参数
type AuthInfoGetReturn ¶
type AuthInfoGetReturn struct { CommonServerReturn AppKey string `json:"appkey" xml:"appkey"` // 必填 配送公司分配的appkey,对应shopid Account string `json:"account" xml:"account"` // 必填 帐号名称 AccountType uint `json:"account_type" xml:"account_type"` // 必填 帐号类型:0.不确定,1.预充值,2,月结,3,其它 }
AuthInfoGetReturn 需要返回的数据
type BankCardResponse ¶
type BankCardResponse struct { CommonError Number string `json:"number"` // 银行卡号 }
BankCardResponse 识别银行卡返回数据
func BankCard ¶
func BankCard(token, filename string, mode RecognizeMode) (*BankCardResponse, error)
BankCard 通过文件识别银行卡 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。
token 接口调用凭证 img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用传递 img_url。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)
func BankCardByURL ¶
func BankCardByURL(token, cardURL string, mode RecognizeMode) (*BankCardResponse, error)
BankCardByURL 通过URL识别银行卡 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。
token 接口调用凭证 url 要检测的图片 url,传这个则不用传 img 参数。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)
type BusinessLicenseResponse ¶
type BusinessLicenseResponse struct { 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 识别返回数据
func BusinessLicense ¶
func BusinessLicense(token, filename string) (*BusinessLicenseResponse, error)
BusinessLicense 通过文件进行营业执照 OCR 识别
func BusinessLicenseByURL ¶
func BusinessLicenseByURL(token, cardURL string) (*BusinessLicenseResponse, error)
BusinessLicenseByURL 通过链接进行营业执照 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 商户审核结果更新器
func (*BusinessUpdater) Update ¶
func (updater *BusinessUpdater) Update(token string) (*CommonError, error)
Update 更新商户审核结果 token 接口调用凭证
type CSMsgImage ¶
type CSMsgImage struct {
MediaID string `json:"media_id"` // 发送的图片的媒体ID,通过 新增素材接口 上传图片文件获得。
}
CSMsgImage 客服图片消息
func (CSMsgImage) SendTo ¶
func (msg CSMsgImage) SendTo(openID, token string) (*CommonError, error)
SendTo 发送图片消息
openID 用户openID token 微信 access_token
type CSMsgLink ¶
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 接收的卡片消息
func (CSMsgMPCard) SendTo ¶
func (msg CSMsgMPCard) SendTo(openID, token string) (*CommonError, error)
SendTo 发送卡片消息
openID 用户openID token 微信 access_token
type CancelAuthResult ¶
type CancelAuthResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 配送公司唯一标识 WxAppID string `json:"wx_appid" xml:"wx_appid"` // 发起授权的商户小程序appid }
CancelAuthResult 服务器携带的参数
type CancelDeliveryOrderResponse ¶
type CancelDeliveryOrderResponse struct { CommonResult DeductFee float64 `json:"deduct_fee"` // 预计扣除的违约金(单位:元),精确到分 Desc string `json:"desc"` //说明 }
CancelDeliveryOrderResponse 取消配送单返回数据
type CancelExpressOrderResult ¶
type CancelExpressOrderResult struct { CommonServerResult OrderID string `json:"OrderID" xml:"OrderID"` // 唯一标识订单的 ID,由商户生成 BizID string `json:"BizID" xml:"BizID"` // 商户 ID BizPwd string `json:"BizPwd" xml:"BizPwd"` // 商户密码 ShopAppID string `json:"ShopAppID" xml:"ShopAppID"` // 商户的小程序 AppID WayBillID string `json:"WayBillID" xml:"WayBillID"` // 运单 ID,从微信号段中生成 }
CancelExpressOrderResult 取消订单事件参数
type CancelExpressOrderReturn ¶
type CancelExpressOrderReturn struct { CommonServerReturn BizID string `json:"BizID" xml:"BizID"` // 商户ID,请原样返回 OrderID string `json:"OrderID" xml:"OrderID"` // 唯一标识订单的ID,由商户生成。请原样返回 WayBillID string `json:"WayBillID" xml:"WayBillID"` // 运单ID,请原样返回 }
CancelExpressOrderReturn 取消订单事件需要返回的数据
type CancelOrderResponse ¶
type CancelOrderResponse struct { CommonError Count uint `json:"count"` //快递公司数量 Data []struct { DeliveryID string `json:"delivery_id"` // 快递公司 ID DeliveryName string `json:"delivery_name"` // 快递公司名称 } `json:"data"` //快递公司信息列表 }
CancelOrderResponse 取消订单返回数据
type CardMessageResult ¶
type CardMessageResult struct { CommonServerResult MsgID int `json:"MsgId" xml:"MsgId"` // 消息 ID Title string `json:"Title" xml:"Title"` // 标题 AppID string `json:"AppId" xml:"AppId"` // 小程序 appid PagePath string `json:"PagePath" xml:"PagePath"` // 小程序页面路径 ThumbURL string `json:"ThumbUrl" xml:"ThumbUrl"` // 封面图片的临时cdn链接 ThumbMediaID string `json:"ThumbMediaId" xml:"ThumbMediaId"` // 封面图片的临时素材id }
CardMessageResult 接收的卡片消息
type CardResponse ¶
type CardResponse struct { CommonError Type CardType `json:"type"` // 正面或背面,Front / Back ValidDate string `json:"valid_date"` // 有效期 }
CardResponse 识别卡片返回数据
type CargoDetail ¶
type CargoDetail struct { Name string `json:"name"` // 商品名,不超过128字节 Count uint `json:"count"` // 商品数量 }
CargoDetail 包裹详情
type CheckExpressBusinessResult ¶
type CheckExpressBusinessResult struct { CommonServerResult BizID string `json:"BizID" xml:"BizID"` // 商户ID,即商户在快递注册的客户编码或月结账户名 BizPwd string `json:"BizPwd" xml:"BizPwd"` // BizID 对应的密码 ShopAppID string `json:"ShopAppID" xml:"ShopAppID"` // 商户的小程序 AppID ShopName string `json:"ShopName" xml:"ShopName"` // 商户名称,即小程序昵称(仅EMS可用) ShopTelphone string `json:"ShopTelphone" xml:"ShopTelphone"` // 商户联系电话(仅EMS可用) ShopContact string `json:"ShopContact" xml:"ShopContact"` // 商户联系人姓名(仅EMS可用) ServiceName string `json:"ServiceName" xml:"ServiceName"` // 预开通的服务类型名称(仅EMS可用) SenderAddress string `json:"SenderAddress" xml:"SenderAddress"` // 商户发货地址(仅EMS可用) }
CheckExpressBusinessResult 审核商户事件参数
type CheckExpressBusinessReturn ¶
type CheckExpressBusinessReturn struct { CommonServerReturn BizID string `json:"BizID" xml:"BizID"` // 商户ID Quota float64 `json:"Quota" xml:"Quota"` // 商户可用余额,0 表示无可用余额 }
CheckExpressBusinessReturn 审核商户事件需要需要返回的数据
type CheckMediaResponse ¶
type CheckMediaResponse struct { CommonError TraceID string `json:"trace_id"` }
CheckMediaResponse 异步校验图片/音频返回数据
func MediaCheckAsync ¶
func MediaCheckAsync(token, mediaURL string, mediaType MediaType) (*CheckMediaResponse, error)
MediaCheckAsync 异步校验图片/音频是否含有违法违规内容。
mediaURL 要检测的多媒体url mediaType 接口调用凭证(access_token)
type CommonError ¶
type CommonError struct { ErrCode int `json:"errcode"` // 错误码 ErrMSG string `json:"errmsg"` // 错误描述 }
CommonError 微信返回错误信息
func ApplyPlugin ¶
func ApplyPlugin(token, appID, reason string) (*CommonError, error)
ApplyPlugin 向插件开发者发起使用插件的申请 accessToken 接口调用凭证 action string 是 此接口下填写 "apply" appID string 是 插件 appId reason string 否 申请使用理由
func DeleteNearbyPoi ¶
func DeleteNearbyPoi(token, id string) (*CommonError, error)
DeleteNearbyPoi 删除地点 token 接口调用凭证 id 附近地点 ID
func DeleteTemplate ¶
func DeleteTemplate(token, pid string) (*CommonError, error)
DeleteTemplate 删除帐号下的某个模板
token 微信 access_token pid 模板ID
func GetTempMedia ¶
func GetTempMedia(token, mediaID string) (*http.Response, *CommonError, error)
GetTempMedia 获取客服消息内的临时素材。即下载临时的多媒体文件。目前小程序仅支持下载图片文件。
token 接口调用凭证 mediaID 媒体文件 ID
func IMGSecCheck ¶
func IMGSecCheck(token, filename string) (*CommonError, error)
IMGSecCheck 本地图片检测 官方文档: https://developers.weixin.qq.com/miniprogram/dev/api/imgSecCheck.html
filename 要检测的图片本地路径 token 接口调用凭证(access_token)
func MSGSecCheck ¶
func MSGSecCheck(token, content string) (*CommonError, error)
MSGSecCheck 文本检测 官方文档: https://developers.weixin.qq.com/miniprogram/dev/api/msgSecCheck.html
content 要检测的文本内容,长度不超过 500KB,编码格式为utf-8 token 接口调用凭证(access_token)
func SetDevPluginApplyStatus ¶
func SetDevPluginApplyStatus(token, appID, reason string, action DevAction) (*CommonError, error)
SetDevPluginApplyStatus 修改插件使用申请的状态 accessToken 接口调用凭证 appID 使用者的 appid。同意申请时填写。 reason 拒绝理由。拒绝申请时填写。 action 修改操作
func SetNearbyPoiShowStatus ¶
func SetNearbyPoiShowStatus(token, poiID string, status NearbyPoiShowStatus) (*CommonError, error)
SetNearbyPoiShowStatus 展示/取消展示附近小程序 token 接口调用凭证 poiID 附近地点 ID status 是否展示
func SetTyping ¶
func SetTyping(token, openID string, cmd SetTypingCommand) (*CommonError, error)
SetTyping 下发客服当前输入状态给用户。
token 接口调用凭证 openID 用户的 OpenID cmd 命令
func UnbindPlugin ¶
func UnbindPlugin(token, appID string) (*CommonError, error)
UnbindPlugin 查询已添加的插件 accessToken 接口调用凭证 appID 插件 appId
func (*CommonError) GetResponseError ¶
func (err *CommonError) GetResponseError() error
GetResponseError 获取微信服务器错返回误信息
type CommonResult ¶
type CommonResult struct { ResultCode int `json:"resultcode"` // 错误码 ResultMsg string `json:"resultmsg"` // 错误描述 }
CommonResult 微信返回错误信息
func (*CommonResult) GetResponseError ¶
func (err *CommonResult) GetResponseError() error
GetResponseError 获取微信服务器错返回误信息
type CommonServerResult ¶
type CommonServerResult struct { XMLName xml.Name `xml:"xml" json:"-"` ToUserName string `json:"ToUserName" xml:"ToUserName"` // 小程序的原始ID FromUserName string `json:"FromUserName" xml:"FromUserName"` // 发送者的 openID | 平台推送服务UserName CreateTime uint `json:"CreateTime" xml:"CreateTime"` // 消息创建时间(整型) MsgType MsgType `json:"MsgType" xml:"MsgType"` // 消息类型 Event EventType `json:"Event" xml:"Event"` // 事件类型 }
CommonServerResult 基础通知数据
type CommonServerReturn ¶
type CommonServerReturn struct { ToUserName string `json:"ToUserName" xml:"ToUserName"` // 是 原样返回请求中的 FromUserName FromUserName string `json:"FromUserName" xml:"FromUserName"` // 是 快递公司小程序 UserName CreateTime uint `json:"CreateTime" xml:"CreateTime"` // 是 事件时间,Unix时间戳 MsgType string `json:"MsgType" xml:"MsgType"` // 是 消息类型,固定为 event Event string `json:"Event" xml:"Event"` // 是 事件类型,固定为 transport_add_order,不区分大小写 ResultCode int `json:"resultcode" xml:"resultcode"` // 是 错误码 ResultMsg string `json:"resultmsg" xml:"resultmsg"` // 是 错误描述 }
CommonServerReturn 没收到通知后返回的基础数据
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 { CommonError ActivityID string `json:"activity_id"` // 动态消息的 ID ExpirationTime uint `json:"expiration_time"` // activity_id 的过期时间戳。默认24小时后过期。 }
CreateActivityIDResponse 动态消息
func CreateActivityID ¶
func CreateActivityID(token string) (*CreateActivityIDResponse, error)
CreateActivityID 创建被分享动态消息的 activity_id。 token 接口调用凭证
type CreateDeliveryOrderResponse ¶
type CreateDeliveryOrderResponse struct { 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 { 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 DailySummary ¶
type DailySummary struct { CommonError List []Summary `json:"list"` }
DailySummary 用户访问小程序数据概况
func GetDailySummary ¶
func GetDailySummary(accessToken, begin, end string) (*DailySummary, error)
GetDailySummary 获取用户访问小程序数据概况 begin 开始日期。格式为 yyyymmdd end 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd
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 { CommonError Count uint `json:"count"` // 快递公司数量 Data []struct { ID string `json:"delivery_id"` // 快递公司 ID Name string `json:"delivery_name"` // 快递公司名称 } `json:"data"` // 快递公司信息列表 }
DeliveryList 支持的快递公司列表
func GetAllDelivery ¶
func GetAllDelivery(token string) (*DeliveryList, error)
GetAllDelivery 获取支持的快递公司列表 token 接口调用凭证
type DeliveryOrderAddResult ¶
type DeliveryOrderAddResult struct { CommonServerResult WxToken string `json:"wx_token" xml:"wx_token"` // 微信订单 Token。请保存该Token,调用更新配送单状态接口(updateOrder)时需要传入 DeliveryToken string `json:"delivery_token" xml:"delivery_token"` // 配送公司侧在预下单时候返回的token,用于保证运费不变 ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配的appkey ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 DeliverySign string `json:"delivery_sign" xml:"delivery_sign"` // 用配送公司侧提供的appSecret加密的校验串 Sender struct { Name string `json:"name" xml:"name"` // 姓名,最长不超过256个字符 City string `json:"city" xml:"city"` // 城市名称,如广州市 Address string `json:"address" xml:"address"` // 地址(街道、小区、大厦等,用于定位) AddressDetail string `json:"address_detail" xml:"address_detail"` // 地址详情(楼号、单元号、层号) Phone string `json:"phone" xml:"phone"` // 电话/手机号,最长不超过64个字符 Lng float64 `json:"lng" xml:"lng"` // 经度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,确到小数点后6位 Lat float64 `json:"lat" xml:"lat"` // 纬度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,精确到小数点后6位) CoordinateType uint8 `json:"coordinate_type" xml:"coordinate_type"` // 坐标类型,0:火星坐标(高德,腾讯地图均采用火星坐标) 1:百度坐标 } `json:"sender" xml:"sender"` // 发件人信息,如果配送公司能从shopid+shop_no对应到门店地址,则不需要填写,否则需填写 Receiver struct { Name string `json:"name" xml:"name"` // 姓名,最长不超过256个字符 City string `json:"city" xml:"city"` // 城市名称,如广州市 Address string `json:"address" xml:"address"` // 地址(街道、小区、大厦等,用于定位) AddressDetail string `json:"address_detail" xml:"address_detail"` // 地址详情(楼号、单元号、层号) Phone string `json:"phone" xml:"phone"` // 电话/手机号,最长不超过64个字符 Lng float64 `json:"lng" xml:"lng"` // 经度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,确到小数点后6位 Lat float64 `json:"lat" xml:"lat"` // 纬度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,精确到小数点后6位) CoordinateType uint8 `json:"coordinate_type" xml:"coordinate_type"` // 坐标类型,0:火星坐标(高德,腾讯地图均采用火星坐标) 1:百度坐标 } `json:"receiver" xml:"receiver"` // 收件人信息 Cargo struct { GoodsValue float64 `json:"goods_value" xml:"goods_value"` // 货物价格,单位为元,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-5000] GoodsHeight float64 `json:"goods_height" xml:"goods_height"` // 货物高度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-45] GoodsLength float64 `json:"goods_length" xml:"goods_length"` // 货物长度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-65] GoodsWidth float64 `json:"goods_width" xml:"goods_width"` // 货物宽度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-50] GoodsWeight float64 `json:"goods_weight" xml:"goods_weight"` // 货物重量,单位为kg,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-50] GoodsDetail struct { Goods []struct { Count uint `json:"good_count" xml:"good_count"` // 货物数量 Name string `json:"good_name" xml:"good_name"` // 货品名称 Price float64 `json:"good_price" xml:"good_price"` // 货品单价,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数) Unit string `json:"good_unit" xml:"good_unit"` // 货品单位,最长不超过20个字符 } `json:"goods" xml:"goods"` // 货物列表 } `json:"goods_detail" xml:"goods_detail"` // 货物详情,最长不超过10240个字符 GoodsPickupInfo string `json:"goods_pickup_info" xml:"goods_pickup_info"` // 货物取货信息,用于骑手到店取货,最长不超过100个字符 GoodsDeliveryInfo string `json:"goods_delivery_info" xml:"goods_delivery_info"` // 货物交付信息,最长不超过100个字符 CargoFirstClass string `json:"cargo_first_class" xml:"cargo_first_class"` // 品类一级类目 CargoSecondClass string `json:"cargo_second_class" xml:"cargo_second_class"` // 品类二级类目 } `json:"cargo" xml:"cargo"` // 货物信息 OrderInfo struct { DeliveryServiceCode string `json:"delivery_service_code" xml:"delivery_service_code"` // 配送服务代码 不同配送公司自定义,微信侧不理解 OrderType uint8 `json:"order_type" xml:"order_type"` // 订单类型, 0: 即时单 1 预约单,如预约单,需要设置expected_delivery_time或expected_finish_time或expected_pick_time ExpectedDeliveryTime uint `json:"expected_delivery_time" xml:"expected_delivery_time"` // 期望派单时间(达达支持,表示达达系统调度时间),unix-timestamp ExpectedFinishTime uint `json:"expected_finish_time" xml:"expected_finish_time"` // 期望送达时间(美团、顺丰同城急送支持),unix-timestamp) ExpectedPickTime uint `json:"expected_pick_time" xml:"expected_pick_time"` // 期望取件时间(闪送、顺丰同城急送支持,顺丰同城急送只需传expected_finish_time或expected_pick_time其中之一即可,同时都传则以expected_finish_time为准),unix-timestamp PoiSeq string `json:"poi_seq" xml:"poi_seq"` // 门店订单流水号,建议提供,方便骑手门店取货,最长不超过32个字符 Note string `json:"note" xml:"note"` // 备注,最长不超过200个字符 OrderTime uint `json:"order_time" xml:"order_time"` // 用户下单付款时间 IsInsured uint8 `json:"is_insured" xml:"is_insured"` // 是否保价,0,非保价,1.保价 DeclaredValue float64 `json:"declared_value" xml:"declared_value"` // 保价金额,单位为元,精确到分 Tips float64 `json:"tips" xml:"tips"` // 小费,单位为元, 下单一般不加小费 IsDirectDelivery float64 `json:"is_direct_delivery" xml:"is_direct_delivery"` // 是否选择直拿直送(0:不需要;1:需要。选择直拿直送后,同一时间骑手只能配送此订单至完成,配送费用也相应高一些,闪送必须选1,达达可选0或1,其余配送公司不支持直拿直送) CashOnDelivery float64 `json:"cash_on_delivery" xml:"cash_on_delivery"` // 骑手应付金额,单位为元,精确到分 CashOnPickup float64 `json:"cash_on_pickup" xml:"cash_on_pickup"` // 骑手应收金额,单位为元,精确到分 RiderPickMethod uint8 `json:"rider_pick_method" xml:"rider_pick_method"` // 物流流向,1:从门店取件送至用户;2:从用户取件送至门店 IsFinishCodeNeeded uint8 `json:"is_finish_code_needed" xml:"is_finish_code_needed"` // 收货码(0:不需要;1:需要。收货码的作用是:骑手必须输入收货码才能完成订单妥投) IsPickupCodeNeeded uint8 `json:"is_pickup_code_needed" xml:"is_pickup_code_needed"` // 取货码(0:不需要;1:需要。取货码的作用是:骑手必须输入取货码才能从商家取货) } `json:"order_info" xml:"order_info"` // 订单信息 }
DeliveryOrderAddResult 服务器携带的参数
type DeliveryOrderAddReturn ¶
type DeliveryOrderAddReturn struct { CommonServerReturn Event string `json:"Event" xml:"Event"` // 是 事件类型,固定为 transport_add_order,不区分大小写 Fee uint `json:"fee" xml:"fee"` // 是 实际运费(单位:元),运费减去优惠券费用 Deliverfee uint `json:"deliverfee" xml:"deliverfee"` // 是 运费(单位:元) Couponfee uint `json:"couponfee" xml:"couponfee"` // 是 优惠券费用(单位:元) Tips uint `json:"tips" xml:"tips"` // 是 小费(单位:元) Insurancefee uint `json:"insurancefee" xml:"insurancefee"` // 是 保价费(单位:元) Distance float64 `json:"distance,omitempty" xml:"distance,omitempty"` // 否 配送距离(单位:米) WaybillID string `json:"waybill_id,omitempty" xml:"waybill_id,omitempty"` // 否 配送单号, 可以在API1更新配送单状态异步返回 OrderStatus int `json:"order_status" xml:"order_status"` // 是 配送单状态 FinishCode uint `json:"finish_code,omitempty" xml:"finish_code,omitempty"` // 否 收货码 PickupCode uint `json:"pickup_code,omitempty" xml:"pickup_code,omitempty"` // 否 取货码 DispatchDuration uint `json:"dispatch_duration,omitempty" xml:"dispatch_duration,omitempty"` // 否 预计骑手接单时间,单位秒,比如5分钟,就填300, 无法预计填0 SenderLng float64 `json:"sender_lng,omitempty" xml:"sender_lng,omitempty"` // 否 发货方经度,火星坐标,精确到小数点后6位, 用于消息通知,如果下单请求里有发货人信息则不需要 SenderLat float64 `json:"sender_lat,omitempty" xml:"sender_lat,omitempty"` // 否 发货方纬度,火星坐标,精确到小数点后6位, 用于消息通知,如果下单请求里有发货人信息则不需要 }
DeliveryOrderAddReturn 需要返回的数据
type DeliveryOrderAddTipsResult ¶
type DeliveryOrderAddTipsResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配,可以是dev_id或者appkey ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 配送单id DeliverySign string `json:"delivery_sign" xml:"delivery_sign"` // 用配送公司侧提供的appSecret加密的校验串 Tips float64 `json:"tips" xml:"tips"` // 小费金额(单位:元) Remark string `json:"remark" xml:"remark"` // 备注 }
DeliveryOrderAddTipsResult 服务器携带的参数
type DeliveryOrderAddTipsReturn ¶
type DeliveryOrderAddTipsReturn CommonServerReturn
DeliveryOrderAddTipsReturn 需要返回的数据
type DeliveryOrderCancelResult ¶
type DeliveryOrderCancelResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配,可以是dev_id或者appkey ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 配送单id DeliverySign string `json:"delivery_sign" xml:"delivery_sign"` // 用配送公司侧提供的appSecret加密的校验串 CancelReasonID uint `json:"cancel_reason_id" xml:"cancel_reason_id"` // 取消原因id CancelReason string `json:"cancel_reason" xml:"cancel_reason"` // 取消原因 }
DeliveryOrderCancelResult 服务器携带的参数
type DeliveryOrderCancelReturn ¶
type DeliveryOrderCancelReturn struct { CommonServerReturn DeductFee uint `json:"deduct_fee" xml:"deduct_fee"` // 是 预计扣除的违约金(单位:元),可能没有 Desc string `json:"desc" xml:"desc"` // 是 扣费说明 }
DeliveryOrderCancelReturn 需要返回的数据
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 取消配送单参数
func (*DeliveryOrderCanceler) Cancel ¶
func (canceler *DeliveryOrderCanceler) Cancel(token string) (*CancelDeliveryOrderResponse, error)
Cancel 取消配送单
func (*DeliveryOrderCanceler) Prepare ¶
func (canceler *DeliveryOrderCanceler) Prepare(token string) (*CancelDeliveryOrderResponse, error)
Prepare 预取消配送单
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 下配送单参数
func (*DeliveryOrderCreator) Create ¶
func (creator *DeliveryOrderCreator) Create(token string) (*CreateDeliveryOrderResponse, error)
Create 下配送单
func (*DeliveryOrderCreator) Prepare ¶
func (creator *DeliveryOrderCreator) Prepare(token string) (*PreDeliveryOrderResponse, error)
Prepare 预下配送单接口
func (*DeliveryOrderCreator) Recreate ¶
func (creator *DeliveryOrderCreator) Recreate(token string) (*CreateDeliveryOrderResponse, error)
Recreate 重新下单
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 请求参数
func (*DeliveryOrderGetter) Get ¶
func (getter *DeliveryOrderGetter) Get(token string) (*GetDeliveryOrderResponse, error)
Get 下配送单
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 DeliveryOrderPreAddResult ¶
type DeliveryOrderPreAddResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配的appkey ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 DeliverySign string `json:"delivery_sign" xml:"delivery_sign"` // 用配送公司侧提供的appSecret加密的校验串 Sender struct { Name string `json:"name" xml:"name"` // 姓名,最长不超过256个字符 City string `json:"city" xml:"city"` // 城市名称,如广州市 Address string `json:"address" xml:"address"` // 地址(街道、小区、大厦等,用于定位) AddressDetail string `json:"address_detail" xml:"address_detail"` // 地址详情(楼号、单元号、层号) Phone string `json:"phone" xml:"phone"` // 电话/手机号,最长不超过64个字符 Lng float64 `json:"lng" xml:"lng"` // 经度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,确到小数点后6位 Lat float64 `json:"lat" xml:"lat"` // 纬度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,精确到小数点后6位) CoordinateType uint8 `json:"coordinate_type" xml:"coordinate_type"` // 坐标类型,0:火星坐标(高德,腾讯地图均采用火星坐标) 1:百度坐标 } `json:"sender" xml:"sender"` // 发件人信息,如果配送公司能从shopid+shop_no对应到门店地址,则不需要填写,否则需填写 Receiver struct { Name string `json:"name" xml:"name"` // 姓名,最长不超过256个字符 City string `json:"city" xml:"city"` // 城市名称,如广州市 Address string `json:"address" xml:"address"` // 地址(街道、小区、大厦等,用于定位) AddressDetail string `json:"address_detail" xml:"address_detail"` // 地址详情(楼号、单元号、层号) Phone string `json:"phone" xml:"phone"` // 电话/手机号,最长不超过64个字符 Lng float64 `json:"lng" xml:"lng"` // 经度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,确到小数点后6位 Lat float64 `json:"lat" xml:"lat"` // 纬度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,精确到小数点后6位) CoordinateType uint8 `json:"coordinate_type" xml:"coordinate_type"` // 坐标类型,0:火星坐标(高德,腾讯地图均采用火星坐标) 1:百度坐标 } `json:"receiver" xml:"receiver"` // 收件人信息 Cargo struct { GoodsValue float64 `json:"goods_value" xml:"goods_value"` // 货物价格,单位为元,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-5000] GoodsHeight float64 `json:"goods_height" xml:"goods_height"` // 货物高度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-45] GoodsLength float64 `json:"goods_length" xml:"goods_length"` // 货物长度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-65] GoodsWidth float64 `json:"goods_width" xml:"goods_width"` // 货物宽度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-50] GoodsWeight float64 `json:"goods_weight" xml:"goods_weight"` // 货物重量,单位为kg,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-50] GoodsDetail struct { Goods []struct { Count uint `json:"good_count" xml:"good_count"` // 货物数量 Name string `json:"good_name" xml:"good_name"` // 货品名称 Price float64 `json:"good_price" xml:"good_price"` // 货品单价,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数) Unit string `json:"good_unit" xml:"good_unit"` // 货品单位,最长不超过20个字符 } `json:"goods" xml:"goods"` // 货物列表 } `json:"goods_detail" xml:"goods_detail"` // 货物详情,最长不超过10240个字符 GoodsPickupInfo string `json:"goods_pickup_info" xml:"goods_pickup_info"` // 货物取货信息,用于骑手到店取货,最长不超过100个字符 GoodsDeliveryInfo string `json:"goods_delivery_info" xml:"goods_delivery_info"` // 货物交付信息,最长不超过100个字符 CargoFirstClass string `json:"cargo_first_class" xml:"cargo_first_class"` // 品类一级类目 CargoSecondClass string `json:"cargo_second_class" xml:"cargo_second_class"` // 品类二级类目 } `json:"cargo" xml:"cargo"` // 货物信息 OrderInfo struct { DeliveryServiceCode string `json:"delivery_service_code" xml:"delivery_service_code"` // 配送服务代码 不同配送公司自定义,微信侧不理解 OrderType uint8 `json:"order_type" xml:"order_type"` // 订单类型, 0: 即时单 1 预约单,如预约单,需要设置expected_delivery_time或expected_finish_time或expected_pick_time ExpectedDeliveryTime uint `json:"expected_delivery_time" xml:"expected_delivery_time"` // 期望派单时间(达达支持,表示达达系统调度时间),unix-timestamp ExpectedFinishTime uint `json:"expected_finish_time" xml:"expected_finish_time"` // 期望送达时间(美团、顺丰同城急送支持),unix-timestamp) ExpectedPickTime uint `json:"expected_pick_time" xml:"expected_pick_time"` // 期望取件时间(闪送、顺丰同城急送支持,顺丰同城急送只需传expected_finish_time或expected_pick_time其中之一即可,同时都传则以expected_finish_time为准),unix-timestamp PoiSeq string `json:"poi_seq" xml:"poi_seq"` // 门店订单流水号,建议提供,方便骑手门店取货,最长不超过32个字符 Note string `json:"note" xml:"note"` // 备注,最长不超过200个字符 OrderTime uint `json:"order_time" xml:"order_time"` // 用户下单付款时间 IsInsured uint8 `json:"is_insured" xml:"is_insured"` // 是否保价,0,非保价,1.保价 DeclaredValue float64 `json:"declared_value" xml:"declared_value"` // 保价金额,单位为元,精确到分 Tips float64 `json:"tips" xml:"tips"` // 小费,单位为元, 下单一般不加小费 IsDirectDelivery float64 `json:"is_direct_delivery" xml:"is_direct_delivery"` // 是否选择直拿直送(0:不需要;1:需要。选择直拿直送后,同一时间骑手只能配送此订单至完成,配送费用也相应高一些,闪送必须选1,达达可选0或1,其余配送公司不支持直拿直送) CashOnDelivery float64 `json:"cash_on_delivery" xml:"cash_on_delivery"` // 骑手应付金额,单位为元,精确到分 CashOnPickup float64 `json:"cash_on_pickup" xml:"cash_on_pickup"` // 骑手应收金额,单位为元,精确到分 RiderPickMethod uint8 `json:"rider_pick_method" xml:"rider_pick_method"` // 物流流向,1:从门店取件送至用户;2:从用户取件送至门店 IsFinishCodeNeeded uint8 `json:"is_finish_code_needed" xml:"is_finish_code_needed"` // 收货码(0:不需要;1:需要。收货码的作用是:骑手必须输入收货码才能完成订单妥投) IsPickupCodeNeeded uint8 `json:"is_pickup_code_needed" xml:"is_pickup_code_needed"` // 取货码(0:不需要;1:需要。取货码的作用是:骑手必须输入取货码才能从商家取货) } `json:"order_info" xml:"order_info"` // 订单信息 }
DeliveryOrderPreAddResult 服务器携带的参数
type DeliveryOrderPreAddReturn ¶
type DeliveryOrderPreAddReturn struct { CommonServerReturn Fee uint `json:"fee" xml:"fee"` // 是 实际运费(单位:元),运费减去优惠券费用 Deliverfee uint `json:"deliverfee" xml:"deliverfee"` // 是 运费(单位:元) Couponfee uint `json:"couponfee" xml:"couponfee"` // 是 优惠券费用(单位:元) Tips float64 `json:"tips" xml:"tips"` // 是 小费(单位:元) Insurancefee uint `json:"insurancefee" xml:"insurancefee"` // 是 保价费(单位:元) Distance uint `json:"distance" xml:"distance"` // 否 配送距离(单位:米) DispatchDuration uint `json:"dispatch_duration" xml:"dispatch_duration"` // 否 预计骑手接单时间,单位秒,比如5分钟,就填300, 无法预计填0 DeliveryToken string `json:"delivery_token" xml:"delivery_token"` // 否 配送公司可以返回此字段,当用户下单时候带上这个字段,配送公司可保证在一段时间内运费不变 }
DeliveryOrderPreAddReturn 需要返回的数据
type DeliveryOrderPreCancelResult ¶
type DeliveryOrderPreCancelResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配,可以是dev_id或者appkey ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 配送单id DeliverySign string `json:"delivery_sign" xml:"delivery_sign"` // 用配送公司侧提供的appSecret加密的校验串 CancelReasonID uint `json:"cancel_reason_id" xml:"cancel_reason_id"` // 取消原因id CancelReason string `json:"cancel_reason" xml:"cancel_reason"` // 取消原因 }
DeliveryOrderPreCancelResult 服务器携带的参数
type DeliveryOrderPreCancelReturn ¶
type DeliveryOrderPreCancelReturn struct { CommonServerReturn DeductFee uint `json:"deduct_fee" xml:"deduct_fee"` // 是 预计扣除的违约金(单位:元),可能没有 Desc string `json:"desc" xml:"desc"` // 是 扣费说明 }
DeliveryOrderPreCancelReturn 需要返回的数据
type DeliveryOrderQueryResult ¶
type DeliveryOrderQueryResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配,可以是dev_id或者appkey ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 配送单id DeliverySign string `json:"delivery_sign" xml:"delivery_sign"` // 用配送公司侧提供的appSecret加密的校验串 }
DeliveryOrderQueryResult 服务器携带的参数
type DeliveryOrderQueryReturn ¶
type DeliveryOrderQueryReturn struct { CommonServerReturn OrderStatus float64 `json:"order_status" xml:"order_status"` // 是 当前订单状态,枚举值 ActionMsg string `json:"action_msg" xml:"action_msg"` // 否 附加信息 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 是 配送单id }
DeliveryOrderQueryReturn 需要返回的数据
type DeliveryOrderReaddResult ¶
type DeliveryOrderReaddResult struct { CommonServerResult WxToken string `json:"wx_token" xml:"wx_token"` // 微信订单 Token。请保存该Token,调用更新配送单状态接口(updateOrder)时需要传入 DeliveryToken string `json:"delivery_token" xml:"delivery_token"` // 配送公司侧在预下单时候返回的token,用于保证运费不变 ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配的appkey ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 DeliverySign string `json:"delivery_sign" xml:"delivery_sign"` // 用配送公司侧提供的appSecret加密的校验串 Sender struct { Name string `json:"name" xml:"name"` // 姓名,最长不超过256个字符 City string `json:"city" xml:"city"` // 城市名称,如广州市 Address string `json:"address" xml:"address"` // 地址(街道、小区、大厦等,用于定位) AddressDetail string `json:"address_detail" xml:"address_detail"` // 地址详情(楼号、单元号、层号) Phone string `json:"phone" xml:"phone"` // 电话/手机号,最长不超过64个字符 Lng float64 `json:"lng" xml:"lng"` // 经度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,确到小数点后6位 Lat float64 `json:"lat" xml:"lat"` // 纬度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,精确到小数点后6位) CoordinateType uint8 `json:"coordinate_type" xml:"coordinate_type"` // 坐标类型,0:火星坐标(高德,腾讯地图均采用火星坐标) 1:百度坐标 } `json:"sender" xml:"sender"` // 发件人信息,如果配送公司能从shopid+shop_no对应到门店地址,则不需要填写,否则需填写 Receiver struct { Name string `json:"name" xml:"name"` // 姓名,最长不超过256个字符 City string `json:"city" xml:"city"` // 城市名称,如广州市 Address string `json:"address" xml:"address"` // 地址(街道、小区、大厦等,用于定位) AddressDetail string `json:"address_detail" xml:"address_detail"` // 地址详情(楼号、单元号、层号) Phone string `json:"phone" xml:"phone"` // 电话/手机号,最长不超过64个字符 Lng float64 `json:"lng" xml:"lng"` // 经度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,确到小数点后6位 Lat float64 `json:"lat" xml:"lat"` // 纬度(火星坐标或百度坐标,和 coordinate_type 字段配合使用,精确到小数点后6位) CoordinateType uint8 `json:"coordinate_type" xml:"coordinate_type"` // 坐标类型,0:火星坐标(高德,腾讯地图均采用火星坐标) 1:百度坐标 } `json:"receiver" xml:"receiver"` // 收件人信息 Cargo struct { GoodsValue float64 `json:"goods_value" xml:"goods_value"` // 货物价格,单位为元,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-5000] GoodsHeight float64 `json:"goods_height" xml:"goods_height"` // 货物高度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-45] GoodsLength float64 `json:"goods_length" xml:"goods_length"` // 货物长度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-65] GoodsWidth float64 `json:"goods_width" xml:"goods_width"` // 货物宽度,单位为cm,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-50] GoodsWeight float64 `json:"goods_weight" xml:"goods_weight"` // 货物重量,单位为kg,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数),范围为(0-50] GoodsDetail struct { Goods []struct { Count uint `json:"good_count" xml:"good_count"` // 货物数量 Name string `json:"good_name" xml:"good_name"` // 货品名称 Price float64 `json:"good_price" xml:"good_price"` // 货品单价,精确到小数点后两位(如果小数点后位数多于两位,则四舍五入保留两位小数) Unit string `json:"good_unit" xml:"good_unit"` // 货品单位,最长不超过20个字符 } `json:"goods" xml:"goods"` // 货物列表 } `json:"goods_detail" xml:"goods_detail"` // 货物详情,最长不超过10240个字符 GoodsPickupInfo string `json:"goods_pickup_info" xml:"goods_pickup_info"` // 货物取货信息,用于骑手到店取货,最长不超过100个字符 GoodsDeliveryInfo string `json:"goods_delivery_info" xml:"goods_delivery_info"` // 货物交付信息,最长不超过100个字符 CargoFirstClass string `json:"cargo_first_class" xml:"cargo_first_class"` // 品类一级类目 CargoSecondClass string `json:"cargo_second_class" xml:"cargo_second_class"` // 品类二级类目 } `json:"cargo" xml:"cargo"` // 货物信息 OrderInfo struct { DeliveryServiceCode string `json:"delivery_service_code" xml:"delivery_service_code"` // 配送服务代码 不同配送公司自定义,微信侧不理解 OrderType uint8 `json:"order_type" xml:"order_type"` // 订单类型, 0: 即时单 1 预约单,如预约单,需要设置expected_delivery_time或expected_finish_time或expected_pick_time ExpectedDeliveryTime uint `json:"expected_delivery_time" xml:"expected_delivery_time"` // 期望派单时间(达达支持,表示达达系统调度时间),unix-timestamp ExpectedFinishTime uint `json:"expected_finish_time" xml:"expected_finish_time"` // 期望送达时间(美团、顺丰同城急送支持),unix-timestamp) ExpectedPickTime uint `json:"expected_pick_time" xml:"expected_pick_time"` // 期望取件时间(闪送、顺丰同城急送支持,顺丰同城急送只需传expected_finish_time或expected_pick_time其中之一即可,同时都传则以expected_finish_time为准),unix-timestamp PoiSeq string `json:"poi_seq" xml:"poi_seq"` // 门店订单流水号,建议提供,方便骑手门店取货,最长不超过32个字符 Note string `json:"note" xml:"note"` // 备注,最长不超过200个字符 OrderTime uint `json:"order_time" xml:"order_time"` // 用户下单付款时间 IsInsured uint8 `json:"is_insured" xml:"is_insured"` // 是否保价,0,非保价,1.保价 DeclaredValue float64 `json:"declared_value" xml:"declared_value"` // 保价金额,单位为元,精确到分 Tips float64 `json:"tips" xml:"tips"` // 小费,单位为元, 下单一般不加小费 IsDirectDelivery float64 `json:"is_direct_delivery" xml:"is_direct_delivery"` // 是否选择直拿直送(0:不需要;1:需要。选择直拿直送后,同一时间骑手只能配送此订单至完成,配送费用也相应高一些,闪送必须选1,达达可选0或1,其余配送公司不支持直拿直送) CashOnDelivery float64 `json:"cash_on_delivery" xml:"cash_on_delivery"` // 骑手应付金额,单位为元,精确到分 CashOnPickup float64 `json:"cash_on_pickup" xml:"cash_on_pickup"` // 骑手应收金额,单位为元,精确到分 RiderPickMethod uint8 `json:"rider_pick_method" xml:"rider_pick_method"` // 物流流向,1:从门店取件送至用户;2:从用户取件送至门店 IsFinishCodeNeeded uint8 `json:"is_finish_code_needed" xml:"is_finish_code_needed"` // 收货码(0:不需要;1:需要。收货码的作用是:骑手必须输入收货码才能完成订单妥投) IsPickupCodeNeeded uint8 `json:"is_pickup_code_needed" xml:"is_pickup_code_needed"` // 取货码(0:不需要;1:需要。取货码的作用是:骑手必须输入取货码才能从商家取货) } `json:"order_info" xml:"order_info"` // 订单信息 }
DeliveryOrderReaddResult 服务器携带的参数
type DeliveryOrderReaddReturn ¶
type DeliveryOrderReaddReturn struct { CommonServerReturn Fee uint `json:"fee" xml:"fee"` // 是 实际运费(单位:元),运费减去优惠券费用 Deliverfee uint `json:"deliverfee" xml:"deliverfee"` // 是 运费(单位:元) Couponfee uint `json:"couponfee" xml:"couponfee"` // 是 优惠券费用(单位:元) Tips float64 `json:"tips" xml:"tips"` // 是 小费(单位:元) Insurancefee uint `json:"insurancefee" xml:"insurancefee"` // 是 保价费(单位:元) Distance uint `json:"distance" xml:"distance"` // 否 配送距离(单位:米) WaybillID string `json:"waybill_id" xml:"waybill_id"` // 否 配送单号, 可以在API1更新配送单状态异步返回 OrderStatus float64 `json:"order_status" xml:"order_status"` // 是 配送单状态 FinishCode uint `json:"finish_code" xml:"finish_code"` // 否 收货码 PickupCode uint `json:"pickup_code" xml:"pickup_code"` // 否 取货码 DispatchDuration uint `json:"dispatch_duration" xml:"dispatch_duration"` // 否 预计骑手接单时间,单位秒,比如5分钟,就填300, 无法预计填0 SenderLng float64 `json:"sender_lng" xml:"sender_lng"` // 否 发货方经度,火星坐标,精确到小数点后6位, 用于消息通知,如果下单请求里有发货人信息则不需要 SenderLat float64 `json:"sender_lat" xml:"sender_lat"` // 否 发货方纬度,火星坐标,精确到小数点后6位, 用于消息通知,如果下单请求里有发货人信息则不需要 }
DeliveryOrderReaddReturn 需要返回的数据
type DeliveryOrderReturnConfirmResult ¶
type DeliveryOrderReturnConfirmResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配,可以是dev_id或者appkey ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 配送单id DeliverySign string `json:"delivery_sign" xml:"delivery_sign"` // 用配送公司侧提供的appSecret加密的校验串 }
DeliveryOrderReturnConfirmResult 服务器携带的参数
type DeliveryOrderReturnConfirmReturn ¶
type DeliveryOrderReturnConfirmReturn CommonServerReturn
DeliveryOrderReturnConfirmReturn 需要返回的数据
type DeliveryOrderStatusUpdateResult ¶
type DeliveryOrderStatusUpdateResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配的appkey ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 配送单id ActionTime uint `json:"action_time" xml:"action_time"` // Unix时间戳 OrderStatus int `json:"order_status" xml:"order_status"` // 配送状态,枚举值 ActionMsg string `json:"action_msg" xml:"action_msg"` // 附加信息 Agent struct { Name string `json:"name" xml:"name"` // 骑手姓名 Phone string `json:"phone" xml:"phone"` // 骑手电话 } `json:"agent" xml:"agent"` // 骑手信息 }
DeliveryOrderStatusUpdateResult 服务器携带的参数
type DeliveryOrderStatusUpdateReturn ¶
type DeliveryOrderStatusUpdateReturn CommonServerReturn
DeliveryOrderStatusUpdateReturn 需要返回的数据
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 请求参数
func (*DeliveryOrderUpdater) Update ¶
func (updater *DeliveryOrderUpdater) Update(token string) (*CommonResult, error)
Update 模拟配送公司更新配送单状态
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 增加小费参数
func (*DeliveryTipAdder) Add ¶
func (adder *DeliveryTipAdder) Add(token string) (*CommonResult, error)
Add 对待接单状态的订单增加小费。需要注意:订单的小费,以最新一次加小费动作的金额为准,故下一次增加小费额必须大于上一次小费额
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 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 { 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 识别行驶证返回数据
func DriverLicense ¶
func DriverLicense(token, filename string) (*DrivingLicenseResponse, error)
DriverLicense 通过文件识别行驶证 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。
token 接口调用凭证 img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用传递 img_url。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)
func DriverLicenseByURL ¶
func DriverLicenseByURL(token, licenseURL string) (*DrivingLicenseResponse, error)
DriverLicenseByURL 通过URL识别行驶证 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。
token 接口调用凭证 url 要检测的图片 url,传这个则不用传 img 参数。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)
type EncryptedMsgRequest ¶
type EncryptedMsgRequest struct { XMLName xml.Name `xml:"xml"` Encrypt string `json:"Encrypt" xml:"Encrypt"` // 加密消息 TimeStamp string `json:"TimeStamp,omitempty" xml:"TimeStamp,omitempty"` // 时间戳 Nonce string `json:"Nonce,omitempty" xml:"Nonce,omitempty"` // 随机数 MsgSignature string `json:"MsgSignature,omitempty" xml:"MsgSignature,omitempty"` // 签名 }
EncryptedMsgRequest 发送的加密消息格式
type EncryptedResult ¶
type EncryptedResult struct { XMLName xml.Name `xml:"xml" json:"-"` ToUserName string `json:"ToUserName" xml:"ToUserName"` // 接收者 为小程序 AppID Encrypt string `json:"Encrypt" xml:"Encrypt"` // 加密消息 }
EncryptedResult 接收的加密数据
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 物流账号
func (*ExpressAccount) Bind ¶
func (ea *ExpressAccount) Bind(token string) (*CommonError, error)
Bind 绑定、解绑物流账号 token 接口调用凭证
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 订单取消器
func (*ExpressOrderCanceler) Cancel ¶
func (canceler *ExpressOrderCanceler) Cancel(token string) (*CommonError, error)
Cancel 取消运单 token 接 口调用凭证
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 订单创建器
func (*ExpressOrderCreator) Create ¶
func (creator *ExpressOrderCreator) Create(token string) (*CreateExpressOrderResponse, error)
Create 生成运单 token 接口调用凭证
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 订单获取器
func (*ExpressOrderGetter) Get ¶
func (getter *ExpressOrderGetter) Get(token string) (*GetExpressOrderResponse, error)
Get 获取运单数据 token 接口调用凭证
type ExpressOrderSource ¶
type ExpressOrderSource = uint8
ExpressOrderSource 订单来源
const ( FromWeapp ExpressOrderSource = 0 // 小程序订单 FromAppOrH5 = 2 // APP或H5订单 )
所有订单来源
type ExpressPathGetter ¶
type ExpressPathGetter ExpressOrderGetter
ExpressPathGetter 查询运单轨迹所需参数
func (*ExpressPathGetter) Get ¶
func (ep *ExpressPathGetter) Get(token string) (*GetExpressPathResponse, error)
Get 查询运单轨迹 token 接口调用凭证
type ExpressPathNode ¶
type ExpressPathNode struct { ActionTime uint `json:"action_time"` // 轨迹节点 Unix 时间戳 ActionType uint `json:"action_type"` // 轨迹节点类型 ActionMsg string `json:"action_msg"` // 轨迹节点详情 }
ExpressPathNode 运单轨迹节点
type ExpressPathUpdateResult ¶
type ExpressPathUpdateResult struct { CommonServerResult DeliveryID string `json:"DeliveryID" xml:"DeliveryID"` // 快递公司ID WayBillID string `json:"WayBillId" xml:"WayBillId"` // 运单ID Version uint `json:"Version" xml:"Version"` // 轨迹版本号(整型) Count uint `json:"Count" xml:"Count"` // 轨迹节点数(整型) Actions []struct { ActionTime uint `json:"ActionTime" xml:"ActionTime"` // 轨迹节点 Unix 时间戳 ActionType uint `json:"ActionType" xml:"ActionType"` // 轨迹节点类型 ActionMsg string `json:"ActionMsg" xml:"ActionMsg"` // 轨迹节点详情 } `json:"Actions" xml:"Actions"` // 轨迹列表 }
ExpressPathUpdateResult 运单轨迹更新事件需要返回的数据
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 运单轨迹更新器
func (*ExpressPathUpdater) Update ¶
func (updater *ExpressPathUpdater) Update(token string) (*CommonError, error)
Update 更新运单轨迹 token 接口调用凭证
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 面单模板预览器
func (*ExpressTemplatePreviewer) Preview ¶
func (previewer *ExpressTemplatePreviewer) Preview(token string) (*PreviewTemplateResponse, error)
Preview 预览面单模板。用于调试面单模板使用。 token 接口调用凭证
type FaceIdentifyResponse ¶
type FaceIdentifyResponse struct { 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 人脸识别结果返回
func FaceIdentify ¶
func FaceIdentify(token, key string) (*FaceIdentifyResponse, error)
FaceIdentify 获取人脸识别结果
token 微信 access_token key 小程序 verify_result
type GetAllImmediateDeliveryResponse ¶
type GetAllImmediateDeliveryResponse struct { CommonResult List []struct { ID string `json:"delivery_id"` //配送公司Id Name string `json:"delivery_name"` // 配送公司名称 } `json:"list"` // 配送公司列表 }
GetAllImmediateDeliveryResponse 获取已支持的配送公司列表接口返回数据
func GetAllImmediateDelivery ¶
func GetAllImmediateDelivery(token string) (*GetAllImmediateDeliveryResponse, error)
GetAllImmediateDelivery 获取已支持的配送公司列表接口
type GetBindAccountResponse ¶
type GetBindAccountResponse struct { CommonResult ShopList []struct { DeliveryID string `json:"delivery_id"` // 配送公司Id ShopID string `json:"shopid"` // 商家id AuditResult uint8 `json:"audit_result"` // 审核状态 } `json:"shop_list"` // 配送公司列表 }
GetBindAccountResponse 返回数据
func GetBindAccount ¶
func GetBindAccount(token string) (*GetBindAccountResponse, error)
GetBindAccount 拉取已绑定账号
type GetContactResponse ¶
type GetContactResponse struct { CommonError WaybillID string `json:"waybill_id"` // 运单 ID Sender ContactUser `json:"sender"` // 发件人信息 Receiver ContactUser `json:"receiver"` // 收件人信息 }
GetContactResponse 获取面单联系人信息返回数据
func GetContact ¶
func GetContact(accessToken, token, watBillID string) (*GetContactResponse, error)
GetContact 获取面单联系人信息 accessToken, token, watBillID 接口调用凭证
type GetDeliveryOrderResponse ¶
type GetDeliveryOrderResponse struct { 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 { 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 { 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 GetExpressQuotaResult ¶
type GetExpressQuotaResult struct { CommonServerResult BizID string `json:"BizID" xml:"BizID"` // 商户ID,即商户在快递注册的客户编码或月结账户名 BizPwd string `json:"BizPwd" xml:"BizPwd"` // BizID 对应的密码 ShopAppID string `json:"ShopAppID" xml:"ShopAppID"` // 商户小程序的 AppID }
GetExpressQuotaResult 查询商户余额事件参数
type GetExpressQuotaReturn ¶
type GetExpressQuotaReturn struct { CommonServerReturn BizID string `json:"BizID" xml:"BizID"` // 商户ID Quota float64 `json:"Quota" xml:"Quota"` // 商户可用余额,0 表示无可用余额 }
GetExpressQuotaReturn 查询商户余额事件需要返回的数据
type GetPaidUnionIDResponse ¶
type GetPaidUnionIDResponse struct { CommonError UnionID string `json:"unionid"` }
GetPaidUnionIDResponse response data
type GetPluginDevApplyListResponse ¶
type GetPluginDevApplyListResponse struct { 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 查询已添加的插件返回数据
func GetPluginDevApplyList ¶
func GetPluginDevApplyList(token string, page, num uint) (*GetPluginDevApplyListResponse, error)
GetPluginDevApplyList 获取当前所有插件使用方 accessToken 接口调用凭证 page number 是 要拉取第几页的数据 num 是 每页的记录数
type GetPluginListResponse ¶
type GetPluginListResponse struct { CommonError PluginList []struct { AppID string `json:"appid"` // 插件 appId Status int8 `json:"status"` // 插件状态 Nickname string `json:"nickname"` // 插件昵称 HeadImgURL string `json:"headimgurl"` // 插件头像 } `json:"plugin_list"` // 申请或使用中的插件列表 }
GetPluginListResponse 查询已添加的插件返回数据
func GetPluginList ¶
func GetPluginList(token string) (*GetPluginListResponse, error)
GetPluginList 查询已添加的插件 accessToken 接口调用凭证
type GetPrinterResponse ¶
type GetPrinterResponse struct { CommonError Count uint `json:"count"` // 已经绑定的打印员数量 OpenID []string `json:"openid"` // 打印员 openid 列表 TagIDList []string `json:"tagid_list"` }
GetPrinterResponse 获取打印员返回数据
func GetPrinter ¶
func GetPrinter(token string) (*GetPrinterResponse, error)
GetPrinter 获取打印员。若需要使用微信打单 PC 软件,才需要调用。 token 接口调用凭证
type GetPubTemplateKeyWordsByIdResponse ¶
type GetPubTemplateKeyWordsByIdResponse struct { 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 模板标题下的关键词列表
func GetPubTemplateKeyWordsById ¶
func GetPubTemplateKeyWordsById(token, tid string) (*GetPubTemplateKeyWordsByIdResponse, error)
GetPubTemplateKeyWordsById 获取模板标题下的关键词列表
token 微信 access_token tid 模板ID
type GetPubTemplateTitleListResponse ¶
type GetPubTemplateTitleListResponse struct { 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 帐号所属类目下的公共模板标题
func GetPubTemplateTitleList ¶
func GetPubTemplateTitleList(token, ids string, start, limit int) (*GetPubTemplateTitleListResponse, error)
GetPubTemplateTitleList 获取帐号所属类目下的公共模板标题
token 微信 access_token ids 类目 id,多个用逗号隔开 start 用于分页,表示从 start 开始。从 0 开始计数。 limit 用于分页,表示拉取 limit 条记录。最大为 30
type GetTemplateCategoryResponse ¶
type GetTemplateCategoryResponse struct { CommonError Data []struct { ID int `json:"id"` // 类目id,查询公共库模版时需要 Name string `json:"name"` // 类目的中文名 } `json:"data"` // 类目列表 }
GetTemplateCategoryResponse 删除帐号下的某个模板返回数据
func GetTemplateCategory ¶
func GetTemplateCategory(token string) (*GetTemplateCategoryResponse, error)
GetTemplateCategory 删除帐号下的某个模板
token 微信 access_token
type GetTemplateListResponse ¶
type GetTemplateListResponse struct { 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 获取模板列表返回的数据
func GetTemplateList ¶
func GetTemplateList(token string) (*GetTemplateListResponse, error)
GetTemplateList 获取帐号下已存在的模板列表
token 微信 access_token
type IDCardResponse ¶
type IDCardResponse = CardResponse
IDCardResponse 识别身份证返回数据
func IDCard ¶
func IDCard(token, filename string, mode RecognizeMode) (*IDCardResponse, error)
IDCard 通过文件识别身份证 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。
token 接口调用凭证 img form-data 中媒体文件标识,有filename、filelength、content-type等信息,传这个则不用传递 img_url。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)
func IDCardByURL ¶
func IDCardByURL(token, cardURL string, mode RecognizeMode) (*IDCardResponse, error)
IDCardByURL 通过URL识别身份证 接口限制: 此接口需要提供对应小程序/公众号 appid,开通权限后方可调用。
token 接口调用凭证 url 要检测的图片 url,传这个则不用传 img 参数。 mode 图片识别模式,photo(拍照模式)或 scan(扫描模式)
type ImageMessageResult ¶
type ImageMessageResult struct { CommonServerResult MsgID int `json:"MsgId" xml:"MsgId"` // 消息 ID PicURL string `json:"PicUrl" xml:"PicUrl"` MediaID string `json:"MediaId" xml:"MediaId"` }
ImageMessageResult 接收的图片消息
type KFInfo ¶
type KFInfo struct { OpenKF bool `json:"open_kf"` KFHeading string `json:"kf_headimg"` KFName string `json:"kf_name"` }
KFInfo // 客服信息
type LicensePoint ¶
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 LoginResponse ¶
type LoginResponse struct { CommonError OpenID string `json:"openid"` SessionKey string `json:"session_key"` // 用户在开放平台的唯一标识符 // 只在满足一定条件的情况下返回 UnionID string `json:"unionid"` }
LoginResponse 返回给用户的数据
func Login ¶
func Login(appID, secret, code string) (*LoginResponse, error)
Login 登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。
appID 小程序 appID secret 小程序的 app secret code 小程序登录时获取的 code
type MediaCheckAsyncResult ¶
type MediaCheckAsyncResult struct { CommonServerResult IsRisky uint8 `json:"isrisky" xml:"isrisky"` // 检测结果,0:暂未检测到风险,1:风险 ExtraInfoJSON string `json:"extra_info_json" xml:"extra_info_json"` // 附加信息,默认为空 AppID string `json:"appid" xml:"appid"` // 小程序的appid TraceID string `json:"trace_id" xml:"trace_id"` // 任务id StatusCode int `json:"status_code" xml:"status_code"` // 默认为:0,4294966288(-1008)为链接无法下载 }
MediaCheckAsyncResult 异步校验的图片/音频结果
type MediaType ¶
type MediaType = uint8
MediaType 检测内容类型
const ( MediaTypeAudio MediaType // 音频 MediaTypeImage // 图片 )
所有检测内容类型
type Miniprogram ¶
Miniprogram 小程序
type Mobile ¶
type Mobile struct { PhoneNumber string `json:"phoneNumber"` PurePhoneNumber string `json:"purePhoneNumber"` CountryCode string `json:"countryCode"` Watermark watermark `json:"watermark"` }
Mobile 解密后的用户手机号码信息
func DecryptMobile ¶
DecryptMobile 解密手机号码
sessionKey 通过 Login 向微信服务端请求得到的 session_key encryptedData 小程序通过 api 得到的加密数据(encryptedData) iv 小程序通过 api 得到的初始向量(iv)
type NearbyPoi ¶
type NearbyPoi struct { PicList PicList `json:"pic_list"` // 门店图片,最多9张,最少1张,上传门店图片如门店外景、环境设施、商品服务等,图片将展示在微信客户端的门店页。图片链接通过文档https://mp.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"` // 退出页次数 }
Page 页面
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 { 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 地点列表
func GetNearbyPoiList ¶
func GetNearbyPoiList(token string, page, rows uint) (*PositionList, error)
GetNearbyPoiList 查看地点列表 token 接口调用凭证 page 起始页id(从1开始计数) rows 每页展示个数(最多1000个)
type PreAuthCodeGetResult ¶
type PreAuthCodeGetResult struct { CommonServerResult WxAppID string `json:"wx_appid" xml:"wx_appid"` // 发起授权的商户小程序appid }
PreAuthCodeGetResult 服务器携带的参数
type PreAuthCodeGetReturn ¶
type PreAuthCodeGetReturn struct { CommonServerReturn PreAuthCode string `json:"pre_auth_code" xml:"pre_auth_code"` // 是 预授权码 }
PreAuthCodeGetReturn 需要返回的数据
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 { CommonError WaybillID string `json:"waybill_id"` // 运单 ID RenderedWaybillTemplate string `json:"rendered_waybill_template"` // 渲染后的面单 HTML 文件(已经过 Base64 编码) }
PreviewTemplateResponse 预览面单模板返回数据
type PrintedTextResponse ¶
type PrintedTextResponse struct { CommonError Items []struct { Text string `json:"text"` Position LicensePosition `json:"pos"` } `json:"items"` // 识别结果 ImgSize LicensePoint `json:"img_size"` // 图片大小 }
PrintedTextResponse 通用印刷体 OCR 识别返回数据
func PrintedText ¶
func PrintedText(token, filename string) (*PrintedTextResponse, error)
PrintedText 通过文件进行通用印刷体 OCR 识别
func PrintedTextByURL ¶
func PrintedTextByURL(token, cardURL string) (*PrintedTextResponse, error)
PrintedTextByURL 通过链接进行通用印刷体 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 打印员更新器
func (*PrinterUpdater) Update ¶
func (updater *PrinterUpdater) Update(token string) (*CommonError, error)
Update 更新打印员。若需要使用微信打单 PC 软件,才需要调用。
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 二维码创建器
func (*QRCodeCreator) Create ¶
func (creator *QRCodeCreator) Create(token string) (*http.Response, *CommonError, error)
Create 获取小程序二维码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效,有数量限制 通过该接口生成的小程序码,永久有效,有数量限制
token 微信access_token
type QRCodePoint ¶
QRCodePoint 二维码角的位置
type QuotaGetResponse ¶
type QuotaGetResponse struct { CommonError Number uint // 电子面单余额 }
QuotaGetResponse 电子面单余额
type QuotaGetter ¶
type QuotaGetter struct { DeliveryID string `json:"delivery_id"` // 快递公司ID,参见getAllDelivery BizID string `json:"biz_id"` // 快递公司客户编码 }
QuotaGetter 电子面单余额获取器
func (*QuotaGetter) Get ¶
func (getter *QuotaGetter) Get(token string) (*QuotaGetResponse, error)
Get 获取电子面单余额。仅在使用加盟类快递公司时,才可以调用。
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 { CommonError RefDate string `json:"ref_date"` // 时间,月格式为 yyyymm | 周格式为 yyyymmdd-yyyymmdd | 天格式为 yyyymmdd VisitUV []Retain `json:"visit_uv"` // 活跃用户留存 VisitUVNew []Retain `json:"visit_uv_new"` // 新增用户留存 }
RetainResponse 生物认证秘钥签名验证请求返回数据
func GetDailyRetain ¶
func GetDailyRetain(accessToken, begin, end string) (*RetainResponse, error)
GetDailyRetain 获取用户访问小程序日留存 accessToken 接口调用凭证 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd
func GetMonthlyRetain ¶
func GetMonthlyRetain(accessToken, begin, end string) (*RetainResponse, error)
GetMonthlyRetain 获取用户访问小程序月留存 accessToken 接口调用凭证 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,为自然月最后一天,限定查询一个月数据。格式为 yyyymmdd
func GetWeeklyRetain ¶
func GetWeeklyRetain(accessToken, begin, end string) (*RetainResponse, error)
GetWeeklyRetain 获取用户访问小程序周留存 accessToken 接口调用凭证 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,为周日日期,限定查询一周数据。格式为 yyyymmdd
type RiderScoreSetResult ¶
type RiderScoreSetResult struct { CommonServerResult ShopID string `json:"shopid" xml:"shopid"` // 商家id, 由配送公司分配,可以是dev_id或者appkey ShopOrderID string `json:"shop_order_id" xml:"shop_order_id"` // 唯一标识订单的 ID,由商户生成 ShopNo string `json:"shop_no" xml:"shop_no"` // 商家门店编号, 在配送公司侧登记 WaybillID string `json:"waybill_id" xml:"waybill_id"` // 配送单id DeliveryOntimeScore uint `json:"delivery_ontime_score" xml:"delivery_ontime_score"` // 配送准时分数,范围 1 - 5 CargoIntactScore uint `json:"cargo_intact_score" xml:"cargo_intact_score"` // 货物完整分数,范围1-5 AttitudeScore uint `json:"attitude_score" xml:"attitude_score"` // 服务态度分数 范围1-5 }
RiderScoreSetResult 服务器携带的参数
type RunData ¶
type RunData struct {
StepInfoList []SetpInfo `json:"stepInfoList"`
}
RunData 解密后的最近30天微信运动步数
func DecryptRunData ¶
DecryptRunData 解密微信运动的加密数据
sessionKey 通过 Login 向微信服务端请求得到的 session_key encryptedData 小程序通过 api 得到的加密数据(encryptedData) iv 小程序通过 api 得到的初始向量(iv)
type ScanQRCodeResponse ¶
type ScanQRCodeResponse struct { 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 小程序的条码/二维码识别后的返回数据
func ScanQRCode ¶
func ScanQRCode(token, filename string) (*ScanQRCodeResponse, error)
ScanQRCode 本接口提供基于小程序的条码/二维码识别的API。
func ScanQRCodeByURL ¶
func ScanQRCodeByURL(token, imgURL string) (*ScanQRCodeResponse, error)
ScanQRCodeByURL 把网络文件上传到微信服务器。目前仅支持图片。用于发送客服消息或被动回复用户消息。
type SearchSubmitPage ¶
SearchSubmitPage 请求收录的页面
type SearchSubmitPages ¶
type SearchSubmitPages struct {
Pages []SearchSubmitPage `json:"pages"`
}
SearchSubmitPages 小程序页面收录请求
func (*SearchSubmitPages) Send ¶
func (s *SearchSubmitPages) Send(token string) (*CommonError, error)
Send 提交收录请求
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server 微信通知服务处理器
func (*Server) OnAddExpressOrder ¶
func (srv *Server) OnAddExpressOrder(fn func(*AddExpressOrderResult) *AddExpressOrderReturn)
OnAddExpressOrder add handler to handle AddExpressOrder.
func (*Server) OnAddNearbyPoi ¶
func (srv *Server) OnAddNearbyPoi(fn func(*AddNearbyPoiResult))
OnAddNearbyPoi add handler to handle AddNearbyPoiAudit.
func (*Server) OnAgentPosQuery ¶
func (srv *Server) OnAgentPosQuery(fn func(*AgentPosQueryResult) *AgentPosQueryReturn)
OnAgentPosQuery add handler to handle AgentPosQuery.
func (*Server) OnAuthInfoGet ¶
func (srv *Server) OnAuthInfoGet(fn func(*AuthInfoGetResult) *AuthInfoGetReturn)
OnAuthInfoGet add handler to handle AuthInfoGet.
func (*Server) OnCancelAuth ¶
func (srv *Server) OnCancelAuth(fn func(*CancelAuthResult) *CancelAuthReturn)
OnCancelAuth add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnCancelExpressOrder ¶
func (srv *Server) OnCancelExpressOrder(fn func(*CancelExpressOrderResult) *CancelExpressOrderReturn)
OnCancelExpressOrder add handler to handle ExpressOrderCancel.
func (*Server) OnCheckExpressBusiness ¶
func (srv *Server) OnCheckExpressBusiness(fn func(*CheckExpressBusinessResult) *CheckExpressBusinessReturn)
OnCheckExpressBusiness add handler to handle CheckBusiness.
func (*Server) OnCustomerServiceCardMessage ¶
func (srv *Server) OnCustomerServiceCardMessage(fn func(*CardMessageResult) *TransferCustomerMessage)
OnCustomerServiceCardMessage add handler to handle customer card service message.
func (*Server) OnCustomerServiceImageMessage ¶
func (srv *Server) OnCustomerServiceImageMessage(fn func(*ImageMessageResult) *TransferCustomerMessage)
OnCustomerServiceImageMessage add handler to handle customer image service message.
func (*Server) OnCustomerServiceTextMessage ¶
func (srv *Server) OnCustomerServiceTextMessage(fn func(*TextMessageResult) *TransferCustomerMessage)
OnCustomerServiceTextMessage add handler to handle customer text service message.
func (*Server) OnDeliveryOrderAdd ¶
func (srv *Server) OnDeliveryOrderAdd(fn func(*DeliveryOrderAddResult) *DeliveryOrderAddReturn)
OnDeliveryOrderAdd add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnDeliveryOrderAddTips ¶
func (srv *Server) OnDeliveryOrderAddTips(fn func(*DeliveryOrderAddTipsResult) *DeliveryOrderAddTipsReturn)
OnDeliveryOrderAddTips add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnDeliveryOrderCancel ¶
func (srv *Server) OnDeliveryOrderCancel(fn func(*DeliveryOrderCancelResult) *DeliveryOrderCancelReturn)
OnDeliveryOrderCancel add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnDeliveryOrderPreAdd ¶
func (srv *Server) OnDeliveryOrderPreAdd(fn func(*DeliveryOrderPreAddResult) *DeliveryOrderPreAddReturn)
OnDeliveryOrderPreAdd add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnDeliveryOrderPreCancel ¶
func (srv *Server) OnDeliveryOrderPreCancel(fn func(*DeliveryOrderPreCancelResult) *DeliveryOrderPreCancelReturn)
OnDeliveryOrderPreCancel add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnDeliveryOrderQuery ¶
func (srv *Server) OnDeliveryOrderQuery(fn func(*DeliveryOrderQueryResult) *DeliveryOrderQueryReturn)
OnDeliveryOrderQuery add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnDeliveryOrderReadd ¶
func (srv *Server) OnDeliveryOrderReadd(fn func(*DeliveryOrderReaddResult) *DeliveryOrderReaddReturn)
OnDeliveryOrderReadd add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnDeliveryOrderReturnConfirm ¶
func (srv *Server) OnDeliveryOrderReturnConfirm(fn func(*DeliveryOrderReturnConfirmResult) *DeliveryOrderReturnConfirmReturn)
OnDeliveryOrderReturnConfirm add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnDeliveryOrderStatusUpdate ¶
func (srv *Server) OnDeliveryOrderStatusUpdate(fn func(*DeliveryOrderStatusUpdateResult) *DeliveryOrderStatusUpdateReturn)
OnDeliveryOrderStatusUpdate add handler to handle DeliveryOrderStatusUpdate. OnDeliveryOrderStatusUpdate add handler to handle deliveryOrderStatusUpdate.
func (*Server) OnExpressPathUpdate ¶
func (srv *Server) OnExpressPathUpdate(fn func(*ExpressPathUpdateResult))
OnExpressPathUpdate add handler to handle ExpressPathUpdate.
func (*Server) OnGetExpressQuota ¶
func (srv *Server) OnGetExpressQuota(fn func(*GetExpressQuotaResult) *GetExpressQuotaReturn)
OnGetExpressQuota add handler to handle QuotaGet.
func (*Server) OnMediaCheckAsync ¶
func (srv *Server) OnMediaCheckAsync(fn func(*MediaCheckAsyncResult))
OnMediaCheckAsync add handler to handle MediaCheckAsync.
func (*Server) OnPreAuthCodeGet ¶
func (srv *Server) OnPreAuthCodeGet(fn func(*PreAuthCodeGetResult) *PreAuthCodeGetReturn)
OnPreAuthCodeGet add handler to handle preAuthCodeGet.
func (*Server) OnRiderScoreSet ¶
func (srv *Server) OnRiderScoreSet(fn func(*RiderScoreSetResult) *RiderScoreSetReturn)
OnRiderScoreSet add handler to handle riderScoreSet.
func (*Server) OnUserTempsessionEnter ¶
func (srv *Server) OnUserTempsessionEnter(fn func(*UserTempsessionEnterResult))
OnUserTempsessionEnter add handler to handle customer service message.
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 = "CancelTyping" // 取消对用户的"正在输入"状态 )
所有下发客服当前输入状态命令
type ShareInfo ¶
type ShareInfo struct {
}ShareInfo 解密后的分享信息
func DecryptShareInfo ¶
DecryptShareInfo 解密转发信息的加密数据
sessionKey 通过 Login 向微信服务端请求得到的 session_key encryptedData 小程序通过 api 得到的加密数据(encryptedData) iv 小程序通过 api 得到的初始向量(iv)
gid 小程序唯一群号
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 SubscribeMessageData `json:"data"` }
SubscribeMessage 订阅消息
func (*SubscribeMessage) Send ¶
func (sm *SubscribeMessage) Send(token string) (*CommonError, error)
Send 发送订阅消息
token access_token
type SubscribeMessageData ¶
SubscribeMessageData 订阅消息模板数据
type Summary ¶
type Summary struct { RefDate string `json:"ref_date"` // 日期,格式为 yyyymmdd VisitTotal uint `json:"visit_total"` // 累计用户数 }
Summary 概况
type SuperResolutionResponse ¶
type SuperResolutionResponse struct { CommonError MediaID string `json:"media_id"` }
SuperResolutionResponse 图片高清化后的返回数据
func SuperResolution ¶
func SuperResolution(token, filename string) (*SuperResolutionResponse, error)
SuperResolution 本接口提供基于小程序的图片高清化能力。
func SuperResolutionByURL ¶
func SuperResolutionByURL(token, imgURL string) (*SuperResolutionResponse, error)
SuperResolutionByURL 把网络文件上传到微信服务器。目前仅支持图片。用于发送客服消息或被动回复用户消息。
type TempMediaType ¶
type TempMediaType = string
TempMediaType 文件类型
const (
TempMediaTypeImage TempMediaType = "image" // 图片
)
所有文件类型
type TextMessageResult ¶
type TextMessageResult struct { CommonServerResult MsgID int `json:"MsgId" xml:"MsgId"` // 消息 ID Content string `json:"Content" xml:"Content"` }
TextMessageResult 接收的文本消息
type TokenResponse ¶
type TokenResponse struct { CommonError AccessToken string `json:"access_token"` // 获取到的凭证 ExpiresIn uint `json:"expires_in"` // 凭证有效时间,单位:秒。目前是7200秒之内的值。 }
TokenResponse 获取 access_token 成功返回数据
func GetAccessToken ¶
func GetAccessToken(appID, secret string) (*TokenResponse, error)
GetAccessToken 获取小程序全局唯一后台接口调用凭据(access_token)。 调调用绝大多数后台接口时都需使用 access_token,开发者需要进行妥善保存,注意缓存。
type TransferCustomerMessage ¶
type TransferCustomerMessage struct { XMLName xml.Name `xml:"xml"` // 接收方帐号(收到的OpenID) ToUserName string `json:"ToUserName" xml:"ToUserName"` // 开发者微信号 FromUserName string `json:"FromUserName" xml:"FromUserName"` // 消息创建时间 (整型) CreateTime uint `json:"CreateTime" xml:"CreateTime"` // 转发消息类型 MsgType MsgType `json:"MsgType" xml:"MsgType"` }
TransferCustomerMessage 需要转发的客服消息
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 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 UniformMsgKeyword ¶
UniformMsgKeyword 关键字
type UniformMsgMiniprogram ¶
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 统一服务消息
func (*UniformMsgSender) Send ¶
func (msg *UniformMsgSender) Send(token string) (*CommonError, error)
Send 统一服务消息
token access_token
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"` Width int `json:"width,omitempty"` AutoColor bool `json:"auto_color,omitempty"` LineColor Color `json:"line_color,omitempty"` IsHyaline bool `json:"is_hyaline,omitempty"` }
UnlimitedQRCode 小程序码参数
func (*UnlimitedQRCode) Get ¶
func (code *UnlimitedQRCode) Get(token string) (*http.Response, *CommonError, error)
Get 获取小程序码 可接受页面参数较短 生成个数不受限 适用于需要的码数量极多的业务场景 根路径前不要填加'/' 不能携带参数(参数请放在scene字段里)
token 微信access_token
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 UpdatableMsgSetter ¶
type UpdatableMsgSetter struct { ActivityID string `json:"activity_id"` // 动态消息的 ID,通过 updatableMessage.createActivityId 接口获取 TargetState UpdatableMsgTargetState `json:"target_state"` // 动态消息修改后的状态(具体含义见后文) TemplateInfo UpdatableMsgTempInfo `json:"template_info"` // 动态消息对应的模板信息 }
UpdatableMsgSetter 动态消息
func (*UpdatableMsgSetter) Set ¶
func (setter *UpdatableMsgSetter) Set(token string) (*CommonError, error)
Set 修改被分享的动态消息。 accessToken 接口调用凭证
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 请求参数
func (*UpdateDeliveryOrderMocker) Mock ¶
func (mocker *UpdateDeliveryOrderMocker) Mock(token string) (*CommonResult, error)
Mock 模拟配送公司更新配送单状态
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 模拟的快递公司更新订单
func (*UpdateExpressOrderTester) Test ¶
func (tester *UpdateExpressOrderTester) Test(token string) (*CommonError, error)
Test 模拟快递公司更新订单状态, 该接口只能用户测试
type UploadTempMediaResponse ¶
type UploadTempMediaResponse struct { CommonError Type string `json:"type"` // 文件类型 MediaID string `json:"media_id"` // 媒体文件上传后,获取标识,3天内有效。 CreatedAt uint `json:"created_at"` // 媒体文件上传时间戳 }
UploadTempMediaResponse 上传媒体文件返回
func UploadTempMedia ¶
func UploadTempMedia(token string, mediaType TempMediaType, medianame string) (*UploadTempMediaResponse, error)
UploadTempMedia 把媒体文件上传到微信服务器。目前仅支持图片。用于发送客服消息或被动回复用户消息。
token 接口调用凭证 mediaType 文件类型 medianame 媒体文件名
type UserInfo ¶
type UserInfo struct { OpenID string `json:"openId"` Nickname string `json:"nickName"` Gender int `json:"gender"` Province string `json:"province"` Language string `json:"language"` Country string `json:"country"` City string `json:"city"` Avatar string `json:"avatarUrl"` UnionID string `json:"unionId"` Watermark watermark `json:"watermark"` }
UserInfo 解密后的用户信息
func DecryptUserInfo ¶
DecryptUserInfo 解密用户信息
sessionKey 微信 session_key rawData 不包括敏感信息的原始数据字符串,用于计算签名。 encryptedData 包括敏感数据在内的完整用户信息的加密数据 signature 使用 sha1( rawData + session_key ) 得到字符串,用于校验用户信息 iv 加密算法的初始向量
type UserPortrait ¶
type UserPortrait struct { CommonError RefDate string `json:"ref_date"` VisitUV Portrait `json:"visit_uv"` // 活跃用户画像 VisitUVNew Portrait `json:"visit_uv_new"` // 新用户画像 }
UserPortrait response data of get user portrait
func GetUserPortrait ¶
func GetUserPortrait(accessToken, begin, end string) (*UserPortrait, error)
GetUserPortrait 获取小程序新增或活跃用户的画像分布数据。 时间范围支持昨天、最近7天、最近30天。 其中,新增用户数为时间范围内首次访问小程序的去重用户数,活跃用户数为时间范围内访问过小程序的去重用户数。 begin 开始日期。格式为 yyyymmdd end 结束日期,开始日期与结束日期相差的天数限定为0/6/29,分别表示查询最近1/7/30天数据,允许设置的最大值为昨日。格式为 yyyymmdd
type UserTempsessionEnterResult ¶
type UserTempsessionEnterResult struct { CommonServerResult SessionFrom string `json:"SessionFrom" xml:"SessionFrom"` // 开发者在客服会话按钮设置的 session-from 属性 }
UserTempsessionEnterResult 接收的文本消息
type VehicleLicenseResponse ¶
type VehicleLicenseResponse struct { 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 识别卡片返回数据
func VehicleLicense ¶
func VehicleLicense(token, filename string, mode RecognizeMode) (*VehicleLicenseResponse, error)
VehicleLicense 通过文件识别行驶证
func VehicleLicenseByURL ¶
func VehicleLicenseByURL(token, cardURL string, mode RecognizeMode) (*VehicleLicenseResponse, error)
VehicleLicenseByURL 行驶证 OCR 识别
type VerifySignatureResponse ¶
type VerifySignatureResponse struct { CommonError IsOk bool `json:"is_ok"` }
VerifySignatureResponse 生物认证秘钥签名验证请求返回数据
func VerifySignature ¶
func VerifySignature(token, openID, data, signature string) (*VerifySignatureResponse, error)
VerifySignature 生物认证秘钥签名验证 accessToken 接口调用凭证 openID 用户 openid data 通过 wx.startSoterAuthentication 成功回调获得的 resultJSON 字段 signature 通过 wx.startSoterAuthentication 成功回调获得的 resultJSONSignature 字段
type VisitDistribution ¶
type VisitDistribution struct { CommonError RefDate string `json:"ref_date"` List []Distribution `json:"list"` }
VisitDistribution 用户小程序访问分布数据
func GetVisitDistribution ¶
func GetVisitDistribution(accessToken, begin, end string) (*VisitDistribution, error)
GetVisitDistribution 获取用户小程序访问分布数据 begin 开始日期。格式为 yyyymmdd end 结束日期,限定查询 1 天数据,允许设置的最大值为昨日。格式为 yyyymmdd
type VisitPage ¶
type VisitPage struct { CommonError RefDate string `json:"ref_date"` List []Page `json:"list"` }
VisitPage 页面访问数据
func GetVisitPage ¶
GetVisitPage 访问页面。 目前只提供按 page_visit_pv 排序的 top200。 begin 开始日期。格式为 yyyymmdd end 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd
type VisitTrend ¶
type VisitTrend struct { CommonError List []Trend `json:"list"` }
VisitTrend 生物认证秘钥签名验证请求返回数据
func GetDailyVisitTrend ¶
func GetDailyVisitTrend(accessToken, begin, end string) (*VisitTrend, error)
GetDailyVisitTrend 获取用户访问小程序数据日趋势 accessToken 接口调用凭证 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,限定查询1天数据,允许设置的最大值为昨日。格式为 yyyymmdd
func GetMonthlyVisitTrend ¶
func GetMonthlyVisitTrend(accessToken, begin, end string) (*VisitTrend, error)
GetMonthlyVisitTrend 获取用户访问小程序数据月趋势 accessToken 接口调用凭证 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,为自然月最后一天,限定查询一个月数据。格式为 yyyymmdd
func GetWeeklyVisitTrend ¶
func GetWeeklyVisitTrend(accessToken, begin, end string) (*VisitTrend, error)
GetWeeklyVisitTrend 获取用户访问小程序数据周趋势 accessToken 接口调用凭证 begin 开始日期,为自然月第一天。格式为 yyyymmdd end 结束日期,为周日日期,限定查询一周数据。格式为 yyyymmdd
Source Files ¶
- analysis.go
- analysis_retain.go
- analysis_visit_trend.go
- auth.go
- common_error.go
- crypto.go
- customer_service_message.go
- decrypt.go
- express.go
- express_business.go
- express_provider.go
- face_identify.go
- img.go
- immediate_delivery.go
- nearby_poi.go
- ocr.go
- plugin.go
- qr_code.go
- search_submit_pages.go
- sec_check.go
- server.go
- server_types.go
- soter.go
- subscribe_message.go
- test.go
- uniform_message.go
- updatable_message.go
- util.go
- weapp.go