ma

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ma 包含码上淘API相关结构体

https://open.taobao.com/API.htm?docType=2&docId=23660

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReleaseQrCodeStyle added in v1.3.4

func ReleaseQrCodeStyle(v *QrCodeStyle)

ReleaseQrCodeStyle 释放QrCodeStyle

func ReleaseQrcodeDo added in v1.3.4

func ReleaseQrcodeDo(v *QrcodeDo)

ReleaseQrcodeDo 释放QrcodeDo

func ReleaseTaobaoMaQrcodeCommonCreateAPIRequest added in v1.3.4

func ReleaseTaobaoMaQrcodeCommonCreateAPIRequest(v *TaobaoMaQrcodeCommonCreateAPIRequest)

ReleaseTaobaoMaQrcodeCommonCreateAPIRequest 将 TaobaoMaQrcodeCommonCreateAPIRequest 放入 sync.Pool

func ReleaseTaobaoMaQrcodeCommonCreateAPIResponse added in v1.3.4

func ReleaseTaobaoMaQrcodeCommonCreateAPIResponse(v *TaobaoMaQrcodeCommonCreateAPIResponse)

ReleaseTaobaoMaQrcodeCommonCreateAPIResponse 将 TaobaoMaQrcodeCommonCreateAPIResponse 保存到 sync.Pool

func ReleaseTaobaoWirelessXcodeCreateAPIRequest added in v1.3.4

func ReleaseTaobaoWirelessXcodeCreateAPIRequest(v *TaobaoWirelessXcodeCreateAPIRequest)

ReleaseTaobaoWirelessXcodeCreateAPIRequest 将 TaobaoWirelessXcodeCreateAPIRequest 放入 sync.Pool

func ReleaseTaobaoWirelessXcodeCreateAPIResponse added in v1.3.4

func ReleaseTaobaoWirelessXcodeCreateAPIResponse(v *TaobaoWirelessXcodeCreateAPIResponse)

ReleaseTaobaoWirelessXcodeCreateAPIResponse 将 TaobaoWirelessXcodeCreateAPIResponse 保存到 sync.Pool

func ReleaseXCodeTo added in v1.3.4

func ReleaseXCodeTo(v *XCodeTo)

ReleaseXCodeTo 释放XCodeTo

Types

type QrCodeStyle

type QrCodeStyle struct {
	Logo string `json:"logo,omitempty" xml:"logo,omitempty"`
	// 可选参数,二维背景色颜色值,接入业务点配置为准,未配置,默认为白
	BgColor int64 `json:"bg_color,omitempty" xml:"bg_color,omitempty"`
	// 可选参数,二维码纠错级别 0=~7%,1=~15%,2=~25%,3=~30%
	Level int64 `json:"level,omitempty" xml:"level,omitempty"`
	// 可选参数,二维码深色点颜色值,接入业务点配置为准,未配置,默认为黑
	Color int64 `json:"color,omitempty" xml:"color,omitempty"`
	// 可选参数,二维码的边框,默认大小1个单位点,便于扫码
	Margin int64 `json:"margin,omitempty" xml:"margin,omitempty"`
	// 可选参数,二维码大小,值60~600,默认185pix
	Size int64 `json:"size,omitempty" xml:"size,omitempty"`
}

QrCodeStyle 结构体

func GetQrCodeStyle added in v1.3.4

func GetQrCodeStyle() *QrCodeStyle

GetQrCodeStyle() 从对象池中获取QrCodeStyle

type QrcodeDo

type QrcodeDo struct {
	// 二维码对应的渠道名
	ChannelName string `json:"channel_name,omitempty" xml:"channel_name,omitempty"`
	// 二维码的矢量图下载地址,只有设置入参need_eps为true且style不为官方模板时,才返回值
	EpsUrl string `json:"eps_url,omitempty" xml:"eps_url,omitempty"`
	// 二维码图片链接
	QrcodeUrl string `json:"qrcode_url,omitempty" xml:"qrcode_url,omitempty"`
	// 二维码的短地址,每一个原始地址都会生成一个短地址
	ShortUrl string `json:"short_url,omitempty" xml:"short_url,omitempty"`
	// 二维码扫码后访问的目的地址
	Url string `json:"url,omitempty" xml:"url,omitempty"`
	// 二维码所属渠道ID
	ChannelId int64 `json:"channel_id,omitempty" xml:"channel_id,omitempty"`
	// 二维码id
	QrcodeId int64 `json:"qrcode_id,omitempty" xml:"qrcode_id,omitempty"`
}

QrcodeDo 结构体

func GetQrcodeDo added in v1.3.4

func GetQrcodeDo() *QrcodeDo

GetQrcodeDo() 从对象池中获取QrcodeDo

type TaobaoMaQrcodeCommonCreateAPIRequest

type TaobaoMaQrcodeCommonCreateAPIRequest struct {
	model.Params
	// contains filtered or unexported fields
}

TaobaoMaQrcodeCommonCreateAPIRequest 创建码平台常用二维码 API请求 taobao.ma.qrcode.common.create

创建码平台对外提供的常用二维码接口,不适于码平台业务类型的码创建,如不支持包裹码、媒体码等,业务类型的码需要单独提供API。

func GetTaobaoMaQrcodeCommonCreateAPIRequest added in v1.3.4

func GetTaobaoMaQrcodeCommonCreateAPIRequest() *TaobaoMaQrcodeCommonCreateAPIRequest

GetTaobaoMaQrcodeCommonCreateRequest 从 sync.Pool 获取 TaobaoMaQrcodeCommonCreateAPIRequest

func NewTaobaoMaQrcodeCommonCreateRequest

func NewTaobaoMaQrcodeCommonCreateRequest() *TaobaoMaQrcodeCommonCreateAPIRequest

NewTaobaoMaQrcodeCommonCreateRequest 初始化TaobaoMaQrcodeCommonCreateAPIRequest对象

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetApiMethodName

func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetApiMethodName() string

GetApiMethodName IRequest interface 方法, 获取Api method

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetApiParams

func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetApiParams(params url.Values)

GetApiParams IRequest interface 方法, 获取API参数

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetChannelName

func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetChannelName() string

GetChannelName ChannelName Getter

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetContent

GetContent Content Getter

GetLogo Logo Getter

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetName

GetName Name Getter

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetNeedEps

GetNeedEps NeedEps Getter

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetRawParams added in v1.2.8

GetRawParams IRequest interface 方法, 获取API原始参数

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetSize

GetSize Size Getter

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetStyle

GetStyle Style Getter

func (TaobaoMaQrcodeCommonCreateAPIRequest) GetType

GetType Type Getter

func (*TaobaoMaQrcodeCommonCreateAPIRequest) Reset added in v1.3.4

Reset IRequest interface 方法, 清空结构体

func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetChannelName

func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetChannelName(_channelName string) error

SetChannelName is ChannelName Setter 二维码需要布点的位置,方便用户在码平台上可以区分看到不同布点的扫码数据情况;列表值,用半角','号分割,单个渠道名不能超过16字符。

func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetContent

func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetContent(_content string) error

SetContent is Content Setter 二维码的内容之一,由type决定:type=page时,content传入无线页面的URL连接内容;type=item时,content传入宝贝数字ID;type=url时,content传入普通的URL连接内容;type=shop时,content传入店铺ID;

SetLogo is Logo Setter 二维码的logo地址,只允许淘宝官方图片空间的图片地址,其他非图片空间图片不支持。官方淘logo图片地址:http://img01.taobaocdn.com/imgextra/T1Od8YFT8eXXXXXXXX

func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetName

SetName is Name Setter 二维码名字,即创建的二维码,在码平台上显示记录的名字。

func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetNeedEps

func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetNeedEps(_needEps bool) error

SetNeedEps is NeedEps Setter 是否需要矢量图,如果需要矢量图,设置为true;只支持普通二维码,官方模板不支持矢量图

func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetSize

SetSize is Size Setter 二维码尺寸,只支持普通二维码,不支持官方模板,单位为像素,最小为60×60,最大为300×300,建议175×175。官方模板大小尺寸见style说明。

func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetStyle

SetStyle is Style Setter 二维码的样式名,支持普通码的颜色或官方模板的模板名;普通码的颜色可选输入:“000000”(黑色)、“EF4F2B”(橙色);官方模板的可选输入(实际尺寸比样例大):“ww_color.png“ 尺寸290x320,样例:http://gtms03.alicdn.com/tps/i3/T1YLPRFRXXXXbsbYwb-100-102.png;“tb_scan.png“ 尺寸290x320,样例:http://gtms01.alicdn.com/tps/i1/T14vsEFThdXXbsbYwb-100-102.png;“ww_hide_color.png“ 尺寸200x263,样例:http://gtms04.alicdn.com/tps/i4/TB1URvlFVXXXXbRXFXXwxcf6pXX-76-100.png;“tmall_hide_color.png“ 尺寸200x263,样例:http://gtms01.alicdn.com/tps/i1/TB1S5PiFVXXXXacXVXXwxcf6pXX-76-100.png

func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetType

SetType is Type Setter 要制作的二维码业务类型:page:无线页面类型item:宝贝ID类型url:普通的URL连接类型shop:店铺ID类型

type TaobaoMaQrcodeCommonCreateAPIResponse

type TaobaoMaQrcodeCommonCreateAPIResponse struct {
	model.CommonResponse
	TaobaoMaQrcodeCommonCreateAPIResponseModel
}

TaobaoMaQrcodeCommonCreateAPIResponse 创建码平台常用二维码 API返回值 taobao.ma.qrcode.common.create

创建码平台对外提供的常用二维码接口,不适于码平台业务类型的码创建,如不支持包裹码、媒体码等,业务类型的码需要单独提供API。

func GetTaobaoMaQrcodeCommonCreateAPIResponse added in v1.3.4

func GetTaobaoMaQrcodeCommonCreateAPIResponse() *TaobaoMaQrcodeCommonCreateAPIResponse

GetTaobaoMaQrcodeCommonCreateAPIResponse 从 sync.Pool 获取 TaobaoMaQrcodeCommonCreateAPIResponse

func (*TaobaoMaQrcodeCommonCreateAPIResponse) Reset added in v1.3.4

Reset 清空结构体

type TaobaoMaQrcodeCommonCreateAPIResponseModel

type TaobaoMaQrcodeCommonCreateAPIResponseModel struct {
	XMLName xml.Name `xml:"ma_qrcode_common_create_response"`
	// 平台颁发的每次请求访问的唯一标识
	RequestId string `json:"request_id,omitempty" xml:"request_id,omitempty"`
	// 二维码对像
	Modules []QrcodeDo `json:"modules,omitempty" xml:"modules>qrcode_do,omitempty"`
	// 执行是否成功
	Suc bool `json:"suc,omitempty" xml:"suc,omitempty"`
}

TaobaoMaQrcodeCommonCreateAPIResponseModel is 创建码平台常用二维码 成功返回结果

func (*TaobaoMaQrcodeCommonCreateAPIResponseModel) Reset added in v1.3.4

Reset 清空结构体

type TaobaoWirelessXcodeCreateAPIRequest

type TaobaoWirelessXcodeCreateAPIRequest struct {
	model.Params
	// contains filtered or unexported fields
}

TaobaoWirelessXcodeCreateAPIRequest 创建二维码/短连接 API请求 taobao.wireless.xcode.create

创建码平台的普通二维码或者长连接转短连接服务

func GetTaobaoWirelessXcodeCreateAPIRequest added in v1.3.4

func GetTaobaoWirelessXcodeCreateAPIRequest() *TaobaoWirelessXcodeCreateAPIRequest

GetTaobaoWirelessXcodeCreateRequest 从 sync.Pool 获取 TaobaoWirelessXcodeCreateAPIRequest

func NewTaobaoWirelessXcodeCreateRequest

func NewTaobaoWirelessXcodeCreateRequest() *TaobaoWirelessXcodeCreateAPIRequest

NewTaobaoWirelessXcodeCreateRequest 初始化TaobaoWirelessXcodeCreateAPIRequest对象

func (TaobaoWirelessXcodeCreateAPIRequest) GetApiMethodName

func (r TaobaoWirelessXcodeCreateAPIRequest) GetApiMethodName() string

GetApiMethodName IRequest interface 方法, 获取Api method

func (TaobaoWirelessXcodeCreateAPIRequest) GetApiParams

func (r TaobaoWirelessXcodeCreateAPIRequest) GetApiParams(params url.Values)

GetApiParams IRequest interface 方法, 获取API参数

func (TaobaoWirelessXcodeCreateAPIRequest) GetBizCode

GetBizCode BizCode Getter

func (TaobaoWirelessXcodeCreateAPIRequest) GetContent

GetContent Content Getter

func (TaobaoWirelessXcodeCreateAPIRequest) GetRawParams added in v1.2.8

GetRawParams IRequest interface 方法, 获取API原始参数

func (TaobaoWirelessXcodeCreateAPIRequest) GetStyle

GetStyle Style Getter

func (*TaobaoWirelessXcodeCreateAPIRequest) Reset added in v1.3.4

Reset IRequest interface 方法, 清空结构体

func (*TaobaoWirelessXcodeCreateAPIRequest) SetBizCode

func (r *TaobaoWirelessXcodeCreateAPIRequest) SetBizCode(_bizCode string) error

SetBizCode is BizCode Setter 码平台开放的业务code

func (*TaobaoWirelessXcodeCreateAPIRequest) SetContent

func (r *TaobaoWirelessXcodeCreateAPIRequest) SetContent(_content string) error

SetContent is Content Setter 原始内容/原始地址

func (*TaobaoWirelessXcodeCreateAPIRequest) SetStyle

SetStyle is Style Setter 普通二维码样式参数

type TaobaoWirelessXcodeCreateAPIResponse

type TaobaoWirelessXcodeCreateAPIResponse struct {
	model.CommonResponse
	TaobaoWirelessXcodeCreateAPIResponseModel
}

TaobaoWirelessXcodeCreateAPIResponse 创建二维码/短连接 API返回值 taobao.wireless.xcode.create

创建码平台的普通二维码或者长连接转短连接服务

func GetTaobaoWirelessXcodeCreateAPIResponse added in v1.3.4

func GetTaobaoWirelessXcodeCreateAPIResponse() *TaobaoWirelessXcodeCreateAPIResponse

GetTaobaoWirelessXcodeCreateAPIResponse 从 sync.Pool 获取 TaobaoWirelessXcodeCreateAPIResponse

func (*TaobaoWirelessXcodeCreateAPIResponse) Reset added in v1.3.4

Reset 清空结构体

type TaobaoWirelessXcodeCreateAPIResponseModel

type TaobaoWirelessXcodeCreateAPIResponseModel struct {
	XMLName xml.Name `xml:"wireless_xcode_create_response"`
	// 平台颁发的每次请求访问的唯一标识
	RequestId string `json:"request_id,omitempty" xml:"request_id,omitempty"`
	// 创建二维码/短连接 返回信息
	Xcode *XCodeTo `json:"xcode,omitempty" xml:"xcode,omitempty"`
}

TaobaoWirelessXcodeCreateAPIResponseModel is 创建二维码/短连接 成功返回结果

func (*TaobaoWirelessXcodeCreateAPIResponseModel) Reset added in v1.3.4

Reset 清空结构体

type XCodeTo

type XCodeTo struct {
	// 二维码图片地址
	ImgUrl string `json:"img_url,omitempty" xml:"img_url,omitempty"`
	// 最后修改时间
	GmtModified string `json:"gmt_modified,omitempty" xml:"gmt_modified,omitempty"`
	// 创建时间
	GmtCreate string `json:"gmt_create,omitempty" xml:"gmt_create,omitempty"`
	// 有效期开始时间
	LifeStart string `json:"life_start,omitempty" xml:"life_start,omitempty"`
	// 短连接
	ShortUrl string `json:"short_url,omitempty" xml:"short_url,omitempty"`
	// 短连接关键字符
	ShortName string `json:"short_name,omitempty" xml:"short_name,omitempty"`
	// 有效期结束时间,使用短链接跳转的,结束后不再可以访问
	LifeEnd string `json:"life_end,omitempty" xml:"life_end,omitempty"`
	// 记录ID
	Id int64 `json:"id,omitempty" xml:"id,omitempty"`
	// 码的状态,1-生效,0-未生效,-1-逻辑删除。
	Status int64 `json:"status,omitempty" xml:"status,omitempty"`
	// 所属用户ID,如果入参没有用户登录信息,则随机生成
	UserId int64 `json:"user_id,omitempty" xml:"user_id,omitempty"`
}

XCodeTo 结构体

func GetXCodeTo added in v1.3.4

func GetXCodeTo() *XCodeTo

GetXCodeTo() 从对象池中获取XCodeTo

Jump to

Keyboard shortcuts

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