openapi

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 14 Imported by: 62

Documentation

Index

Constants

View Source
const (
	SCHEME      = "https"
	OPENAPIHOST = "openapi.baidu.com"
	SPAPIHOST   = "spapi.baidu.com"
	SDKLANG     = "Go"
	SDKVERSION  = "0.1.2"
)
View Source
const (
	ContentTypeForm      = "application/x-www-form-urlencoded"
	ContentTypeJSON      = "application/json"
	ContentTypeMultiPart = "multipart/form-data"
	ConverterTypeJSON    = "json"
)

Variables

This section is empty.

Functions

func CancelOrder

func CancelOrder(params *CancelOrderRequest) (bool, error)

CancelOrder

func CheckPath

func CheckPath(params *CheckPathRequest) (string, error)

CheckPath

func ConsumeCouponCode

func ConsumeCouponCode(params *ConsumeCouponCodeRequest) (bool, error)

ConsumeCouponCode

func DeleteCoupon

func DeleteCoupon(params *DeleteCouponRequest) (bool, error)

DeleteCoupon

func DeleteCouponBanner

func DeleteCouponBanner(params *DeleteCouponBannerRequest) (bool, error)

DeleteCouponBanner

func DeleteMaterial

func DeleteMaterial(params *DeleteMaterialRequest) (bool, error)

DeleteMaterial

func DeleteResource

func DeleteResource(params *DeleteResourceRequest) (bool, error)

DeleteResource

func DeleteSitemap

func DeleteSitemap(params *DeleteSitemapRequest) (bool, error)

DeleteSitemap

func DeleteSku

func DeleteSku(params *DeleteSkuRequest) (string, error)

DeleteSku

func DeleteSkuCoupon

func DeleteSkuCoupon(params *DeleteSkuCouponRequest) (string, error)

DeleteSkuCoupon

func ModifyMaterial

func ModifyMaterial(params *ModifyMaterialRequest) (bool, error)

ModifyMaterial

func NewHTTPClient

func NewHTTPClient(opts ...Option) *httpClient

newHTTPClient 创建一个HTTPClient opts 支持optTimeout 或 optRetry

func ReturnCoupon

func ReturnCoupon(params *ReturnCouponRequest) (bool, error)

ReturnCoupon

func SubmitResource

func SubmitResource(params *SubmitResourceRequest) (string, error)

SubmitResource

func SubmitSitemap

func SubmitSitemap(params *SubmitSitemapRequest) (bool, error)

SubmitSitemap

func SubmitSku

func SubmitSku(params *SubmitSkuRequest) (string, error)

SubmitSku

func SubmitSkuCoupon

func SubmitSkuCoupon(params *SubmitSkuCouponRequest) (string, error)

SubmitSkuCoupon

func UpdateCouponBanner

func UpdateCouponBanner(params *UpdateCouponBannerRequest) (bool, error)

UpdateCouponBanner

Types

type APIError

type APIError struct {
	ErrNo  int64       // 错误码
	ErrMsg string      // 错误信息
	Detail interface{} // 详情
}

业务接口错误响应结构体

func (*APIError) Error

func (e *APIError) Error() string

type AddCouponBannerRequest

type AddCouponBannerRequest struct {
	AccessToken     string // 接口调用凭证
	CouponID        string // 卡券 ID
	PicURL          string // 卡券 banner 图片
	Title           string // 卡券 banner 图标题
	AppRedirectPath string // banner 图跳转的小程序页面路径
}

AddCouponBannerRequest 请求结构体

type AddCouponBannerResponse

type AddCouponBannerResponse struct {
	Data      AddCouponBannerResponsedata `json:"data"`       // 响应对象
	Errno     int64                       `json:"errno"`      // 错误码
	ErrMsg    string                      `json:"msg"`        // 错误信息
	ErrorCode int64                       `json:"error_code"` // openapi 错误码
	ErrorMsg  string                      `json:"error_msg"`  // openapi 错误信息
}

type AddCouponBannerResponsedata

type AddCouponBannerResponsedata struct {
	BannerID int64 `json:"bannerId"` // 卡券 banner 记录 id
}

func AddCouponBanner

func AddCouponBanner(params *AddCouponBannerRequest) (*AddCouponBannerResponsedata, error)

AddCouponBanner

type AddMaterialRequest

type AddMaterialRequest struct {
	AccessToken   string // 接口调用凭证
	AppID         int64  // app_id
	ImageURL      string // 小图片地址,长度不能超过 500 个字符,最小尺寸为 213*213,比例为 1:1,单图最大为 2M
	Title         string // 标题,需要描述完整,能够明确表示小程序或内容的主要信息点,不能全英文,6-30 个字。若选择相应垂类时,此字段只作为兜底展示字段
	Path          string // 智能小程序内页链接
	Category1Code string // 一级分类字段
	Category2Code string // 二级分类字段
	Desc          string // 4-17 个汉字。标题解释说明
	LabelAttr     string // 属性、特点。最多三个标签;每个标签字数不超过 5 个汉字,多个使用因为 / 隔开
	LabelDiscount string // 优惠信息,最多一个标签;每个标签字数不超过 7 个汉字
	ButtonName    string // 按钮文案,最多 4 个字
	BigImage      string // 封面图片链接(1 张,单图片最大 2M)大图模板要求最小尺寸 1068 x 601,比例为 16:9,单图最大为 2M
	VerticalImage string // 当选择小说/动漫,影视剧,电影票务,演出赛事时必填;(竖图 3:4)最低 213*284
	ExtJSON       string // 扩展信息
}

AddMaterialRequest 请求结构体

type AddMaterialResponse

type AddMaterialResponse struct {
	Data      AddMaterialResponsedata `json:"data"`       // 响应对象
	Errno     int64                   `json:"errno"`      // 错误码
	ErrMsg    string                  `json:"msg"`        // 错误信息
	ErrorCode int64                   `json:"error_code"` // openapi 错误码
	ErrorMsg  string                  `json:"error_msg"`  // openapi 错误信息
}

type AddMaterialResponsedata

type AddMaterialResponsedata struct {
	ID   int64  `json:"id"`   // 物料唯一 id
	Path string `json:"path"` // 小程序落地页 path 地址
}

func AddMaterial

func AddMaterial(params *AddMaterialRequest) (*AddMaterialResponsedata, error)

AddMaterial

type AddOrderInfoRequest

type AddOrderInfoRequest struct {
	AccessToken string                        // 接口调用凭证
	OpenID      string                        // 百度 App 已登录用户使用 openId 作为用户标识;未登录用户(无 openId 时)使用 swanId 作为用户标识
	SwanID      string                        // 百度 App 已登录用户使用 openId 作为用户标识;未登录用户(无 openId 时)使用 swanId 作为用户标识
	SceneID     string                        // 百度收银台分配的平台订单 ID,通知支付状态接口返回的 orderId
	SceneType   int64                         // 支付场景类型,开发者请默认传 2
	PmAppKey    string                        // 调起百度收银台的支付服务 appKey
	Data        []AddOrderInfoRequestDataItem // 请求数据
}

AddOrderInfoRequest 请求结构体

type AddOrderInfoRequestDataItem

type AddOrderInfoRequestDataItem struct {
	BizAPPID   string                         `json:"BizAPPID"`   // 小程序 AppKey
	CateID     int64                          `json:"CateID"`     // 订单种类:1(实物)、2(虚拟物品)、5(快递服务类)、6(快递服务类无金额订单)、10(上门服务类)、11(上门服务类无金额订单)、15(酒店类)、20(票务类)、25(打车类)、26(打车类无金额订单)
	Ctime      int64                          `json:"Ctime"`      // 订单创建时间(单位:秒)
	EXT        AddOrderInfoRequestDataItemEXT `json:"EXT"`        // 扩展信息
	Mtime      int64                          `json:"Mtime"`      // 订单最后被修改时间(单位:秒)
	ResourceID string                         `json:"ResourceID"` // 开发者接入的唯一订单 ID
	Status     int64                          `json:"Status"`     // 订单状态,其值根据CateID不同有不同的定义。CateID = 1 实物订单、CateID = 2 虚拟物品订单、CateID = 5 快递服务类订单、CateID = 6 快递服务类无金额订单、CateID = 10 上门服务类订单、CateID = 11 上门服务类无金额订单、CateID = 15 酒店类订单、CateID = 20 出行票务类订单、CateID = 25 打车类订单、CateID = 26 打车类无金额订单
	Title      string                         `json:"Title"`      // 订单标题,建议使用订单商品名称
}

type AddOrderInfoRequestDataItemEXT

type AddOrderInfoRequestDataItemEXT struct {
	MainOrder AddOrderInfoRequestDataItemEXTMainOrder `json:"MainOrder"` // 主订单信息(购买商品订单)
}

type AddOrderInfoRequestDataItemEXTMainOrder

type AddOrderInfoRequestDataItemEXTMainOrder struct {
	Appraise    AddOrderInfoRequestDataItemEXTMainOrderAppraise       `json:"Appraise"`    // 待评价状态订单的评价页结构,仅订单为可评价状态,且还未进行评价时提供该信息
	OrderDetail AddOrderInfoRequestDataItemEXTMainOrderOrderDetail    `json:"OrderDetail"` // 订单详情页的信息
	Payment     AddOrderInfoRequestDataItemEXTMainOrderPayment        `json:"Payment"`     // 支付信息
	Products    []AddOrderInfoRequestDataItemEXTMainOrderProductsItem `json:"Products"`    // 数组,商品信息列表,若商品只有 1 个则数组长度为 1
}

type AddOrderInfoRequestDataItemEXTMainOrderAppraise

type AddOrderInfoRequestDataItemEXTMainOrderAppraise struct {
	Status     int64  `json:"Status"`     // 0(不可评价状态或已评价状态)、2(待评价状态,允许跳转)
	SwanSchema string `json:"SwanSchema"` // 评价页的跳转地址,用以小程序跳转 Scheme
}

type AddOrderInfoRequestDataItemEXTMainOrderOrderDetail

type AddOrderInfoRequestDataItemEXTMainOrderOrderDetail struct {
	Status     int64  `json:"Status"`     // 默认传 2
	SwanSchema string `json:"SwanSchema"` // 订单详情页的跳转地址,用以小程序跳转 Scheme
}

type AddOrderInfoRequestDataItemEXTMainOrderPayment

type AddOrderInfoRequestDataItemEXTMainOrderPayment struct {
	Amount           int64                                                                `json:"Amount"`           // 实付金额(单位:分),即100为1元
	IsPayment        bool                                                                 `json:"IsPayment"`        // 是否已付款
	Method           int64                                                                `json:"Method"`           // 付款方式,1(在线付),2(货到付款)
	PaymentInfo      []AddOrderInfoRequestDataItemEXTMainOrderPaymentPaymentInfoItem      `json:"PaymentInfo"`      // 其他付款信息
	PreferentialInfo []AddOrderInfoRequestDataItemEXTMainOrderPaymentPreferentialInfoItem `json:"PreferentialInfo"` // 优惠券信息
	Time             int64                                                                `json:"Time"`             // 付款时间(单位:秒)
}

type AddOrderInfoRequestDataItemEXTMainOrderPaymentPaymentInfoItem

type AddOrderInfoRequestDataItemEXTMainOrderPaymentPaymentInfoItem struct {
	Name     string `json:"Name"`     // 展示名称
	Quantity int64  `json:"Quantity"` // 数量
	Value    int64  `json:"Value"`    // 合计金额(单位:分),即100为1元
}

type AddOrderInfoRequestDataItemEXTMainOrderPaymentPreferentialInfoItem

type AddOrderInfoRequestDataItemEXTMainOrderPaymentPreferentialInfoItem struct {
	Name     string `json:"Name"`     // 展示名称
	Quantity int64  `json:"Quantity"` // 数量
	Value    int64  `json:"Value"`    // 合计金额(单位:分),即100为1元
}

type AddOrderInfoRequestDataItemEXTMainOrderProductsItem

type AddOrderInfoRequestDataItemEXTMainOrderProductsItem struct {
	Desc       string                                                           `json:"Desc"`       // 商品简述
	DetailPage AddOrderInfoRequestDataItemEXTMainOrderProductsItemDetailPage    `json:"DetailPage"` // 商品详情的跳转的跳转结构
	ID         string                                                           `json:"ID"`         // 商品 ID ,开发者的唯一商品 ID
	ImgList    []string                                                         `json:"ImgList"`    // 商品预览,值为预览图 URL 地址,最多 5 张
	Name       string                                                           `json:"Name"`       // 商品名字
	PayPrice   int64                                                            `json:"PayPrice"`   // 实付价(单位:分),即100代表1元
	Price      int64                                                            `json:"Price"`      // 本商品原价(单位:分),即100代表1元
	Quantity   int64                                                            `json:"Quantity"`   // 本商品的交易数量
	SkuAttr    []AddOrderInfoRequestDataItemEXTMainOrderProductsItemSkuAttrItem `json:"SkuAttr"`    // 商品规格,最多 400 个
}

type AddOrderInfoRequestDataItemEXTMainOrderProductsItemDetailPage

type AddOrderInfoRequestDataItemEXTMainOrderProductsItemDetailPage struct {
	Status     string `json:"Status"`     // 默认传 2
	SwanSchema string `json:"SwanSchema"` // 商品详情页的跳转地址,用以小程序跳转 Scheme
}

type AddOrderInfoRequestDataItemEXTMainOrderProductsItemSkuAttrItem

type AddOrderInfoRequestDataItemEXTMainOrderProductsItemSkuAttrItem struct {
	Name  string `json:"Name"`  // 规格名称,例如“颜色”或“尺寸”
	Value string `json:"Value"` // 规格值
}

type AddOrderInfoResponse

type AddOrderInfoResponse struct {
	Data      []AddOrderInfoResponsedataItem `json:"data"`       // 响应对象
	Errno     int64                          `json:"errno"`      // 错误码
	ErrMsg    string                         `json:"msg"`        // 错误信息
	ErrorCode int64                          `json:"error_code"` // openapi 错误码
	ErrorMsg  string                         `json:"error_msg"`  // openapi 错误信息
}

type AddOrderInfoResponsedataItem

type AddOrderInfoResponsedataItem struct {
	BizAppID     string `json:"biz_app_id"`    // POST 请求参数中 BizAPPID
	CateID       string `json:"cate_id"`       // POST 请求参数中 CateID
	ResourceID   string `json:"resource_id"`   // POST 请求参数中 ResourceID
	RowsAffected string `json:"rows_affected"` // 请求受影响行数(即请求是否成功, 0 为失败,非 0 为成功)
}

func AddOrderInfo

func AddOrderInfo(params *AddOrderInfoRequest) ([]AddOrderInfoResponsedataItem, error)

AddOrderInfo

type AddOrderSubInfoRequest

type AddOrderSubInfoRequest struct {
	AccessToken string                           // 接口调用凭证
	OpenID      string                           // 用户 openId
	SceneID     string                           // 百度收银台分配的平台订单 ID,通知支付状态接口返回的 orderId
	SceneType   int64                            // 支付场景类型,开发者请默认传 2
	PmAppKey    string                           // 调起百度收银台的支付服务 appKey
	Data        []AddOrderSubInfoRequestDataItem // 请求数据
}

AddOrderSubInfoRequest 请求结构体

type AddOrderSubInfoRequestDataItem

type AddOrderSubInfoRequestDataItem struct {
	BizAPPID   string                            `json:"BizAPPID"`   // 小程序 AppKey
	CateID     int64                             `json:"CateID"`     // 订单种类:1(实物)、2(虚拟物品)、5(快递服务类)、6(快递服务类无金额订单)、10(上门服务类)、11(上门服务类无金额订单)、15(酒店类)、20(票务类)、25(打车类)、26(打车类无金额订单)
	EXT        AddOrderSubInfoRequestDataItemEXT `json:"EXT"`        // 扩展信息
	ResourceID string                            `json:"ResourceID"` // 开发者接入的唯一订单 ID
}

type AddOrderSubInfoRequestDataItemEXT

type AddOrderSubInfoRequestDataItemEXT struct {
	SubsOrder AddOrderSubInfoRequestDataItemEXTSubsOrder `json:"SubsOrder"` // 子订单信息(退款、售后订单)
}

type AddOrderSubInfoRequestDataItemEXTSubsOrder

type AddOrderSubInfoRequestDataItemEXTSubsOrder struct {
	Items  []AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItem `json:"Items"`  // 售后订单列表
	Status int64                                                 `json:"Status"` // 所有售后订单的状态汇总最终状态,详见 Data.Ext.SubsOrder.Status 退换货枚举值
}

type AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItem

type AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItem struct {
	CTime       int64                                                          `json:"CTime"`       // 创建时间(单位:秒)
	MTime       int64                                                          `json:"MTime"`       // 修改时间(单位:秒)
	OrderDetail AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemOrderDetail `json:"OrderDetail"` // 跳转到这个订单的详情结构,详见 Data.Ext.SubsOrder.Item.OrderDetail
	OrderType   int64                                                          `json:"OrderType"`   // 退款类型,1(仅退款),2(换货),3(退款+退货)。
	Refund      AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefund      `json:"Refund"`      // 售后订单商品信息,详见 Data.Ext.SubsOrder.Item.Refund
	SubOrderID  string                                                         `json:"SubOrderID"`  // 售后订单 ID
	SubStatus   int64                                                          `json:"SubStatus"`   // 售后订单状态,同 Data.Ext.SubsOrder.Status 退换货枚举值一致
}

type AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemOrderDetail

type AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemOrderDetail struct {
	Status     string `json:"Status"`     // 默认传 2
	SwanSchema string `json:"SwanSchema"` // 售后订单跳转地址,用以小程序跳转 Scheme
}

type AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefund

type AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefund struct {
	Amount  int64                                                                  `json:"Amount"`  // 退款总金额(单位:分),即100为1元。
	Product []AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefundProductItem `json:"Product"` // 售后商品列表
}

type AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefundProductItem

type AddOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefundProductItem struct {
	Amount   int64  `json:"Amount"`   // 退款金额(单位:分),即100为1元
	ID       string `json:"ID"`       // 商品 ID
	Quantity int64  `json:"Quantity"` // 售后商品数量
}

type AddOrderSubInfoResponse

type AddOrderSubInfoResponse struct {
	Data      []AddOrderSubInfoResponsedataItem `json:"data"`       // 响应对象
	Errno     int64                             `json:"errno"`      // 错误码
	ErrMsg    string                            `json:"msg"`        // 错误信息
	ErrorCode int64                             `json:"error_code"` // openapi 错误码
	ErrorMsg  string                            `json:"error_msg"`  // openapi 错误信息
}

type AddOrderSubInfoResponsedataItem

type AddOrderSubInfoResponsedataItem struct {
	BizAppID     string `json:"biz_app_id"`    // POST 请求参数中 BizAPPID
	CateID       string `json:"cate_id"`       // POST 请求参数中 CateID
	ResourceID   string `json:"resource_id"`   // POST 请求参数中 ResourceID
	RowsAffected string `json:"rows_affected"` // 请求受影响行数(即请求是否成功, 0 为失败,非 0 为成功)
}

func AddOrderSubInfo

func AddOrderSubInfo(params *AddOrderSubInfoRequest) ([]AddOrderSubInfoResponsedataItem, error)

AddOrderSubInfo

type AddTemplateRequest

type AddTemplateRequest struct {
	AccessToken   string // 接口调用凭证
	ID            string // 模板标题 id
	KeywordIDList string // 模板关键词 id 列表,如[1,2,3]
}

AddTemplateRequest 请求结构体

type AddTemplateResponse

type AddTemplateResponse struct {
	Data      AddTemplateResponsedata `json:"data"`       // 响应对象
	Errno     int64                   `json:"errno"`      // 错误码
	ErrMsg    string                  `json:"msg"`        // 错误信息
	ErrorCode int64                   `json:"error_code"` // openapi 错误码
	ErrorMsg  string                  `json:"error_msg"`  // openapi 错误信息
}

type AddTemplateResponsedata

type AddTemplateResponsedata struct {
	TemplateID string `json:"template_id"` // 添加至帐号下的模板 id ,发送小程序模板消息时所需
}

func AddTemplate

func AddTemplate(params *AddTemplateRequest) (*AddTemplateResponsedata, error)

AddTemplate

type ApplyOrderRefundRequest

type ApplyOrderRefundRequest struct {
	AccessToken      string // 接口调用凭证
	ApplyRefundMoney int64  // 退款金额(单位:分),该字段最大不能超过支付回调中的总金额(totalMoney)
	BizRefundBatchID string // 开发者退款批次
	IsSkipAudit      int64  // 是否跳过审核,不需要百度请求开发者退款审核请传 1,默认为0
	OrderID          int64  // 百度收银台订单 ID
	RefundReason     string // 退款原因
	RefundType       int64  // 退款类型 1:用户发起退款;2:开发者业务方客服退款;3:开发者服务异常退款。
	TpOrderID        string // 开发者订单 ID
	UserID           int64  // 百度收银台用户 ID
	RefundNotifyURL  string // 退款通知 url ,不传时默认为在开发者后台配置的 url
	PmAppKey         string // 调起百度收银台的支付服务 appKey
}

ApplyOrderRefundRequest 请求结构体

type ApplyOrderRefundResponse

type ApplyOrderRefundResponse struct {
	Data      ApplyOrderRefundResponsedata `json:"data"`       // 响应对象
	Errno     int64                        `json:"errno"`      // 错误码
	ErrMsg    string                       `json:"msg"`        // 错误信息
	ErrorCode int64                        `json:"error_code"` // openapi 错误码
	ErrorMsg  string                       `json:"error_msg"`  // openapi 错误信息
}

type ApplyOrderRefundResponsedata

type ApplyOrderRefundResponsedata struct {
	RefundBatchID  string `json:"refundBatchId"`  // 平台退款批次号
	RefundPayMoney int64  `json:"refundPayMoney"` // 平台可退退款金额【分为单位】
}

func ApplyOrderRefund

func ApplyOrderRefund(params *ApplyOrderRefundRequest) (*ApplyOrderRefundResponsedata, error)

ApplyOrderRefund

type BatchGetCouponBannerRequest

type BatchGetCouponBannerRequest struct {
	AccessToken string // 接口调用凭证
	CouponID    string // 卡券 ID
}

BatchGetCouponBannerRequest 请求结构体

type BatchGetCouponBannerResponse

type BatchGetCouponBannerResponse struct {
	Data      BatchGetCouponBannerResponsedata `json:"data"`       // 响应对象
	Errno     int64                            `json:"errno"`      // 错误码
	ErrMsg    string                           `json:"msg"`        // 错误信息
	ErrorCode int64                            `json:"error_code"` // openapi 错误码
	ErrorMsg  string                           `json:"error_msg"`  // openapi 错误信息
}

type BatchGetCouponBannerResponsedata

type BatchGetCouponBannerResponsedata struct {
	DataList []BatchGetCouponBannerResponsedatadataListItem `json:"dataList"` // 响应卡券数据数组
	PageNo   int64                                          `json:"pageNo"`   // 响应数据页数
	Total    int64                                          `json:"total"`    // 响应数据量
}

func BatchGetCouponBanner

func BatchGetCouponBanner(params *BatchGetCouponBannerRequest) (*BatchGetCouponBannerResponsedata, error)

BatchGetCouponBanner

type BatchGetCouponBannerResponsedatadataListItem

type BatchGetCouponBannerResponsedatadataListItem struct {
	AppRedirectPath string `json:"appRedirectPath"` // banner 图跳转的小程序页面路径
	BannerID        int64  `json:"bannerId"`        // 卡券 banner 记录 id
	CouponID        string `json:"couponId"`        // 卡券 id
	CreateTime      int64  `json:"createTime"`      // 卡券创建时间
	PicURL          string `json:"picUrl"`          // 卡券图片推广图链接地址
	Title           string `json:"title"`           // 卡券图片推广图标题
	UpdateTime      int64  `json:"updateTime"`      // 卡券更新时间
}

type BatchGetCouponRequest

type BatchGetCouponRequest struct {
	AccessToken string // 接口调用凭证
}

BatchGetCouponRequest 请求结构体

type BatchGetCouponResponse

type BatchGetCouponResponse struct {
	Data      BatchGetCouponResponsedata `json:"data"`       // 响应对象
	Errno     int64                      `json:"errno"`      // 错误码
	ErrMsg    string                     `json:"msg"`        // 错误信息
	ErrorCode int64                      `json:"error_code"` // openapi 错误码
	ErrorMsg  string                     `json:"error_msg"`  // openapi 错误信息
}

type BatchGetCouponResponsedata

type BatchGetCouponResponsedata struct {
	DataList []BatchGetCouponResponsedatadataListItem `json:"dataList"` // 卡券信息数组
	PageNo   int64                                    `json:"pageNo"`   // 页码
	Total    int64                                    `json:"total"`    // 总数量
}

func BatchGetCoupon

func BatchGetCoupon(params *BatchGetCouponRequest) (*BatchGetCouponResponsedata, error)

BatchGetCoupon

type BatchGetCouponResponsedatadataListItem

type BatchGetCouponResponsedatadataListItem struct {
	BaseInfo    BatchGetCouponResponsedatadataListItembaseInfo `json:"baseInfo"`    // 基本的卡券数据,所有卡券通用。
	CallbackURL string                                         `json:"callbackUrl"` // 卡券领取事件推送地址
	CouponType  string                                         `json:"couponType"`  // 卡券类型
	Description string                                         `json:"description"` // 使用须知:卡券使用方法的介绍
	Discount    int64                                          `json:"discount"`    // 折扣券专用,表示打折力度(格式为百分比),填 80 就是八折。
}

type BatchGetCouponResponsedatadataListItembaseInfo

type BatchGetCouponResponsedatadataListItembaseInfo struct {
	Color    string                                                 `json:"color"`    // 卡券背景色
	DateInfo BatchGetCouponResponsedatadataListItembaseInfodateInfo `json:"dateInfo"` // 使用日期,有效期的信息
	GetLimit int64                                                  `json:"getLimit"` // 每人领取次数限制
	Title    string                                                 `json:"title"`    // 优惠券名称
}

type BatchGetCouponResponsedatadataListItembaseInfodateInfo

type BatchGetCouponResponsedatadataListItembaseInfodateInfo struct {
	BeginTimestamp    int64 `json:"beginTimestamp"`    // 使用开始时间,当 type 为 1 时,beginTimestamp 必传且生效;
	EndTimestamp      int64 `json:"endTimestamp"`      // 使用结束时间,当 type 为 1 时,endTimestamp 必传且生效;
	GetEndTimestamp   int64 `json:"getEndTimestamp"`   // 结束领取时间
	GetStartTimestamp int64 `json:"getStartTimestamp"` // 开始领取时间
	TimeUnit          int64 `json:"timeUnit"`          // 时间单位:1-时;2-天;3-月;当 type 为 2 时,timeUnit 必传且生效;
	TimeValue         int64 `json:"timeValue"`         // 时间值;当 type 为 2 时,timeValue 必传且生效;
	Type              int64 `json:"type"`              // 券使用时间类型: 1:开发者设置使用开始和结束时间,此时,beginTimestamp 和 endTimestamp 必传。 2:领取之后,多久可使用,此时,timeUnit 和 timeValue 必传。相对时间:当规定领取 5 日后失效,10 月 1 日 23:00 领取后,10 月 6 日 23:00 失效。 4:领取之后,多久(自然日)失效,此时,timeUnit 和 timeValue 必传,timeUnit 只能设置为天(timeUnit=2)。自然相对时间:当规定领取 5 个自然日后失效,10 月 1 日 23:00 领取后,10 月 6 日 00:00 失效。
}

type BatchUploadCouponCodeRequest

type BatchUploadCouponCodeRequest struct {
	AccessToken string // 接口调用凭证
	CouponID    string // 卡券 ID
	CouponCodes string // 卡券 Code 码列表
}

BatchUploadCouponCodeRequest 请求结构体

type BatchUploadCouponCodeResponse

type BatchUploadCouponCodeResponse struct {
	Data      BatchUploadCouponCodeResponsedata `json:"data"`       // 响应对象
	Errno     int64                             `json:"errno"`      // 错误码
	ErrMsg    string                            `json:"msg"`        // 错误信息
	ErrorCode int64                             `json:"error_code"` // openapi 错误码
	ErrorMsg  string                            `json:"error_msg"`  // openapi 错误信息
}

type BatchUploadCouponCodeResponsedata

type BatchUploadCouponCodeResponsedata struct {
	FailNum    string `json:"failNum"`    // 请求失败数量
	SuccessNum string `json:"successNum"` // 请求成功数量
}

func BatchUploadCouponCode

func BatchUploadCouponCode(params *BatchUploadCouponCodeRequest) (*BatchUploadCouponCodeResponsedata, error)

BatchUploadCouponCode

type CancelOrderRequest

type CancelOrderRequest struct {
	AccessToken string // 接口调用凭证
	OrderID     int64  // 百度订单 ID
	PmAppKey    string // 调起百度收银台的支付服务 appKey
}

CancelOrderRequest 请求结构体

type CancelOrderResponse

type CancelOrderResponse struct {
	Data      bool   `json:"data"`       // 响应对象
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type CapitaBillRequest

type CapitaBillRequest struct {
	AccessToken string // 接口调用凭证
	BillTime    string // 对账单日期格式 yyyy-MM-dd
	PmAppKey    string // 调起百度收银台的支付服务 appKey
}

CapitaBillRequest 请求结构体

type CapitaBillResponse

type CapitaBillResponse struct {
	Data      CapitaBillResponsedata `json:"data"`       // 响应对象
	Errno     int64                  `json:"errno"`      // 错误码
	ErrMsg    string                 `json:"msg"`        // 错误信息
	ErrorCode int64                  `json:"error_code"` // openapi 错误码
	ErrorMsg  string                 `json:"error_msg"`  // openapi 错误信息
}

type CapitaBillResponsedata

type CapitaBillResponsedata struct {
	Data       []CapitaBillResponsedatadataItem `json:"data"`       // 响应对象
	TotalCount int64                            `json:"totalCount"` // 总数
}

func CapitaBill

func CapitaBill(params *CapitaBillRequest) (*CapitaBillResponsedata, error)

CapitaBill

type CapitaBillResponsedatadataItem

type CapitaBillResponsedatadataItem struct {
	CreateTime   string `json:"createTime"`   // 创建时间
	DownloadName string `json:"downloadName"` // 账单名称
	ExportStatus int64  `json:"exportStatus"` // 导出进度
	URL          string `json:"url"`          // 下载地址
}

type CheckImageRequest

type CheckImageRequest struct {
	AccessToken string                // 接口调用凭据
	Image       CheckImageRequestFile // 图片文件,只支持 PNG、JPG、JPEG 三种格式,且文件大小不能超过 5MB
	Type        string                // 检测策略,porn 为色情检测,ocr-word 为图片上文字的词表检测,ocr-lead 为图片上文字的诱导检测。可以多选,多个值之间用英文逗号拼接,不传默认为 porn,参数值区分大小写
}

CheckImageRequest 请求结构体

type CheckImageRequestFile

type CheckImageRequestFile struct {
	Name   string
	Reader io.Reader
}

type CheckImageResponse

type CheckImageResponse struct {
	Data      CheckImageResponsedata `json:"data"`       // 响应对象
	Errno     int64                  `json:"errno"`      // 错误码
	ErrMsg    string                 `json:"msg"`        // 错误信息
	ErrorCode int64                  `json:"error_code"` // openapi 错误码
	ErrorMsg  string                 `json:"error_msg"`  // openapi 错误信息
}

type CheckImageResponsedata

type CheckImageResponsedata struct {
	Res        []CheckImageResponsedataresItem `json:"res"`        // 是一个对象数组,返回每一种检测策略的结果
	RetrieveID string                          `json:"retrieveId"` // 调用误判反馈接口时需要该返回值
}

func CheckImage

func CheckImage(params *CheckImageRequest) (*CheckImageResponsedata, error)

CheckImage

type CheckImageResponsedataresItem

type CheckImageResponsedataresItem struct {
	Errno int64  `json:"errno"` // 错误码
	Msg   string `json:"msg"`   // 错误信息
	Type  string `json:"type"`  // 检测策略
}

type CheckPathRequest

type CheckPathRequest struct {
	AccessToken string   // 接口调用凭据
	Path        string   // 需要检测的页面 path(一次请求一个 path),path 字符数不能超过 2460
	Type        []string // 检测策略,risk 为 url 里文字的内容违规检测,porn 为图片色情检测,ocr-word 为图片上文字的词表检测,ocr-lead 为图片上文字的诱导模型检测。可以多选,不传默认为 risk,参数值区分大小写
}

CheckPathRequest 请求结构体

type CheckPathResponse

type CheckPathResponse struct {
	Data      string `json:"data"`       // 唯一标识 retrieveId,可用于精确查询检测结果、反馈误判
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type CheckTextRequest

type CheckTextRequest struct {
	AccessToken string   // 接口调用凭据
	Content     string   // 检测文本,文本的字节数不能超过 10KB
	Type        []string // 检测策略,risk 为内容违规检测,lead 为诱导违规检测。可以多选,不传默认为 risk,参数值区分大小写
}

CheckTextRequest 请求结构体

type CheckTextResponse

type CheckTextResponse struct {
	Data      CheckTextResponsedata `json:"data"`       // 响应对象
	Errno     int64                 `json:"errno"`      // 错误码
	ErrMsg    string                `json:"msg"`        // 错误信息
	ErrorCode int64                 `json:"error_code"` // openapi 错误码
	ErrorMsg  string                `json:"error_msg"`  // openapi 错误信息
}

type CheckTextResponsedata

type CheckTextResponsedata struct {
	Res        []CheckTextResponsedataresItem `json:"res"`        // 是一个对象数组,返回每一种检测策略的结果
	RetrieveID string                         `json:"retrieveId"` // 调用误判反馈接口时需要该返回值
}

func CheckText

func CheckText(params *CheckTextRequest) (*CheckTextResponsedata, error)

CheckText

type CheckTextResponsedataresItem

type CheckTextResponsedataresItem struct {
	Errno int64  `json:"errno"` // 错误码
	Msg   string `json:"msg"`   // 错误信息
	Type  string `json:"type"`  // 检测策略
}

type ConsumeCouponCodeRequest

type ConsumeCouponCodeRequest struct {
	AccessToken  string // 接口调用凭证
	CouponID     string // 卡券 ID
	OpenID       string // 用户 ID
	CouponTakeID int64  // 百度分配的用户领取 id
}

ConsumeCouponCodeRequest 请求结构体

type ConsumeCouponCodeResponse

type ConsumeCouponCodeResponse struct {
	Data      bool   `json:"data"`       // true 退还成功 false 退还失败
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type CreateCouponRequest

type CreateCouponRequest struct {
	AccessToken string                      // 接口调用凭证
	Description string                      // 使用须知:卡券使用方法的介绍
	CallbackURL string                      // 卡券领取事件推送地址
	CouponType  string                      // 卡券类型,当以上卡券类型无法满足时,可使用通用优惠券类型
	LeastCost   int64                       // 表示可使用的门槛金额(单位:分),不传默认为 0,即无起用门槛
	ReduceCost  int64                       // 代金券专用,表示减免金额(单位:分)
	Discount    string                      // 折扣券专用,表示打折力度(格式为百分比),填 80 就是八折。
	BaseInfo    CreateCouponRequestbaseInfo // 基本的卡券数据,所有卡券通用。
}

CreateCouponRequest 请求结构体

type CreateCouponRequestbaseInfo

type CreateCouponRequestbaseInfo struct {
	AppRedirectPath string                              `json:"appRedirectPath"` // 已领取的卡券,从详情頁点击「立即使用」打开小程序页面地址,不传默认打开首页
	CodeType        int64                               `json:"codeType"`        // 卡券 Code 码类型,默认为 1,1:开发者自定义 code 码,当 codeType=1 时,需要通过「上传 code 码」接口导入 Code,否则影响领券;2:系统分配 Code 码,当 codeType=2 时,开发者无需上传 Code ,quantity 要求必传非 0 且生效
	Color           string                              `json:"color"`           // 卡券背景色,支持范围: [B010 ~ B160]
	DateInfo        CreateCouponRequestbaseInfodateInfo `json:"dateInfo"`        // 有效期信息
	GetLimit        int64                               `json:"getLimit"`        // 使用日期,有效期的信息。
	Quantity        int64                               `json:"quantity"`        // 卡券库存,默认为 0,当 codeType=2 时,quantity 要求必传且生效
	Title           string                              `json:"title"`           // 优惠券名称,最多 15 字
}

type CreateCouponRequestbaseInfodateInfo

type CreateCouponRequestbaseInfodateInfo struct {
	BeginTimestamp    int64 `json:"beginTimestamp"`    // 使用开始时间,当 type 为 1 时,beginTimestamp 必传且生效;
	EndTimestamp      int64 `json:"endTimestamp"`      // 使用结束时间,当 type 为 1 时,endTimestamp 必传且生效;
	GetEndTimestamp   int64 `json:"getEndTimestamp"`   // 结束领取时间
	GetStartTimestamp int64 `json:"getStartTimestamp"` // 开始领取时间
	TimeUnit          int64 `json:"timeUnit"`          // 时间单位:1-时;2-天;3-月;当 type 为 2 时,timeUnit 必传且生效;
	TimeValue         int64 `json:"timeValue"`         // 时间值;当 type 为 2 时,timeValue 必传且生效;
	Type              int64 `json:"type"`              // 券使用时间类型: 1:开发者设置使用开始和结束时间,此时,beginTimestamp 和 endTimestamp 必传。 2:领取之后,多久可使用,此时,timeUnit 和 timeValue 必传。相对时间:当规定领取 5 日后失效,10 月 1 日 23:00 领取后,10 月 6 日 23:00 失效。 4:领取之后,多久(自然日)失效,此时,timeUnit 和 timeValue 必传,timeUnit 只能设置为天(timeUnit=2)。自然相对时间:当规定领取 5 个自然日后失效,10 月 1 日 23:00 领取后,10 月 6 日 00:00 失效。
}

type CreateCouponResponse

type CreateCouponResponse struct {
	Data      CreateCouponResponsedata `json:"data"`       // 响应对象
	Errno     int64                    `json:"errno"`      // 错误码
	ErrMsg    string                   `json:"msg"`        // 错误信息
	ErrorCode int64                    `json:"error_code"` // openapi 错误码
	ErrorMsg  string                   `json:"error_msg"`  // openapi 错误信息
}

type CreateCouponResponsedata

type CreateCouponResponsedata struct {
	CouponID string `json:"couponId"` // 卡券 ID
}

func CreateCoupon

func CreateCoupon(params *CreateCouponRequest) (*CreateCouponResponsedata, error)

CreateCoupon

type CustomSendRequest

type CustomSendRequest struct {
	AccessToken string // 接口调用凭证
	UserType    int64  // 1:游客登录 2:百度账号登录
	OpenID      string // 用户的 OpenID
	MsgType     string // 消息类型 text:文本格式 image:图片链接
	Content     string // 文本消息内容,msg_type ="text" 时必填
	PicURL      string // 图片消息,msg_type ="image" 时必填
}

CustomSendRequest 请求结构体

type CustomSendResponse

type CustomSendResponse struct {
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type CustomSendResponsedata

type CustomSendResponsedata struct {
	Errno int64
	Msg   string
}

响应结构体 响应结构体

func CustomSend

func CustomSend(params *CustomSendRequest) (*CustomSendResponsedata, error)

CustomSend

type DeleteCouponBannerRequest

type DeleteCouponBannerRequest struct {
	AccessToken string // 接口调用凭证
	CouponID    string // 卡券 ID
	BannerID    int64  // 卡券 banner 记录 id
}

DeleteCouponBannerRequest 请求结构体

type DeleteCouponBannerResponse

type DeleteCouponBannerResponse struct {
	Data      bool   `json:"data"`       // true 退还成功 false 退还失败
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type DeleteCouponRequest

type DeleteCouponRequest struct {
	AccessToken string // 接口调用凭证
	CouponID    string // 卡券 ID
}

DeleteCouponRequest 请求结构体

type DeleteCouponResponse

type DeleteCouponResponse struct {
	Data      bool   `json:"data"`       // true 退还成功 false 退还失败
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type DeleteMaterialRequest

type DeleteMaterialRequest struct {
	AccessToken string // 接口调用凭证
	AppID       int64  // app_id
	ID          int64  // 物料 id ,添加物料时返回 id
	Path        string // 智能小程序内页链接,取值为添加物料时返回的 path
}

DeleteMaterialRequest 请求结构体

type DeleteMaterialResponse

type DeleteMaterialResponse struct {
	Data      bool   `json:"data"`       // true:代表修改成功,false:代码修改失败
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type DeleteResourceRequest

type DeleteResourceRequest struct {
	AccessToken string // 接口调用凭证
	AppID       int64  // app_id
	Path        string // 智能小程序内页链接
}

DeleteResourceRequest 请求结构体

type DeleteResourceResponse

type DeleteResourceResponse struct {
	Data      bool   `json:"data"`       // 响应参数
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type DeleteSitemapRequest

type DeleteSitemapRequest struct {
	AccessToken string // 接口调用凭证
	AppID       int64  // app_id
	URL         string // sitemap 链接
}

DeleteSitemapRequest 请求结构体

type DeleteSitemapResponse

type DeleteSitemapResponse struct {
	Data      bool   `json:"data"`       // 响应参数
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type DeleteSkuCouponRequest

type DeleteSkuCouponRequest struct {
	AccessToken string // 接口调用凭证
	AppID       int64  // app_id
	PathList    string // 需要删除的资源 path 列表
}

DeleteSkuCouponRequest 请求结构体

type DeleteSkuCouponResponse

type DeleteSkuCouponResponse struct {
	Data      string `json:"data"`       // 响应对象
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type DeleteSkuRequest

type DeleteSkuRequest struct {
	AccessToken string // 接口调用凭证
	AppID       int64  // app_id
	PathList    string // 需要删除的资源 path 列表
}

DeleteSkuRequest 请求结构体

type DeleteSkuResponse

type DeleteSkuResponse struct {
	Data      string `json:"data"`       // 响应参数
	Errno     int64  `json:"errno"`      // 状态码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type DeleteTemplateRequest

type DeleteTemplateRequest struct {
	AccessToken string // 接口调用凭证
	TemplateID  string // 模板 id ,发送小程序模板消息时所需
}

DeleteTemplateRequest 请求结构体

type DeleteTemplateResponse

type DeleteTemplateResponse struct {
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type DeleteTemplateResponsedata

type DeleteTemplateResponsedata struct {
	Errno int64
	Msg   string
}

响应结构体

func DeleteTemplate

func DeleteTemplate(params *DeleteTemplateRequest) (*DeleteTemplateResponsedata, error)

DeleteTemplate

type DetectRiskRequest

type DetectRiskRequest struct {
	AccessToken string // 接口调用凭证
	Appkey      string // 小程序 appkey,智能小程序 AppKey
	Xtoken      string // 小程序通过swan-getSystemRiskInfo获取的内容,格式:{"key":"xxxx","value":"xxxx"}
	Type        string // 运营活动的类型,该值由风控平台分配。目前只有一种 marketing
	Clientip    string // 客户端的 IP,非小程序服务本地 IP
	Ts          int64  // 服务器的时间戳,秒级别
	Ev          string // 事件类型,预先分配事件 ID 定义。1、点击活动按钮(或者活动操作),活动相关操作默认选择此事件;2、 进入活动页面;3、注册;4、登录;5、分享;6、点赞;7、评论;8、 提现;9、下单/提单;10、支付;11、业务自定义动作;12、浏览 feed;13、开宝箱;14、领取红包;15、分享 feed;16、做任务;17、签到;18、排行榜;19、邀请;20、新客红包;21、摇一摇;22、语音红包;23、视频红包;24、金融授信;25、答题
	Useragent   string // 客户端请求小程序 Server 的 useragent,示例:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36
	Phone       string // 加密后的电话号码,加密方法:sha1
}

DetectRiskRequest 请求结构体

type DetectRiskResponse

type DetectRiskResponse struct {
	Data      DetectRiskResponsedata `json:"data"`       // 响应对象
	ErrMsg    string                 `json:"msg"`        // 错误信息
	Errno     int64                  `json:"errno"`      // 错误码 0:正确返回,非 0:异常返回
	RequestID string                 `json:"request_id"` // 请求 ID,标识一次请求
	Timestamp int64                  `json:"timestamp"`  // 时间戳
	ErrorCode int64                  `json:"error_code"` // openapi 错误码
	ErrorMsg  string                 `json:"error_msg"`  // openapi 错误信息
}

type DetectRiskResponsedata

type DetectRiskResponsedata struct {
	Level string   `json:"level"` // 风险级别,目前有四个,风险等级依次降低(其中 1 最高,4 最低) 1 - 高危;2 - 嫌疑;3 - 普通;4 - 正常。 建议开发者将风险等级为 1、2 的做拦截处理
	Tag   []string `json:"tag"`   // 对应的描述
}

func DetectRisk

func DetectRisk(params *DetectRiskRequest) (*DetectRiskResponsedata, error)

DetectRisk

type FindByTpOrderIDRequest

type FindByTpOrderIDRequest struct {
	AccessToken string // 接口调用凭证
	TpOrderID   string // 开发者订单 ID
	PmAppKey    string // 调起百度收银台的支付服务 appKey
}

FindByTpOrderIDRequest 请求结构体

type FindByTpOrderIDResponse

type FindByTpOrderIDResponse struct {
	Data      FindByTpOrderIDResponsedata `json:"data"`       // 响应对象
	Errno     int64                       `json:"errno"`      // 错误码
	ErrMsg    string                      `json:"msg"`        // 错误信息
	ErrorCode int64                       `json:"error_code"` // openapi 错误码
	ErrorMsg  string                      `json:"error_msg"`  // openapi 错误信息
}

type FindByTpOrderIDResponsedata

type FindByTpOrderIDResponsedata struct {
	AppID         int64  `json:"appId"`         // 小程序appid
	AppKey        int64  `json:"appKey"`        // 小程序appkey
	BizInfo       string `json:"bizInfo"`       // 业务扩展字段
	Count         int64  `json:"count"`         // 数量
	CreateTime    int64  `json:"createTime"`    // 创建时间
	DealID        int64  `json:"dealId"`        // 跳转百度收银台支付必带参数之一
	OpenID        int64  `json:"openId"`        // 小程序用户id
	OrderID       int64  `json:"orderId"`       // 百度订单 ID
	OriPrice      int64  `json:"oriPrice"`      // 原价
	ParentOrderID int64  `json:"parentOrderId"` // 购物车订单父订单ID
	ParentType    int64  `json:"parentType"`    // 订单类型
	PayMoney      int64  `json:"payMoney"`      // 支付金额
	SettlePrice   int64  `json:"settlePrice"`   // 结算金额
	Status        int64  `json:"status"`        // 订单状态 1未支付 2已支付
	SubStatus     int64  `json:"subStatus"`     // 订单子状态
	TotalMoney    int64  `json:"totalMoney"`    // 总金额
	TpID          int64  `json:"tpId"`          // tpid
	TpOrderID     string `json:"tpOrderId"`     // 开发者订单ID
	TradeNo       string `json:"tradeNo"`       // 支付单号
	Type          int64  `json:"type"`          // ordertype
	UserID        int64  `json:"userId"`        // 用户 id 与支付状态通知中的保持一致
}

func FindByTpOrderID

func FindByTpOrderID(params *FindByTpOrderIDRequest) (*FindByTpOrderIDResponsedata, error)

FindByTpOrderID

type FindOrderRefundRequest

type FindOrderRefundRequest struct {
	AccessToken string // 接口调用凭证
	TpOrderID   string // 开发者订单 ID
	UserID      int64  // 百度收银台用户 ID
	PmAppKey    string // 调起百度收银台的支付服务 appKey
}

FindOrderRefundRequest 请求结构体

type FindOrderRefundResponse

type FindOrderRefundResponse struct {
	Data      []FindOrderRefundResponsedataItem `json:"data"`       // 响应对象
	Errno     int64                             `json:"errno"`      // 错误码
	ErrMsg    string                            `json:"msg"`        // 错误信息
	ErrorCode int64                             `json:"error_code"` // openapi 错误码
	ErrorMsg  string                            `json:"error_msg"`  // openapi 错误信息
}

type FindOrderRefundResponsedataItem

type FindOrderRefundResponsedataItem struct {
	BizRefundBatchID string `json:"bizRefundBatchId"` // 开发者退款批次id
	OrderID          int64  `json:"orderId"`          // 退款订单号
	RefundBatchID    int64  `json:"refundBatchId"`    // 退款批次id
	RefundStatus     int64  `json:"refundStatus"`     // 退款状态 1 退款中 2 退款成功 3 退款失败
	UserID           int64  `json:"userId"`           // 退款用户id
}

func FindOrderRefund

func FindOrderRefund(params *FindOrderRefundRequest) ([]FindOrderRefundResponsedataItem, error)

FindOrderRefund

type GetAccessTokenRequest

type GetAccessTokenRequest struct {
	GrantType    string // 固定为:client_credentials
	ClientID     string // 智能小程序的 App Key,可在「开发者平台 - 设置 - 开发设置」页中获得。(要先在开发者平台创建小程序)
	ClientSecret string // 智能小程序的 App Secret,请妥善保存,如丢失可在「开发者平台 - 设置 - 开发设置」页面重置后获得,重置后 App Secret 将会被更新。
	Scope        string // 固定为:smartapp_snsapi_base
}

GetAccessTokenRequest 请求结构体

type GetAccessTokenResponse

type GetAccessTokenResponse struct {
	AccessToken      string `json:"access_token"`      // 获取到的凭证
	Error            string `json:"error"`             // 异常提示信息
	ErrorDescription string `json:"error_description"` // 异常情况详细的提示信息
	ExpiresIn        int64  `json:"expires_in"`        // 凭证有效时间,单位:秒
	ErrorCode        int64  `json:"error_code"`        // openapi 错误码
	ErrorMsg         string `json:"error_msg"`         // openapi 错误信息
}

type GetAccessTokenResponsedata

type GetAccessTokenResponsedata struct {
	AccessToken string
	ExpiresIn   int64
}

响应结构体

func GetAccessToken

func GetAccessToken(params *GetAccessTokenRequest) (*GetAccessTokenResponsedata, error)

GetAccessToken

type GetCommentCountRequest

type GetCommentCountRequest struct {
	AccessToken string // 接口调用凭证
	Snid        string // 文章的 ID
	SnidType    string // 无 snid_type 的开发者请默认传空串
}

GetCommentCountRequest 请求结构体

type GetCommentCountResponse

type GetCommentCountResponse struct {
	Data      GetCommentCountResponsedata `json:"data"`       // 互动评论数详细结果
	Errno     int64                       `json:"errno"`      // 错误码,正常返回情况下,errno 值为 0
	ErrMsg    string                      `json:"msg"`        // 错误信息
	RequestID string                      `json:"request_id"` // 请求 ID,标识一次请求
	ErrorCode int64                       `json:"error_code"` // openapi 错误码
	ErrorMsg  string                      `json:"error_msg"`  // openapi 错误信息
}

type GetCommentCountResponsedata

type GetCommentCountResponsedata struct {
	CommentCount string `json:"comment_count"` // 评论数
}

func GetCommentCount

func GetCommentCount(params *GetCommentCountRequest) (*GetCommentCountResponsedata, error)

GetCommentCount

type GetCommentListRequest

type GetCommentListRequest struct {
	AccessToken string // 接口调用凭证
	HostName    string // 宿主名称
	Snid        string // 文章的 ID
	SnidType    string // 无 snid_type 的开发者请默认传空串
	Start       int64  // 评论的开始偏移量,默认0
	Num         int64  // 获取的评论条数,默认10
}

GetCommentListRequest 请求结构体

type GetCommentListResponse

type GetCommentListResponse struct {
	Data      GetCommentListResponsedata `json:"data"`       // 响应对象
	Errno     int64                      `json:"errno"`      // 错误码
	ErrMsg    string                     `json:"msg"`        // 错误信息
	RequestID string                     `json:"request_id"` // 请求 ID,标识一次请求
	ErrorCode int64                      `json:"error_code"` // openapi 错误码
	ErrorMsg  string                     `json:"error_msg"`  // openapi 错误信息
}

type GetCommentListResponsedata

type GetCommentListResponsedata struct {
	List []GetCommentListResponsedatalistItem `json:"list"` // 评论列表
}

func GetCommentList

func GetCommentList(params *GetCommentListRequest) (*GetCommentListResponsedata, error)

GetCommentList

type GetCommentListResponsedatalistItem

type GetCommentListResponsedatalistItem struct {
	Content    string                                            `json:"content"`     // 评论内容
	CreateTime string                                            `json:"create_time"` // 发表时间
	IsUped     string                                            `json:"is_uped"`     // 点赞状态 1:已点赞 0:未点赞
	LikeCount  string                                            `json:"like_count"`  // 点赞数
	ReplyList  []GetCommentListResponsedatalistItemreplyListItem `json:"reply_list"`  // 回复列表
	Srid       string                                            `json:"srid"`        // 评论ID
	ThreadID   string                                            `json:"thread_id"`   // 主题ID
}

type GetCommentListResponsedatalistItemreplyListItem

type GetCommentListResponsedatalistItemreplyListItem struct {
	Content    string `json:"content"`     // 回复内容
	CreateTime string `json:"create_time"` // 发表时间
	IsUped     string `json:"is_uped"`     // 点赞状态 1:已点赞 0:未点赞
	LikeCount  string `json:"like_count"`  // 点赞数
}

type GetCouponBannerRequest

type GetCouponBannerRequest struct {
	AccessToken string // 接口调用凭证
	CouponID    string // 卡券 ID
	BannerIds   string // 卡券 banner 记录 id
}

GetCouponBannerRequest 请求结构体

type GetCouponBannerResponse

type GetCouponBannerResponse struct {
	Data      []GetCouponBannerResponsedataItem `json:"data"`       // 卡券数组
	Errno     int64                             `json:"errno"`      // 错误码
	ErrMsg    string                            `json:"msg"`        // 错误信息
	ErrorCode int64                             `json:"error_code"` // openapi 错误码
	ErrorMsg  string                            `json:"error_msg"`  // openapi 错误信息
}

type GetCouponBannerResponsedataItem

type GetCouponBannerResponsedataItem struct {
	AppRedirectPath string `json:"appRedirectPath"` // banner 图跳转的小程序页面路径
	BannerID        int64  `json:"bannerId"`        // 卡券 banner 记录 id
	CouponID        string `json:"couponId"`        // 卡券 ID
	CreateTime      int64  `json:"createTime"`      // 卡券创建时间
	PicURL          string `json:"picUrl"`          // 卡券 banner 图片
	Title           string `json:"title"`           // 卡券 banner 图标题
	UpdateTime      int64  `json:"updateTime"`      // 卡券更新事件
}

func GetCouponBanner

func GetCouponBanner(params *GetCouponBannerRequest) ([]GetCouponBannerResponsedataItem, error)

GetCouponBanner

type GetCouponRequest

type GetCouponRequest struct {
	AccessToken string // 接口调用凭证
	CouponID    string // 卡券 ID
}

GetCouponRequest 请求结构体

type GetCouponResponse

type GetCouponResponse struct {
	Data      GetCouponResponsedata `json:"data"`       // 响应对象
	Errno     int64                 `json:"errno"`      // 错误码
	ErrMsg    string                `json:"msg"`        // 错误信息
	ErrorCode int64                 `json:"error_code"` // openapi 错误码
	ErrorMsg  string                `json:"error_msg"`  // openapi 错误信息
}

type GetCouponResponsedata

type GetCouponResponsedata struct {
	BaseInfo    GetCouponResponsedatabaseInfo `json:"baseInfo"`    // 基本的卡券数据,所有卡券通用
	CallbackURL string                        `json:"callbackUrl"` // 卡券领取事件推送地址
	CouponID    string                        `json:"couponId"`    // 卡券 ID
	CouponType  string                        `json:"couponType"`  // 卡券类型
	Description string                        `json:"description"` // 使用须知:卡券使用方法的介绍
	Discount    int64                         `json:"discount"`    // 折扣券专用,表示打折力度(格式为百分比),填 80 就是八折是
}

func GetCoupon

func GetCoupon(params *GetCouponRequest) (*GetCouponResponsedata, error)

GetCoupon

type GetCouponResponsedatabaseInfo

type GetCouponResponsedatabaseInfo struct {
	AppRedirectPath string                                `json:"appRedirectPath"` // 已领取的卡券,从详情頁点击「立即使用」打开小程序页面地址,不传默认打开首页
	CodeType        int64                                 `json:"codeType"`        // 卡券 Code 码类型,默认为 1,1:开发者自定义 code 码,当 codeType=1 时,需要通过「上传 code 码」接口导入 Code,否则影响领券;2:系统分配 Code 码,当 codeType=2 时,开发者无需上传 Code ,quantity 要求必传非 0 且生效
	Color           string                                `json:"color"`           // 卡券背景色,支持范围: [B010 ~ B160]
	DateInfo        GetCouponResponsedatabaseInfodateInfo `json:"dateInfo"`        // 使用日期,有效期的信息
	GetLimit        int64                                 `json:"getLimit"`        // 每人领取次数限制
	Quantity        int64                                 `json:"quantity"`        // 卡券库存,默认为 0,当 codeType=2 时,quantity 要求必传且生效
	Title           string                                `json:"title"`           // 优惠券名称,最多 15 字
}

type GetCouponResponsedatabaseInfodateInfo

type GetCouponResponsedatabaseInfodateInfo struct {
	BeginTimestamp    int64 `json:"beginTimestamp"`    // 使用开始时间,当 type 为 1 时,beginTimestamp 必传且生效;
	EndTimestamp      int64 `json:"endTimestamp"`      // 使用结束时间,当 type 为 1 时,endTimestamp 必传且生效;
	GetEndTimestamp   int64 `json:"getEndTimestamp"`   // 结束领取时间
	GetStartTimestamp int64 `json:"getStartTimestamp"` // 开始领取时间
	TimeUnit          int64 `json:"timeUnit"`          // 时间单位:1-时;2-天;3-月;当 type 为 2 时,timeUnit 必传且生效;
	TimeValue         int64 `json:"timeValue"`         // 时间值;当 type 为 2 时,timeValue 必传且生效;
	Type              int64 `json:"type"`              // 券使用时间类型:1:开发者设置使用开始和结束时间;2:领取之后,多久可使用;当类型为 1 时,beginTimestamp 和 endTimestamp 必传;当类型为 2 时,timeUnit 和 timeValue 必传
}

type GetLikeCountRequest

type GetLikeCountRequest struct {
	AccessToken string // 接口调用凭证
	HostName    string // 宿主名称
	Snid        string // 文章的 ID
	SnidType    string // 无 snid_type 的开发者请默认传空串
}

GetLikeCountRequest 请求结构体

type GetLikeCountResponse

type GetLikeCountResponse struct {
	Data      GetLikeCountResponsedata `json:"data"`       // 响应对象
	Errno     int64                    `json:"errno"`      // 错误码
	ErrMsg    string                   `json:"msg"`        // 错误信息
	RequestID string                   `json:"request_id"` // 请求 ID,标识一次请求
	ErrorCode int64                    `json:"error_code"` // openapi 错误码
	ErrorMsg  string                   `json:"error_msg"`  // openapi 错误信息
}

type GetLikeCountResponsedata

type GetLikeCountResponsedata struct {
	LikeCount int64 `json:"like_count"` // 点赞数
}

func GetLikeCount

func GetLikeCount(params *GetLikeCountRequest) (*GetLikeCountResponsedata, error)

GetLikeCount

type GetPathCheckResultByIDRequest

type GetPathCheckResultByIDRequest struct {
	AccessToken string // 接口调用凭据
	RetrieveID  string // 异步检测页面接口返回的唯一标识
}

GetPathCheckResultByIDRequest 请求结构体

type GetPathCheckResultByIDResponse

type GetPathCheckResultByIDResponse struct {
	Data      GetPathCheckResultByIDResponsedata `json:"data"`       // 响应对象
	Errno     int64                              `json:"errno"`      // 错误码
	ErrMsg    string                             `json:"msg"`        // 错误信息
	ErrorCode int64                              `json:"error_code"` // openapi 错误码
	ErrorMsg  string                             `json:"error_msg"`  // openapi 错误信息
}

type GetPathCheckResultByIDResponsedata

type GetPathCheckResultByIDResponsedata struct {
	CheckStatus int64                                          `json:"checkStatus"` // 检测状态,0 为初始化,1 为内容抓取,2 为检测中,3 为检测完成,4 为检测失败
	CreateTime  int64                                          `json:"createTime"`  // 创建时间戳,单位毫秒
	Detail      []GetPathCheckResultByIDResponsedatadetailItem `json:"detail"`      // 是一个对象数组,返回每一种检测策略的结果
}

func GetPathCheckResultByID

GetPathCheckResultByID

type GetPathCheckResultByIDResponsedatadetailItem

type GetPathCheckResultByIDResponsedatadetailItem struct {
	Errno   int64    `json:"errno"`   // 错误码
	HarmURL []string `json:"harmUrl"` // 违规图片的链接列表,图片相关的检测策略该字段可能会有值
	Msg     string   `json:"msg"`     // 错误信息
	Type    string   `json:"type"`    // 检测策略
}

type GetQrCodeRequest

type GetQrCodeRequest struct {
	AccessToken string // 接口调用凭证
	Path        string // 扫码进入的小程序页面路径,最大长度 4000 字节,可以为空
	Width       int64  // 二维码的宽度(单位:px)。最小 280px,最大 1280px
	Mf          int64  // 是否包含二维码内嵌 logo 标识,1001 为不包含,默认包含
	ImgFlag     int64  // 返回值选项,默认或传 1 时只返回二维码 base64 编码字符串,传 0 只返回 url
}

GetQrCodeRequest 请求结构体

type GetQrCodeResponse

type GetQrCodeResponse struct {
	Data      GetQrCodeResponsedata `json:"data"`       // 响应对象
	ErrMsg    string                `json:"msg"`        // 错误信息
	Errno     int64                 `json:"errno"`      // 错误码
	RequestID string                `json:"request_id"` // 请求 ID,标识一次请求
	Timestamp int64                 `json:"timestamp"`  // 时间戳
	ErrorCode int64                 `json:"error_code"` // openapi 错误码
	ErrorMsg  string                `json:"error_msg"`  // openapi 错误信息
}

type GetQrCodeResponsedata

type GetQrCodeResponsedata struct {
	Base64Str string `json:"base64_str"` // 二维码 base64 编码字符串
	URL       string `json:"url"`        // 小程序二维码短链
}

func GetQrCode

func GetQrCode(params *GetQrCodeRequest) (*GetQrCodeResponsedata, error)

GetQrCode

type GetSessionKeyRequest

type GetSessionKeyRequest struct {
	Code     string // 通过 swan.getLoginCode 获取 Authorization Code 特殊说明:code 中有 @ 符号时,会请求对应的开源宿主,用户身份校验及 SessionKey 生成过程由开源宿主实现
	ClientID string // 智能小程序的 AppKey
	Sk       string // 智能小程序的 AppSecret
}

GetSessionKeyRequest 请求结构体

type GetSessionKeyResponse

type GetSessionKeyResponse struct {
	Errno            int64  `json:"errno"`             // 错误码,详情见下方错误码
	ErrMsg           string `json:"msg"`               // 错误信息
	ErrorDescription string `json:"error_description"` // 错误描述信息,用来帮助理解和解决发生的错误
	Openid           string `json:"openid"`            // 用户身份标识 不同用户登录同一个小程序获取到的 openid 不同,同一个用户登录不同小程序获取到的 openid 也不同
	SessionKey       string `json:"session_key"`       // 用户的 SessionKey
	ErrorCode        int64  `json:"error_code"`        // openapi 错误码
	ErrorMsg         string `json:"error_msg"`         // openapi 错误信息
}

type GetSessionKeyResponsedata

type GetSessionKeyResponsedata struct {
	Openid     string
	SessionKey string
}

响应结构体

func GetSessionKey

func GetSessionKey(params *GetSessionKeyRequest) (*GetSessionKeyResponsedata, error)

GetSessionKey

type GetSessionKeyv2Request

type GetSessionKeyv2Request struct {
	AccessToken string // 接口调用凭证
	Code        string // 通过 swan.getLoginCode 获取 Authorization Code 特殊说明:code 中有 @ 符号时,会请求对应的开源宿主,用户身份校验及 SessionKey 生成过程由开源宿主实现
}

GetSessionKeyv2Request 请求结构体

type GetSessionKeyv2Response

type GetSessionKeyv2Response struct {
	Data      GetSessionKeyv2Responsedata `json:"data"`       // 响应对象
	ErrMsg    string                      `json:"msg"`        // 错误信息
	Errno     int64                       `json:"errno"`      // 错误码
	RequestID string                      `json:"request_id"` // 请求 id,标识一次请求
	Timestamp int64                       `json:"timestamp"`  // 时间戳
	ErrorCode int64                       `json:"error_code"` // openapi 错误码
	ErrorMsg  string                      `json:"error_msg"`  // openapi 错误信息
}

type GetSessionKeyv2Responsedata

type GetSessionKeyv2Responsedata struct {
	OpenID     string `json:"open_id"`     // 用户身份标识 不同用户登录同一个小程序获取到的 openid 不同,同一个用户登录不同小程序获取到的 openid 也不同
	SessionKey string `json:"session_key"` // 用户的 SessionKey
}

func GetSessionKeyv2

func GetSessionKeyv2(params *GetSessionKeyv2Request) (*GetSessionKeyv2Responsedata, error)

GetSessionKeyv2

type GetTemplateLibraryByIDRequest

type GetTemplateLibraryByIDRequest struct {
	AccessToken string // 接口调用凭证
	ID          string // 模板标题 id ,可通过接口获取,也可登录小程序后台查看获取
}

GetTemplateLibraryByIDRequest 请求结构体

type GetTemplateLibraryByIDResponse

type GetTemplateLibraryByIDResponse struct {
	Data      GetTemplateLibraryByIDResponsedata `json:"data"`       // 响应对象
	Errno     int64                              `json:"errno"`      // 错误码
	ErrMsg    string                             `json:"msg"`        // 错误信息
	ErrorCode int64                              `json:"error_code"` // openapi 错误码
	ErrorMsg  string                             `json:"error_msg"`  // openapi 错误信息
}

type GetTemplateLibraryByIDResponsedata

type GetTemplateLibraryByIDResponsedata struct {
	ID           string                                              `json:"id"`            // 模板标题 id
	KeywordCount int64                                               `json:"keyword_count"` // 关键字条数
	KeywordList  []GetTemplateLibraryByIDResponsedatakeywordListItem `json:"keyword_list"`  // 关键词数组,对象中包含关键词 id 、关键词内容 name 、关键词内容示例 example
	Title        string                                              `json:"title"`         // 模板标题
}

func GetTemplateLibraryByID

GetTemplateLibraryByID

type GetTemplateLibraryByIDResponsedatakeywordListItem

type GetTemplateLibraryByIDResponsedatakeywordListItem struct {
	Example   string `json:"example"`    // 关键词内容对应的示例
	KeywordID int64  `json:"keyword_id"` // 关键词 id ,添加模板时需要
	Name      string `json:"name"`       // 关键词内容
}

type GetTemplateLibraryListRequest

type GetTemplateLibraryListRequest struct {
	AccessToken string // 接口调用凭证
	Offset      int64  // 用于分页,表示从 offset 开始,默认值为 0
	Count       int64  // 用于分页,表示拉取 count 条记录,默认值为 0 ,最大为 20
}

GetTemplateLibraryListRequest 请求结构体

type GetTemplateLibraryListResponse

type GetTemplateLibraryListResponse struct {
	Data      GetTemplateLibraryListResponsedata `json:"data"`       // 响应对象
	Errno     int64                              `json:"errno"`      // 错误码
	ErrMsg    string                             `json:"msg"`        // 错误信息
	ErrorCode int64                              `json:"error_code"` // openapi 错误码
	ErrorMsg  string                             `json:"error_msg"`  // openapi 错误信息
}

type GetTemplateLibraryListResponsedata

type GetTemplateLibraryListResponsedata struct {
	List       []GetTemplateLibraryListResponsedatalistItem `json:"list"`        // 模板数组,对象中包含模板标题 id 、模板标题内容 title
	TotalCount int64                                        `json:"total_count"` // 模板库标题总数
}

func GetTemplateLibraryList

GetTemplateLibraryList

type GetTemplateLibraryListResponsedatalistItem

type GetTemplateLibraryListResponsedatalistItem struct {
	ID    string `json:"id"`    // 模板标题 id(获取模板标题下的关键词库时需要)
	Title string `json:"title"` // 模板标题内容
}

type GetTemplateListRequest

type GetTemplateListRequest struct {
	AccessToken string // 接口调用凭证
	Offset      int64  // 用于分页,表示从 offset 开始,默认值为 0
	Count       int64  // 用于分页,表示拉取 count 条记录,默认值为 0 ,最大为 20
}

GetTemplateListRequest 请求结构体

type GetTemplateListResponse

type GetTemplateListResponse struct {
	Data      GetTemplateListResponsedata `json:"data"`       // 响应对象
	Errno     int64                       `json:"errno"`      // 错误码
	ErrMsg    string                      `json:"msg"`        // 错误信息
	ErrorCode int64                       `json:"error_code"` // openapi 错误码
	ErrorMsg  string                      `json:"error_msg"`  // openapi 错误信息
}

type GetTemplateListResponsedata

type GetTemplateListResponsedata struct {
	List       []GetTemplateListResponsedatalistItem `json:"list"`        // 模板对象数组,对象中包含模板 id 、模板标题 title 、模板内容 content 、模板内容示例 example
	TotalCount int64                                 `json:"total_count"` // 模板库标题总数
}

func GetTemplateList

func GetTemplateList(params *GetTemplateListRequest) (*GetTemplateListResponsedata, error)

GetTemplateList

type GetTemplateListResponsedatalistItem

type GetTemplateListResponsedatalistItem struct {
	Content    string `json:"content"`     // 模板内容
	Example    string `json:"example"`     // 模板内容示例
	TemplateID string `json:"template_id"` // 模板 id ,发送小程序模板消息时所需
	Title      string `json:"title"`       // 模板标题
}

type GetUnionidRequest

type GetUnionidRequest struct {
	AccessToken string // 接口调用凭证
	Openid      string // 用户 openid ,需要经过用户登录授权过程获取
}

GetUnionidRequest 请求结构体

type GetUnionidResponse

type GetUnionidResponse struct {
	Data      GetUnionidResponsedata `json:"data"`       // 详细数据,errno 为 0 的情况下才有意义
	ErrMsg    string                 `json:"msg"`        // 错误信息
	Errno     int64                  `json:"errno"`      // 错误码
	RequestID string                 `json:"request_id"` // 请求 ID ,标识一次请求
	Timestamp int64                  `json:"timestamp"`  // 请求时间戳
	ErrorCode int64                  `json:"error_code"` // openapi 错误码
	ErrorMsg  string                 `json:"error_msg"`  // openapi 错误信息
}

type GetUnionidResponsedata

type GetUnionidResponsedata struct {
	Unionid string `json:"unionid"` //
}

func GetUnionid

func GetUnionid(params *GetUnionidRequest) (*GetUnionidResponsedata, error)

GetUnionid

type GetUnlimitedQrCodeRequest

type GetUnlimitedQrCodeRequest struct {
	AccessToken string // 接口调用凭证
	Path        string // 扫码进入的小程序页面路径,最大长度 4000 字节,可以为空
	Width       int64  // 二维码的宽度(单位:px)。最小 280px,最大 1280px
	Mf          int64  // 是否包含二维码内嵌 logo 标识,1001 为不包含,默认包含
	ImgFlag     int64  // 返回值选项,默认或传 1 时只返回二维码 base64 编码字符串,传 0 只返回 url
}

GetUnlimitedQrCodeRequest 请求结构体

type GetUnlimitedQrCodeResponse

type GetUnlimitedQrCodeResponse struct {
	Data      GetUnlimitedQrCodeResponsedata `json:"data"`       // 响应对象
	ErrMsg    string                         `json:"msg"`        // 错误信息
	Errno     int64                          `json:"errno"`      // 错误码
	RequestID string                         `json:"request_id"` // 请求 ID ,标识一次请求
	Timestamp int64                          `json:"timestamp"`  // 时间戳
	ErrorCode int64                          `json:"error_code"` // openapi 错误码
	ErrorMsg  string                         `json:"error_msg"`  // openapi 错误信息
}

type GetUnlimitedQrCodeResponsedata

type GetUnlimitedQrCodeResponsedata struct {
	Base64Str string `json:"base64_str"` // 二维码 base64 编码字符串
	URL       string `json:"url"`        // 小程序二维码链接
}

func GetUnlimitedQrCode

func GetUnlimitedQrCode(params *GetUnlimitedQrCodeRequest) (*GetUnlimitedQrCodeResponsedata, error)

GetUnlimitedQrCode

type MisjudgeFeedbackRequest

type MisjudgeFeedbackRequest struct {
	AccessToken string // 接口调用凭据
	RetrieveID  string // 前面提交检测接口返回的 retrieveId
}

MisjudgeFeedbackRequest 请求结构体

type MisjudgeFeedbackResponse

type MisjudgeFeedbackResponse struct {
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type MisjudgeFeedbackResponsedata

type MisjudgeFeedbackResponsedata struct {
	Errno int64
	Msg   string
}

响应结构体

func MisjudgeFeedback

func MisjudgeFeedback(params *MisjudgeFeedbackRequest) (*MisjudgeFeedbackResponsedata, error)

MisjudgeFeedback

type ModifyMaterialRequest

type ModifyMaterialRequest struct {
	AccessToken   string // 接口调用凭证
	AppID         int64  // app_id
	ID            int64  // 物料 id ,添加物料时返回 id
	ImageURL      string // 小图片地址,长度不能超过 500 个字符,最小尺寸为 213*213,比例为 1:1,单图最大为 2M
	Title         string // 标题,需要描述完整,能够明确表示小程序或内容的主要信息点,不能全英文,6-30 个字。若选择相应垂类时,此字段只作为兜底展示字段
	Path          string // 智能小程序内页链接
	Category1Code string // 一级分类字段
	Category2Code string // 二级分类字段
	Desc          string // 4-17 个汉字。标题解释说明
	LabelAttr     string // 属性、特点。最多三个标签;每个标签字数不超过 5 个汉字,多个使用因为 / 隔开
	LabelDiscount string // 优惠信息,最多一个标签;每个标签字数不超过 7 个汉字
	ButtonName    string // 按钮文案,最多 4 个字
	BigImage      string // 封面图片链接(1 张,单图片最大 2M)大图模板要求最小尺寸 1068 x 601,比例为 16:9,单图最大为 2M
	VerticalImage string // 当选择小说/动漫,影视剧,电影票务,演出赛事时必填;(竖图 3:4)最低 213*284
	ExtJSON       string // 扩展信息
}

ModifyMaterialRequest 请求结构体

type ModifyMaterialResponse

type ModifyMaterialResponse struct {
	Data      bool   `json:"data"`       // true:代表修改成功,false:代码修改失败
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type OpenAPIError

type OpenAPIError struct {
	ErrorCode int64       // openapi 错误码
	ErrorMsg  string      // openapi 错误信息
	Detail    interface{} // 详情
}

网关错误响应结构体

func (*OpenAPIError) Error

func (e *OpenAPIError) Error() string

type Option

type Option interface {
	// contains filtered or unexported methods
}

func OptRetry

func OptRetry(retry int) Option

func OptTimeout

func OptTimeout(timeout time.Duration) Option

type OrderBillRequest

type OrderBillRequest struct {
	AccessToken string // 接口调用凭证
	BillTime    string // 对账单日期格式 yyyy-MM-dd
	PmAppKey    string // 调起百度收银台的支付服务 appKey
}

OrderBillRequest 请求结构体

type OrderBillResponse

type OrderBillResponse struct {
	Data      OrderBillResponsedata `json:"data"`       // 响应对象
	Errno     int64                 `json:"errno"`      // 错误码
	ErrMsg    string                `json:"msg"`        // 错误信息
	ErrorCode int64                 `json:"error_code"` // openapi 错误码
	ErrorMsg  string                `json:"error_msg"`  // openapi 错误信息
}

type OrderBillResponsedata

type OrderBillResponsedata struct {
	Data       []OrderBillResponsedatadataItem `json:"data"`       // 响应对象
	TotalCount int64                           `json:"totalCount"` // 总数
}

func OrderBill

func OrderBill(params *OrderBillRequest) (*OrderBillResponsedata, error)

OrderBill

type OrderBillResponsedatadataItem

type OrderBillResponsedatadataItem struct {
	CreateTime   string `json:"createTime"`   // 创建时间
	DownloadName string `json:"downloadName"` // 账单名称
	ExportStatus int64  `json:"exportStatus"` // 导出进度
	URL          string `json:"url"`          // 下载地址
}

type ResetComponentStorageRequest

type ResetComponentStorageRequest struct {
	AccessToken string // 接口调用凭证
}

ResetComponentStorageRequest 请求结构体

type ResetComponentStorageResponse

type ResetComponentStorageResponse struct {
	ErrMsg    string `json:"msg"`        // 错误信息
	Errno     string `json:"errno"`      // 错误码
	ErrorCode int64  `json:"error_code"` // 错误码
	ErrorMsg  string `json:"error_msg"`  // 错误信息
	Logid     string `json:"logid"`      // 请求 ID,标识一次请求
}

type ResetComponentStorageResponsedata

type ResetComponentStorageResponsedata struct {
	ErrMsg string
	Errno  string
	Logid  string
}

响应结构体

func ResetComponentStorage

func ResetComponentStorage(params *ResetComponentStorageRequest) (*ResetComponentStorageResponsedata, error)

ResetComponentStorage

type ReturnCouponRequest

type ReturnCouponRequest struct {
	AccessToken  string // 接口调用凭证
	CouponID     string // 卡券 ID
	OpenID       string // 用户 ID
	CouponTakeID int64  // 百度分配的用户领取 id
}

ReturnCouponRequest 请求结构体

type ReturnCouponResponse

type ReturnCouponResponse struct {
	Data      bool   `json:"data"`       // true 退还成功 false 退还失败
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type SendCouponRequest

type SendCouponRequest struct {
	AccessToken           string // 接口调用凭证
	CouponID              string // 卡券 ID
	OpenID                string // 用户 ID
	UniqueSendingIdentity string // 请求唯一标识 uuid
}

SendCouponRequest 请求结构体

type SendCouponResponse

type SendCouponResponse struct {
	Data      SendCouponResponsedata `json:"data"`       // 响应对象
	Errno     int64                  `json:"errno"`      // 错误码
	ErrMsg    string                 `json:"msg"`        // 错误信息
	ErrorCode int64                  `json:"error_code"` // openapi 错误码
	ErrorMsg  string                 `json:"error_msg"`  // openapi 错误信息
}

type SendCouponResponsedata

type SendCouponResponsedata struct {
	CouponTakeID int64 `json:"couponTakeId"` // 卡券领取标识
}

func SendCoupon

func SendCoupon(params *SendCouponRequest) (*SendCouponResponsedata, error)

SendCoupon

type SendTemplateMessageRequest

type SendTemplateMessageRequest struct {
	AccessToken  string // 接口调用凭证
	TemplateID   string // 小程序模板 ID
	TouserOpenID string // 接收者 open_id 参数不能为空。open_id 为百度用户登录唯一标识,可以通过 SessionKey 获得
	Data         string // 发送消息内容
	Page         string // 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例 index?foo=bar),该字段不填默认跳转至首页
	SceneID      string // 场景 id ,例如 formId、orderId、payId。formId 为页面内 form 组件的report-submit属性为 true 时返回 formId ,详见 form 表单
	SceneType    int64  // 场景 type 。1:表单;2:百度收银台订单;3:直连订单
}

SendTemplateMessageRequest 请求结构体

type SendTemplateMessageResponse

type SendTemplateMessageResponse struct {
	Data      SendTemplateMessageResponsedata `json:"data"`       // 响应对象
	Errno     int64                           `json:"errno"`      // 错误码
	ErrMsg    string                          `json:"msg"`        // 错误信息
	ErrorCode int64                           `json:"error_code"` // openapi 错误码
	ErrorMsg  string                          `json:"error_msg"`  // openapi 错误信息
}

type SendTemplateMessageResponsedata

type SendTemplateMessageResponsedata struct {
	MsgKey int64 `json:"msg_key"` // 消息id
}

func SendTemplateMessage

func SendTemplateMessage(params *SendTemplateMessageRequest) (*SendTemplateMessageResponsedata, error)

SendTemplateMessage

type SubmitOrderLogisticsRequest

type SubmitOrderLogisticsRequest struct {
	AccessToken string                                // 接口调用凭证
	OpenID      string                                // 用户 openId
	SceneID     string                                // 百度收银台分配的平台订单 ID,通知支付状态接口返回的 orderId
	SceneType   int64                                 // 支付场景类型,开发者请默认传 2
	PmAppKey    string                                // 调起百度收银台的支付服务 appKey
	Data        []SubmitOrderLogisticsRequestDataItem // 请求数据
}

SubmitOrderLogisticsRequest 请求结构体

type SubmitOrderLogisticsRequestDataItem

type SubmitOrderLogisticsRequestDataItem struct {
	BizAPPID   string                                 `json:"BizAPPID"`   // 小程序 AppKey
	CateID     int64                                  `json:"CateID"`     // 订单种类:1(实物)、2(虚拟物品)、5(快递服务类)、6(快递服务类无金额订单)、10(上门服务类)、11(上门服务类无金额订单)、15(酒店类)、20(票务类)、25(打车类)、26(打车类无金额订单)
	EXT        SubmitOrderLogisticsRequestDataItemEXT `json:"EXT"`        // 扩展信息
	ResourceID string                                 `json:"ResourceID"` // 开发者接入的唯一订单 ID
}

type SubmitOrderLogisticsRequestDataItemEXT

type SubmitOrderLogisticsRequestDataItemEXT struct {
	MainOrder SubmitOrderLogisticsRequestDataItemEXTMainOrder `json:"MainOrder"` // 主订单信息(购买商品订单)
}

type SubmitOrderLogisticsRequestDataItemEXTMainOrder

type SubmitOrderLogisticsRequestDataItemEXTMainOrder struct {
	Express SubmitOrderLogisticsRequestDataItemEXTMainOrderExpress `json:"Express"` // 快递信息
}

type SubmitOrderLogisticsRequestDataItemEXTMainOrderExpress

type SubmitOrderLogisticsRequestDataItemEXTMainOrderExpress struct {
	Code   string `json:"Code"`   // 快递公司对应的编号,详情请参考快递公司信息码表
	ID     string `json:"ID"`     // 快递单号
	Name   string `json:"Name"`   // 快递公司名称
	Status int64  `json:"Status"` // 开发者默认传 0
	Type   int64  `json:"Type"`   // 快递类型,1:商家给用户发货,2:用户给商家退货;开发者根据快递类型传 1 或 2
}

type SubmitOrderLogisticsResponse

type SubmitOrderLogisticsResponse struct {
	Data      []SubmitOrderLogisticsResponsedataItem `json:"data"`       // 响应对象
	Errno     int64                                  `json:"errno"`      // 错误码
	ErrMsg    string                                 `json:"msg"`        // 错误信息
	ErrorCode int64                                  `json:"error_code"` // openapi 错误码
	ErrorMsg  string                                 `json:"error_msg"`  // openapi 错误信息
}

type SubmitOrderLogisticsResponsedataItem

type SubmitOrderLogisticsResponsedataItem struct {
	BizAppID     string `json:"biz_app_id"`    // POST 请求参数中 BizAPPID
	CateID       string `json:"cate_id"`       // POST 请求参数中 CateID
	ResourceID   string `json:"resource_id"`   // POST 请求参数中 ResourceID
	RowsAffected string `json:"rows_affected"` // 请求受影响行数(即请求是否成功, 0 为失败,非 0 为成功)
}

func SubmitOrderLogistics

SubmitOrderLogistics

type SubmitResourceRequest

type SubmitResourceRequest struct {
	AccessToken string // 接口调用凭证
	AppID       int64  // app_id
	Body        string // 内容的介绍,最多 2000 字符
	Ext         string // 扩展信息(参考文档附录三)
	FeedSubType string // feed 二级分类(参考文档附录二)
	FeedType    string // feed 一级分类(参考文档附录二)
	Images      string // 封面图片链接,要求必须是 JSON 格式,最多 3 张,单图片最大不能超 2M,只支持 JPG 或 PNG 格式(jpeg 不支持),尺寸要求:宽不能低于 372px,且高不能低于 248px。重要提示:图片尺寸越大、清晰度越高、宽高比越接近3:2,越有助于降低不可用风险,促进分发。
	MappSubType string // 资源子类型(参考文档附录一)
	MappType    string // 资源类型(参考文档附录一)
	Path        string // 智能小程序落地页链接
	Tags        string // 资源标签,英文逗号分割,填写越准确详细可能带来更好的分发效果(最多 10 个,总长度最多 100 字)
	Title       string // 标题
}

SubmitResourceRequest 请求结构体

type SubmitResourceResponse

type SubmitResourceResponse struct {
	Data      string `json:"data"`       // 响应参数
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type SubmitSitemapRequest

type SubmitSitemapRequest struct {
	AccessToken string // 小程序权限校验 Token
	AppID       int64  // app_id
	Desc        string // 描述信息
	Frequency   string // 更新频率 3-每天 4-每周
	Type        string // 类型 1-增量/更新; 0-下线/删除
	URL         string // sitemap 链接
}

SubmitSitemapRequest 请求结构体

type SubmitSitemapResponse

type SubmitSitemapResponse struct {
	Data      bool   `json:"data"`       // 响应参数
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type SubmitSkuCouponRequest

type SubmitSkuCouponRequest struct {
	AccessToken string // 接口调用凭证
	PostBody    []SubmitSkuCouponRequestBody
}

SubmitSkuCouponRequest 请求结构体

type SubmitSkuCouponRequestBody

type SubmitSkuCouponRequestBody struct {
	Desc      string                          `json:"desc"`       // 优惠券简介,优惠券的文字解释说明,8~34 个字符(汉字占 2 字符)
	Images    []string                        `json:"images"`     // 优惠券图片比例为 1:1,像素不得低于 576 * 576,支持 png、jpg 图片内容要求:图片清晰、干净,不要出现令人不适的内容;不能出现严重影响用户理解的内容截断问题;图片无水印、二维码相关性&一致性:图片与标题、优惠落地页内容相关、信息一致
	Path      string                          `json:"path"`       // 智能小程序落地页链接,免费优惠券 path 填写格式为 /pages/detail/highVersionIndex/?biz_id=2&biz_app_id= 小程序 appKey&coupon_template_id= 卡券 id&is_activity=0
	PriceInfo SubmitSkuCouponRequestpriceInfo `json:"price_info"` // 服务价格,详见:price_info 字段说明
	Region    string                          `json:"region"`     // 服务地域,参考附录二,省市之间用英文中划线分割,多个地区之间用英文逗号分割
	Schema    string                          `json:"schema"`     // 优惠券的具体信息,详见:coupon_info
	Title     string                          `json:"title"`      // 优惠券标题:活动优惠信息说明,12-30 个字符(汉字占 2 字符);不允许有特殊符号;优惠活动信息必须真实;需要清晰地说明商品内容,说明券的品牌(如肯德基、爱奇艺)、优惠主体(如 30 元代金券、汉堡薯条炸鸡兑换券)
	TradeType int64                           `json:"trade_type"` // 服务类目编码,参考附录一
}

type SubmitSkuCouponRequestpriceInfo

type SubmitSkuCouponRequestpriceInfo struct {
	OrgPrice  string `json:"org_price"`  // 付费优惠券:优惠活动前的服务原价格,注意,是以分为单位
	RealPrice string `json:"real_price"` // 付费优惠券:当前服务的实际成交价格,注意,是以分为单位
}

type SubmitSkuCouponResponse

type SubmitSkuCouponResponse struct {
	Data      string `json:"data"`       // 响应参数(如有提交失败的数据会返回失败的 path 和原因)
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type SubmitSkuRequest

type SubmitSkuRequest struct {
	AccessToken string // 接口调用凭证
	PostBody    []SubmitSkuRequestBody
}

SubmitSkuRequest 请求结构体

type SubmitSkuRequestBody

type SubmitSkuRequestBody struct {
	ActivityInfo []SubmitSkuRequestactivityInfoItem `json:"activity_info"` // 优惠活动,详见:activity_info 字段说明
	ButtonName   string                             `json:"button_name"`   // 服务按钮内的文案,表达使用服务的动作;字数为两个/四个汉字,推荐文案如下:咨询/立即咨询、问诊/立即问诊、预约/立即预约、预订/立即预订、办理/立即办理、购买/立即购买、购票/立即购票、抢票/立即抢票、订票/立即订票、下单/立即下单、抢购/立即抢购、团购/立即团购、入住/立即入住、查询/立即查询、查看/立即查看、排队/立即排队、进店/立即进店、租车/立即租车、租房/立即租房、充值/立即充值、缴费/立即缴费;如需新增,发邮件至 ext_service_category@baidu.com ,邮件正文请提供 APP key 、小程序名称、页面标题、描述、落地页 path 、新增按钮文案
	Desc         string                             `json:"desc"`          // 服务简介,服务的文字解释说明,8~34 个字符(汉字占 2 字符)
	Images       []string                           `json:"images"`        // 封面图片链接,目前只须传 1 张图片 图片要求: 1.图片内容要求: 图片清晰、干净,不要出现令人不适的内容;不能出现严重影响用户理解的内容截断问题;图片无水印、二维码、logo; 2.相关性&一致性: 图片与标题、服务落地页内容相关、信息一致;单图片最大不能超 2M,只支持 JPG 或 PNG 格式 三种可选图片比例: a.正方形图片,比例 1:1,图片尺寸要求不低于 352 * 352 b.长方形横图,比例 16:9,图片尺寸不低于 1068 * 601 c.长方形竖图,比例 3:4,图片尺寸不低于 372 * 495
	Path         string                             `json:"path"`          // 智能小程序落地页链接
	PriceInfo    SubmitSkuRequestpriceInfo          `json:"price_info"`    // 服务价格,详见:price_info 字段说明
	Region       string                             `json:"region"`        // 服务地域,参考附录二,省市之间用英文中划线分割,多个地区之间用英文逗号分割
	Schema       string                             `json:"schema"`        // 行业扩展字段,trade_type=1001/1002/1004/5001/5003/7001/7002/7003/13001 时必须设置,详见:各个分类 schema 字段说明
	Tag          string                             `json:"tag"`           // 服务的属性、亮点;最多三个标签;每个标签字数不超过 5 个汉字;不得出现特殊符号;“官方标”不可提交;多个标签使用英文封号分割
	Title        string                             `json:"title"`         // 服务标题:描述服务是什么,12~30 个字符(汉字占 2 字符)
	TradeType    int64                              `json:"trade_type"`    // 服务类目编码,参考附录一
}

type SubmitSkuRequestactivityInfoItem

type SubmitSkuRequestactivityInfoItem struct {
	ActivityDesc      string `json:"activity_desc"`       // 优惠活动说明,若优惠活动类型已填,则必填
	ActivityEndTime   int64  `json:"activity_end_time"`   // 优惠结束时间(时间戳到秒),距离开始时间不长于 6 个月;若优惠活动说明已填,则必填
	ActivityPath      string `json:"activity_path"`       // 优惠活动落地页链接,若优惠活动说明已填,则必填
	ActivityStartTime int64  `json:"activity_start_time"` // 优惠开始时间(时间戳到秒),最多可早于提交时间 180 个自然日;若优惠活动说明已填,则必填
	ActivityType      string `json:"activity_type"`       // 优惠活动类型,默认值为优惠;不得出现特殊符号;可选文案:领券、红包、补贴、限免、特价、赠品、会员、拼团;如需新增,发邮件至 smartapp-yylzd@baidu.com ,邮件正文请提供 APP key 、小程序名称、页面标题、描述、落地页 path 、新增活动类型
}

type SubmitSkuRequestpriceInfo

type SubmitSkuRequestpriceInfo struct {
	OrgPrice      string `json:"org_price"`       // 优惠活动前的服务原价格
	OrgUnit       string `json:"org_unit"`        // 价格统一默认单位是「元」,提交价格字段时不必重复提交单位「元」,比如:98 元/月,价格字段提交 98、单位字段提交「月」;可选单位:小时、天、周、月、年、m² 、m³ 、次、件;支持新增;如需新增,发邮件至 ext_service_category@baidu.com ,邮件正文请提供 APP key 、小程序名称、页面标题、描述、落地页 path 、新增单位
	RangeMaxPrice string `json:"range_max_price"` // 当前服务的实际成交价格区间:最高价格
	RangeMinPrice string `json:"range_min_price"` // 当前服务的实际成交价格区间:最低价格
	RealPrice     string `json:"real_price"`      // 当前服务的实际成交价格,精确价格与价格区间不同时出现
}

type SubmitSkuResponse

type SubmitSkuResponse struct {
	Data      string `json:"data"`       // 响应参数(如有提交失败的数据会返回失败的 path 和原因)
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type SubscribeSendRequest

type SubscribeSendRequest struct {
	AccessToken  string // 接口调用凭证
	TemplateID   string // 所需下发的模板消息的id
	TouserOpenID string // 接收者open_id
	SubscribeID  string // 订阅 Id ,发送订阅类模板消息时所使用的唯一标识符,开发者自定义的subscribe-id 字段。注意:同一用户在同一个订阅id 下的多次授权不累积下发权限,只能下发一条。若要订阅多条,需要不同订阅 id
	Data         string // 消息内容
	Page         string // 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,示例index?foo=bar,该字段不填默认跳转至首页
}

SubscribeSendRequest 请求结构体

type SubscribeSendResponse

type SubscribeSendResponse struct {
	Data      SubscribeSendResponsedata `json:"data"`       // 响应对象
	Errno     int64                     `json:"errno"`      // 错误码
	ErrMsg    string                    `json:"msg"`        // 错误信息
	ErrorCode int64                     `json:"error_code"` // openapi 错误码
	ErrorMsg  string                    `json:"error_msg"`  // openapi 错误信息
}

type SubscribeSendResponsedata

type SubscribeSendResponsedata struct {
	MsgKey string `json:"msg_key"` // 消息 id
}

func SubscribeSend

func SubscribeSend(params *SubscribeSendRequest) (*SubscribeSendResponsedata, error)

SubscribeSend

type UpdateCouponBannerRequest

type UpdateCouponBannerRequest struct {
	AccessToken     string // 接口调用凭证
	CouponID        string // 卡券 ID
	PicURL          string // 卡券 banner 图片
	Title           string // 卡券 banner 图标题
	AppRedirectPath string // banner 图跳转的小程序页面路径
	BannerID        int64  // 卡券 banner 记录 id
}

UpdateCouponBannerRequest 请求结构体

type UpdateCouponBannerResponse

type UpdateCouponBannerResponse struct {
	Data      bool   `json:"data"`       // true 退还成功 false 退还失败
	Errno     int64  `json:"errno"`      // 错误码
	ErrMsg    string `json:"msg"`        // 错误信息
	ErrorCode int64  `json:"error_code"` // openapi 错误码
	ErrorMsg  string `json:"error_msg"`  // openapi 错误信息
}

type UpdateOrderInfoRequest

type UpdateOrderInfoRequest struct {
	AccessToken string                           // 接口调用凭证
	OpenID      string                           // 用户 openId
	SceneID     string                           // 百度收银台分配的平台订单 ID,通知支付状态接口返回的 orderId
	SceneType   int64                            // 支付场景类型,开发者请默认传 2
	PmAppKey    string                           // 调起百度收银台的支付服务 appKey
	Data        []UpdateOrderInfoRequestDataItem // 请求数据
}

UpdateOrderInfoRequest 请求结构体

type UpdateOrderInfoRequestDataItem

type UpdateOrderInfoRequestDataItem struct {
	BizAPPID   string                            `json:"BizAPPID"`   // 小程序 AppKey
	CateID     int64                             `json:"CateID"`     // 订单种类:1(实物)、2(虚拟物品)、5(快递服务类)、6(快递服务类无金额订单)、10(上门服务类)、11(上门服务类无金额订单)、15(酒店类)、20(票务类)、25(打车类)、26(打车类无金额订单)
	EXT        UpdateOrderInfoRequestDataItemEXT `json:"EXT"`        // 扩展信息
	ResourceID string                            `json:"ResourceID"` // 开发者接入的唯一订单 ID
	Status     int64                             `json:"Status"`     // 订单状态,其值根据CateID不同有不同的定义。CateID = 1 实物订单、CateID = 2 虚拟物品订单、CateID = 5 快递服务类订单、CateID = 6 快递服务类无金额订单、CateID = 10 上门服务类订单、CateID = 11 上门服务类无金额订单、CateID = 15 酒店类订单、CateID = 20 出行票务类订单、CateID = 25 打车类订单、CateID = 26 打车类无金额订单
}

type UpdateOrderInfoRequestDataItemEXT

type UpdateOrderInfoRequestDataItemEXT struct {
	MainOrder UpdateOrderInfoRequestDataItemEXTMainOrder `json:"MainOrder"` // 主订单信息(购买商品订单)
}

type UpdateOrderInfoRequestDataItemEXTMainOrder

type UpdateOrderInfoRequestDataItemEXTMainOrder struct {
	Appraise    UpdateOrderInfoRequestDataItemEXTMainOrderAppraise       `json:"Appraise"`    // 待评价状态订单的评价页结构,仅订单为可评价状态,且还未进行评价时提供该信息
	OrderDetail UpdateOrderInfoRequestDataItemEXTMainOrderOrderDetail    `json:"OrderDetail"` // 订单详情页的信息
	Payment     UpdateOrderInfoRequestDataItemEXTMainOrderPayment        `json:"Payment"`     // 支付信息
	Products    []UpdateOrderInfoRequestDataItemEXTMainOrderProductsItem `json:"Products"`    // 数组,商品信息列表,若商品只有 1 个则数组长度为 1
}

type UpdateOrderInfoRequestDataItemEXTMainOrderAppraise

type UpdateOrderInfoRequestDataItemEXTMainOrderAppraise struct {
	Status     int64  `json:"Status"`     // 0(不可评价状态或已评价状态)、2(待评价状态,允许跳转)
	SwanSchema string `json:"SwanSchema"` // 评价页的跳转地址,用以小程序跳转 Scheme
}

type UpdateOrderInfoRequestDataItemEXTMainOrderOrderDetail

type UpdateOrderInfoRequestDataItemEXTMainOrderOrderDetail struct {
	Status     int64  `json:"Status"`     // 默认传 2
	SwanSchema string `json:"SwanSchema"` // 订单详情页的跳转地址,用以小程序跳转 Scheme
}

type UpdateOrderInfoRequestDataItemEXTMainOrderPayment

type UpdateOrderInfoRequestDataItemEXTMainOrderPayment struct {
	Amount           int64                                                                   `json:"Amount"`           // 实付金额(单位:分),即100为1元
	IsPayment        bool                                                                    `json:"IsPayment"`        // 是否已付款
	Method           int64                                                                   `json:"Method"`           // 付款方式,1(在线付),2(货到付款)
	PaymentInfo      []UpdateOrderInfoRequestDataItemEXTMainOrderPaymentPaymentInfoItem      `json:"PaymentInfo"`      // 其他付款信息,如运费、保险等
	PreferentialInfo []UpdateOrderInfoRequestDataItemEXTMainOrderPaymentPreferentialInfoItem `json:"PreferentialInfo"` // 优惠券信息
	Time             int64                                                                   `json:"Time"`             // 付款时间(单位:秒)
}

type UpdateOrderInfoRequestDataItemEXTMainOrderPaymentPaymentInfoItem

type UpdateOrderInfoRequestDataItemEXTMainOrderPaymentPaymentInfoItem struct {
	Name     string `json:"Name"`     // 展示名称
	Quantity int64  `json:"Quantity"` // 数量
	Value    int64  `json:"Value"`    // 合计金额(单位:分),即100为1元
}

type UpdateOrderInfoRequestDataItemEXTMainOrderPaymentPreferentialInfoItem

type UpdateOrderInfoRequestDataItemEXTMainOrderPaymentPreferentialInfoItem struct {
	Name     string `json:"Name"`     // 展示名称
	Quantity int64  `json:"Quantity"` // 数量
	Value    int64  `json:"Value"`    // 合计金额(单位:分),即100为1元
}

type UpdateOrderInfoRequestDataItemEXTMainOrderProductsItem

type UpdateOrderInfoRequestDataItemEXTMainOrderProductsItem struct {
	Desc       string                                                              `json:"Desc"`       // 商品简述
	DetailPage UpdateOrderInfoRequestDataItemEXTMainOrderProductsItemDetailPage    `json:"DetailPage"` // 商品详情的跳转的跳转结构
	ID         string                                                              `json:"ID"`         // 商品 ID ,开发者的唯一商品 ID
	ImgList    []string                                                            `json:"ImgList"`    // 商品预览,值为预览图 URL 地址,最多 5 张
	Name       string                                                              `json:"Name"`       // 商品名字
	PayPrice   int64                                                               `json:"PayPrice"`   // 实付价(单位:分),即100代表1元
	Price      int64                                                               `json:"Price"`      // 本商品原价(单位:分),即100代表1元
	Quantity   int64                                                               `json:"Quantity"`   // 本商品的交易数量
	SkuAttr    []UpdateOrderInfoRequestDataItemEXTMainOrderProductsItemSkuAttrItem `json:"SkuAttr"`    // 商品规格,最多 400 个
}

type UpdateOrderInfoRequestDataItemEXTMainOrderProductsItemDetailPage

type UpdateOrderInfoRequestDataItemEXTMainOrderProductsItemDetailPage struct {
	Status     int64  `json:"Status"`     // 默认传 2
	SwanSchema string `json:"SwanSchema"` // 商品详情页的跳转地址,用以小程序跳转 Scheme
}

type UpdateOrderInfoRequestDataItemEXTMainOrderProductsItemSkuAttrItem

type UpdateOrderInfoRequestDataItemEXTMainOrderProductsItemSkuAttrItem struct {
	Name  string `json:"Name"`  // 规格名称,例如“颜色”或“尺寸”
	Value string `json:"Value"` // 规格值
}

type UpdateOrderInfoResponse

type UpdateOrderInfoResponse struct {
	Data      []UpdateOrderInfoResponsedataItem `json:"data"`       // 响应对象
	Errno     int64                             `json:"errno"`      // 错误码
	ErrMsg    string                            `json:"msg"`        // 错误信息
	ErrorCode int64                             `json:"error_code"` // openapi 错误码
	ErrorMsg  string                            `json:"error_msg"`  // openapi 错误信息
}

type UpdateOrderInfoResponsedataItem

type UpdateOrderInfoResponsedataItem struct {
	BizAppID     string `json:"biz_app_id"`    // POST 请求参数中 BizAPPID
	CateID       string `json:"cate_id"`       // POST 请求参数中 CateID
	ResourceID   string `json:"resource_id"`   // POST 请求参数中 ResourceID
	RowsAffected string `json:"rows_affected"` // 请求受影响行数(即请求是否成功, 0 为失败,非 0 为成功)
}

func UpdateOrderInfo

func UpdateOrderInfo(params *UpdateOrderInfoRequest) ([]UpdateOrderInfoResponsedataItem, error)

UpdateOrderInfo

type UpdateOrderStatusRequest

type UpdateOrderStatusRequest struct {
	AccessToken string                             // 接口调用凭证
	OpenID      string                             // 用户 openId
	SceneID     string                             // 百度收银台分配的平台订单 ID,通知支付状态接口返回的 orderId
	SceneType   int64                              // 支付场景类型,开发者请默认传 2
	PmAppKey    string                             // 调起百度收银台的支付服务 appKey
	Data        []UpdateOrderStatusRequestDataItem // 请求数据
}

UpdateOrderStatusRequest 请求结构体

type UpdateOrderStatusRequestDataItem

type UpdateOrderStatusRequestDataItem struct {
	BizAPPID   string `json:"BizAPPID"`   // 小程序 AppKey
	CateID     int64  `json:"CateID"`     // 订单种类:1(实物)、2(虚拟物品)、5(快递服务类)、6(快递服务类无金额订单)、10(上门服务类)、11(上门服务类无金额订单)、15(酒店类)、20(票务类)、25(打车类)、26(打车类无金额订单)
	ResourceID string `json:"ResourceID"` // 开发者接入的唯一订单 ID
	Status     int64  `json:"Status"`     // 订单状态,其值根据CateID不同有不同的定义。CateID = 1 实物订单、CateID = 2 虚拟物品订单、CateID = 5 快递服务类订单、CateID = 6 快递服务类无金额订单、CateID = 10 上门服务类订单、CateID = 11 上门服务类无金额订单、CateID = 15 酒店类订单、CateID = 20 出行票务类订单、CateID = 25 打车类订单、CateID = 26 打车类无金额订单
}

type UpdateOrderStatusResponse

type UpdateOrderStatusResponse struct {
	Data      []UpdateOrderStatusResponsedataItem `json:"data"`       // 响应对象
	Errno     int64                               `json:"errno"`      // 错误码
	ErrMsg    string                              `json:"msg"`        // 错误信息
	ErrorCode int64                               `json:"error_code"` // openapi 错误码
	ErrorMsg  string                              `json:"error_msg"`  // openapi 错误信息
}

type UpdateOrderStatusResponsedataItem

type UpdateOrderStatusResponsedataItem struct {
	BizAppID     string `json:"biz_app_id"`    // POST 请求参数中 BizAPPID
	CateID       string `json:"cate_id"`       // POST 请求参数中 CateID
	ResourceID   string `json:"resource_id"`   // POST 请求参数中 ResourceID
	RowsAffected string `json:"rows_affected"` // 请求受影响行数(即请求是否成功, 0 为失败,非 0 为成功)
}

func UpdateOrderStatus

UpdateOrderStatus

type UpdateOrderSubInfoRequest

type UpdateOrderSubInfoRequest struct {
	AccessToken string                              // 接口调用凭证
	OpenID      string                              // 用户 openId
	SceneID     string                              // 百度收银台分配的平台订单 ID,通知支付状态接口返回的 orderId
	SceneType   int64                               // 支付场景类型,开发者请默认传 2
	PmAppKey    string                              // 调起百度收银台的支付服务 appKey
	Data        []UpdateOrderSubInfoRequestDataItem // 请求数据
}

UpdateOrderSubInfoRequest 请求结构体

type UpdateOrderSubInfoRequestDataItem

type UpdateOrderSubInfoRequestDataItem struct {
	BizAPPID   string                               `json:"BizAPPID"`   // 小程序 AppKey
	CateID     int64                                `json:"CateID"`     // 订单种类:1(实物)、2(虚拟物品)、5(快递服务类)、6(快递服务类无金额订单)、10(上门服务类)、11(上门服务类无金额订单)、15(酒店类)、20(票务类)、25(打车类)、26(打车类无金额订单)
	EXT        UpdateOrderSubInfoRequestDataItemEXT `json:"EXT"`        // 扩展信息
	ResourceID string                               `json:"ResourceID"` // 开发者接入的唯一订单 ID
}

type UpdateOrderSubInfoRequestDataItemEXT

type UpdateOrderSubInfoRequestDataItemEXT struct {
	SubsOrder UpdateOrderSubInfoRequestDataItemEXTSubsOrder `json:"SubsOrder"` // 子订单信息(退款、售后订单)
}

type UpdateOrderSubInfoRequestDataItemEXTSubsOrder

type UpdateOrderSubInfoRequestDataItemEXTSubsOrder struct {
	Items  []UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItem `json:"Items"`  // 售后订单列表
	Status int64                                                    `json:"Status"` // 所有售后订单的状态汇总最终状态,详见 Data.Ext.SubsOrder.Status 退换货枚举值
}

type UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItem

type UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItem struct {
	CTime       int64                                                             `json:"CTime"`       // 创建时间(单位:秒)
	MTime       int64                                                             `json:"MTime"`       // 修改时间(单位:秒)
	OrderDetail UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemOrderDetail `json:"OrderDetail"` // 跳转到这个订单的详情结构
	OrderType   int64                                                             `json:"OrderType"`   // 退款类型,1(仅退款),2(换货),3(退款+退货)。
	Refund      UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefund      `json:"Refund"`      // 售后订单商品信息,详见 Data.Ext.SubsOrder.Item.Refund
	SubOrderID  string                                                            `json:"SubOrderID"`  // 售后订单 ID
	SubStatus   int64                                                             `json:"SubStatus"`   // 售后订单状态,同 Data.Ext.SubsOrder.Status 退换货枚举值一致
}

type UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemOrderDetail

type UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemOrderDetail struct {
	Status     string `json:"Status"`     // 默认传 2
	SwanSchema string `json:"SwanSchema"` // 售后订单跳转地址,用以小程序跳转 Scheme
}

type UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefund

type UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefund struct {
	Amount  int64                                                                     `json:"Amount"`  // 退款总金额(单位:分),即100为1元。
	Product []UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefundProductItem `json:"Product"` // 售后商品列表
}

type UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefundProductItem

type UpdateOrderSubInfoRequestDataItemEXTSubsOrderItemsItemRefundProductItem struct {
	Amount   int64  `json:"Amount"`   // 退款金额(单位:分),即100为1元
	ID       string `json:"ID"`       // 商品 ID
	Quantity int64  `json:"Quantity"` // 售后商品数量
}

type UpdateOrderSubInfoResponse

type UpdateOrderSubInfoResponse struct {
	Data      []UpdateOrderSubInfoResponsedataItem `json:"data"`       // 响应对象
	Errno     int64                                `json:"errno"`      // 错误码
	ErrMsg    string                               `json:"msg"`        // 错误信息
	ErrorCode int64                                `json:"error_code"` // openapi 错误码
	ErrorMsg  string                               `json:"error_msg"`  // openapi 错误信息
}

type UpdateOrderSubInfoResponsedataItem

type UpdateOrderSubInfoResponsedataItem struct {
	BizAppID     string `json:"biz_app_id"`    // POST 请求参数中 BizAPPID
	CateID       string `json:"cate_id"`       // POST 请求参数中 CateID
	ResourceID   string `json:"resource_id"`   // POST 请求参数中 ResourceID
	RowsAffected string `json:"rows_affected"` // 请求受影响行数(即请求是否成功, 0 为失败,非 0 为成功)
}

func UpdateOrderSubInfo

UpdateOrderSubInfo

type UpdateOrderSubStatusRequest

type UpdateOrderSubStatusRequest struct {
	AccessToken string                                // 接口调用凭证
	OpenID      string                                // 用户 openId
	SceneID     string                                // 百度收银台分配的平台订单 ID,通知支付状态接口返回的 orderId
	SceneType   int64                                 // 支付场景类型,开发者请默认传 2
	PmAppKey    string                                // 调起百度收银台的支付服务 appKey
	Data        []UpdateOrderSubStatusRequestDataItem // 请求数据
}

UpdateOrderSubStatusRequest 请求结构体

type UpdateOrderSubStatusRequestDataItem

type UpdateOrderSubStatusRequestDataItem struct {
	BizAPPID   string                                 `json:"BizAPPID"`   // 小程序 AppKey
	CateID     int64                                  `json:"CateID"`     // 订单种类:1(实物)、2(虚拟物品)、5(快递服务类)、6(快递服务类无金额订单)、10(上门服务类)、11(上门服务类无金额订单)、15(酒店类)、20(票务类)、25(打车类)、26(打车类无金额订单)
	EXT        UpdateOrderSubStatusRequestDataItemEXT `json:"EXT"`        // 扩展信息,详细结构见 Data.Ext
	ResourceID string                                 `json:"ResourceID"` // 开发者接入的唯一订单 ID
}

type UpdateOrderSubStatusRequestDataItemEXT

type UpdateOrderSubStatusRequestDataItemEXT struct {
	SubsOrder UpdateOrderSubStatusRequestDataItemEXTSubsOrder `json:"SubsOrder"` // 子订单信息(退款、售后订单)
}

type UpdateOrderSubStatusRequestDataItemEXTSubsOrder

type UpdateOrderSubStatusRequestDataItemEXTSubsOrder struct {
	Items  []UpdateOrderSubStatusRequestDataItemEXTSubsOrderItemsItem `json:"Items"`  // 售后订单列表
	Status int64                                                      `json:"Status"` // 所有售后订单的状态汇总最终状态,详见 Data.Ext.SubsOrder.Status 退换货枚举值
}

type UpdateOrderSubStatusRequestDataItemEXTSubsOrderItemsItem

type UpdateOrderSubStatusRequestDataItemEXTSubsOrderItemsItem struct {
	SubOrderID string `json:"SubOrderID"` // 售后订单 ID
	SubStatus  int64  `json:"SubStatus"`  // 售后订单状态,同 Data.Ext.SubsOrder.Status 退换货枚举值一致
}

type UpdateOrderSubStatusResponse

type UpdateOrderSubStatusResponse struct {
	Data      []UpdateOrderSubStatusResponsedataItem `json:"data"`       // 响应对象
	Errno     int64                                  `json:"errno"`      // 错误码
	ErrMsg    string                                 `json:"msg"`        // 错误信息
	ErrorCode int64                                  `json:"error_code"` // openapi 错误码
	ErrorMsg  string                                 `json:"error_msg"`  // openapi 错误信息
}

type UpdateOrderSubStatusResponsedataItem

type UpdateOrderSubStatusResponsedataItem struct {
	BizAppID     string `json:"biz_app_id"`    // POST 请求参数中 BizAPPID
	CateID       string `json:"cate_id"`       // POST 请求参数中 CateID
	ResourceID   string `json:"resource_id"`   // POST 请求参数中 ResourceID
	RowsAffected string `json:"rows_affected"` // 请求受影响行数(即请求是否成功, 0 为失败,非 0 为成功)
}

func UpdateOrderSubStatus

UpdateOrderSubStatus

type UploadCouponImageRequest

type UploadCouponImageRequest struct {
	AccessToken string                       // 接口调用凭证
	File        UploadCouponImageRequestFile // 卡券图
}

UploadCouponImageRequest 请求结构体

type UploadCouponImageRequestFile

type UploadCouponImageRequestFile struct {
	Name   string
	Reader io.Reader
}

type UploadCouponImageResponse

type UploadCouponImageResponse struct {
	Data      UploadCouponImageResponsedata `json:"data"`       // 响应对象
	Errno     int64                         `json:"errno"`      // 错误码
	ErrMsg    string                        `json:"msg"`        // 错误信息
	ErrorCode int64                         `json:"error_code"` // openapi 错误码
	ErrorMsg  string                        `json:"error_msg"`  // openapi 错误信息
}

type UploadCouponImageResponsedata

type UploadCouponImageResponsedata struct {
	URL string `json:"url"` // 图片地址
}

func UploadCouponImage

func UploadCouponImage(params *UploadCouponImageRequest) (*UploadCouponImageResponsedata, error)

UploadCouponImage

Jump to

Keyboard shortcuts

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