material

package
v2.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*context.Context
}

Client 素材管理接口实例

func NewClient

func NewClient(ctx *context.Context) *Client

NewClient 初始化实例

func (*Client) UploadAttachment

func (r *Client) UploadAttachment(filename string, mediaType string, attachmentType int) (*UploadAttachmentResponse, error)

UploadAttachment 上传附件资源 @see https://developer.work.weixin.qq.com/document/path/95098 @mediaType 媒体文件类型,分别有图片(image)、视频(video)、普通文件(file) @attachment_type 附件类型,不同的附件类型用于不同的场景。1:朋友圈;2:商品图册

func (*Client) UploadImg

func (r *Client) UploadImg(filename string) (*UploadImgResponse, error)

UploadImg 上传图片 @see https://developer.work.weixin.qq.com/document/path/90256

func (*Client) UploadTempFile

func (r *Client) UploadTempFile(filename string, mediaType string) (*UploadTempFileResponse, error)

UploadTempFile 上传临时素材 @see https://developer.work.weixin.qq.com/document/path/90253 @mediaType 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)

type UploadAttachmentResponse

type UploadAttachmentResponse struct {
	util.CommonError
	MediaID  string `json:"media_id"`
	CreateAt int64  `json:"created_at"`
	Type     string `json:"type"`
}

UploadAttachmentResponse 上传资源附件响应

type UploadImgResponse

type UploadImgResponse struct {
	util.CommonError
	URL string `json:"url"`
}

UploadImgResponse 上传图片响应

type UploadTempFileResponse

type UploadTempFileResponse struct {
	util.CommonError
	MediaID  string `json:"media_id"`
	CreateAt string `json:"created_at"`
	Type     string `json:"type"`
}

UploadTempFileResponse 上传临时素材响应

Jump to

Keyboard shortcuts

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