Documentation ¶
Overview ¶
Package ma 包含码上淘API相关结构体
Index ¶
- func ReleaseQrCodeStyle(v *QrCodeStyle)
- func ReleaseQrcodeDo(v *QrcodeDo)
- func ReleaseTaobaoMaQrcodeCommonCreateAPIRequest(v *TaobaoMaQrcodeCommonCreateAPIRequest)
- func ReleaseTaobaoMaQrcodeCommonCreateAPIResponse(v *TaobaoMaQrcodeCommonCreateAPIResponse)
- func ReleaseTaobaoWirelessXcodeCreateAPIRequest(v *TaobaoWirelessXcodeCreateAPIRequest)
- func ReleaseTaobaoWirelessXcodeCreateAPIResponse(v *TaobaoWirelessXcodeCreateAPIResponse)
- func ReleaseXCodeTo(v *XCodeTo)
- type QrCodeStyle
- type QrcodeDo
- type TaobaoMaQrcodeCommonCreateAPIRequest
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetApiMethodName() string
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetApiParams(params url.Values)
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetChannelName() string
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetContent() string
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetLogo() string
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetName() string
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetNeedEps() bool
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetRawParams() model.Params
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetSize() int64
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetStyle() string
- func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetType() string
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) Reset()
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetChannelName(_channelName string) error
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetContent(_content string) error
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetLogo(_logo string) error
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetName(_name string) error
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetNeedEps(_needEps bool) error
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetSize(_size int64) error
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetStyle(_style string) error
- func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetType(_type string) error
- type TaobaoMaQrcodeCommonCreateAPIResponse
- type TaobaoMaQrcodeCommonCreateAPIResponseModel
- type TaobaoWirelessXcodeCreateAPIRequest
- func (r TaobaoWirelessXcodeCreateAPIRequest) GetApiMethodName() string
- func (r TaobaoWirelessXcodeCreateAPIRequest) GetApiParams(params url.Values)
- func (r TaobaoWirelessXcodeCreateAPIRequest) GetBizCode() string
- func (r TaobaoWirelessXcodeCreateAPIRequest) GetContent() string
- func (r TaobaoWirelessXcodeCreateAPIRequest) GetRawParams() model.Params
- func (r TaobaoWirelessXcodeCreateAPIRequest) GetStyle() *QrCodeStyle
- func (r *TaobaoWirelessXcodeCreateAPIRequest) Reset()
- func (r *TaobaoWirelessXcodeCreateAPIRequest) SetBizCode(_bizCode string) error
- func (r *TaobaoWirelessXcodeCreateAPIRequest) SetContent(_content string) error
- func (r *TaobaoWirelessXcodeCreateAPIRequest) SetStyle(_style *QrCodeStyle) error
- type TaobaoWirelessXcodeCreateAPIResponse
- type TaobaoWirelessXcodeCreateAPIResponseModel
- type XCodeTo
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 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
Types ¶
type QrCodeStyle ¶
type QrCodeStyle struct { // 可选参数,logo的淘宝tfs地址,默认无 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 结构体
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 ¶
func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetContent() string
GetContent Content Getter
func (TaobaoMaQrcodeCommonCreateAPIRequest) GetLogo ¶
func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetLogo() string
GetLogo Logo Getter
func (TaobaoMaQrcodeCommonCreateAPIRequest) GetName ¶
func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetName() string
GetName Name Getter
func (TaobaoMaQrcodeCommonCreateAPIRequest) GetNeedEps ¶
func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetNeedEps() bool
GetNeedEps NeedEps Getter
func (TaobaoMaQrcodeCommonCreateAPIRequest) GetRawParams ¶ added in v1.2.8
func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetRawParams() model.Params
GetRawParams IRequest interface 方法, 获取API原始参数
func (TaobaoMaQrcodeCommonCreateAPIRequest) GetSize ¶
func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetSize() int64
GetSize Size Getter
func (TaobaoMaQrcodeCommonCreateAPIRequest) GetStyle ¶
func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetStyle() string
GetStyle Style Getter
func (TaobaoMaQrcodeCommonCreateAPIRequest) GetType ¶
func (r TaobaoMaQrcodeCommonCreateAPIRequest) GetType() string
GetType Type Getter
func (*TaobaoMaQrcodeCommonCreateAPIRequest) Reset ¶ added in v1.3.4
func (r *TaobaoMaQrcodeCommonCreateAPIRequest) Reset()
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;
func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetLogo ¶
func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetLogo(_logo string) error
SetLogo is Logo Setter 二维码的logo地址,只允许淘宝官方图片空间的图片地址,其他非图片空间图片不支持。官方淘logo图片地址:http://img01.taobaocdn.com/imgextra/T1Od8YFT8eXXXXXXXX。
func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetName ¶
func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetName(_name string) error
SetName is Name Setter 二维码名字,即创建的二维码,在码平台上显示记录的名字。
func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetNeedEps ¶
func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetNeedEps(_needEps bool) error
SetNeedEps is NeedEps Setter 是否需要矢量图,如果需要矢量图,设置为true;只支持普通二维码,官方模板不支持矢量图
func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetSize ¶
func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetSize(_size int64) error
SetSize is Size Setter 二维码尺寸,只支持普通二维码,不支持官方模板,单位为像素,最小为60×60,最大为300×300,建议175×175。官方模板大小尺寸见style说明。
func (*TaobaoMaQrcodeCommonCreateAPIRequest) SetStyle ¶
func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetStyle(_style string) error
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 ¶
func (r *TaobaoMaQrcodeCommonCreateAPIRequest) SetType(_type string) error
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
func (m *TaobaoMaQrcodeCommonCreateAPIResponse) Reset()
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
func (m *TaobaoMaQrcodeCommonCreateAPIResponseModel) Reset()
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 ¶
func (r TaobaoWirelessXcodeCreateAPIRequest) GetBizCode() string
GetBizCode BizCode Getter
func (TaobaoWirelessXcodeCreateAPIRequest) GetContent ¶
func (r TaobaoWirelessXcodeCreateAPIRequest) GetContent() string
GetContent Content Getter
func (TaobaoWirelessXcodeCreateAPIRequest) GetRawParams ¶ added in v1.2.8
func (r TaobaoWirelessXcodeCreateAPIRequest) GetRawParams() model.Params
GetRawParams IRequest interface 方法, 获取API原始参数
func (TaobaoWirelessXcodeCreateAPIRequest) GetStyle ¶
func (r TaobaoWirelessXcodeCreateAPIRequest) GetStyle() *QrCodeStyle
GetStyle Style Getter
func (*TaobaoWirelessXcodeCreateAPIRequest) Reset ¶ added in v1.3.4
func (r *TaobaoWirelessXcodeCreateAPIRequest) Reset()
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 ¶
func (r *TaobaoWirelessXcodeCreateAPIRequest) SetStyle(_style *QrCodeStyle) error
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
func (m *TaobaoWirelessXcodeCreateAPIResponse) Reset()
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
func (m *TaobaoWirelessXcodeCreateAPIResponseModel) Reset()
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 结构体