Documentation ¶
Index ¶
- Constants
- type Article
- type Material
- func (material *Material) AddMaterial(mediaType MediaType, filename string) (mediaID string, url string, err error)
- func (material *Material) AddNews(articles []*Article) (mediaID string, err error)
- func (material *Material) AddVideo(filename, title, introduction string) (mediaID string, url string, err error)
- func (material *Material) DeleteMaterial(mediaID string) error
- func (material *Material) GetMediaURL(mediaID string) (mediaURL string, err error)
- func (material *Material) ImageUpload(filename string) (url string, err error)
- func (material *Material) MediaUpload(mediaType MediaType, filename string) (media Media, err error)
- type Media
- type MediaType
Constants ¶
View Source
const ( //MediaTypeImage 媒体文件:图片 MediaTypeImage MediaType = "image" //MediaTypeVoice 媒体文件:声音 MediaTypeVoice = "voice" //MediaTypeVideo 媒体文件:视频 MediaTypeVideo = "video" //MediaTypeThumb 媒体文件:缩略图 MediaTypeThumb = "thumb" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { Title string `json:"title"` ThumbMediaID string `json:"thumb_media_id"` Author string `json:"author"` Digest string `json:"digest"` ShowCoverPic int `json:"show_cover_pic"` Content string `json:"content"` ContentSourceURL string `json:"content_source_url"` }
Article 永久图文素材
type Material ¶
Material 素材管理
func (*Material) AddMaterial ¶
func (material *Material) AddMaterial(mediaType MediaType, filename string) (mediaID string, url string, err error)
AddMaterial 上传永久性素材(处理视频需要单独上传)
func (*Material) AddVideo ¶
func (material *Material) AddVideo(filename, title, introduction string) (mediaID string, url string, err error)
AddVideo 永久视频素材文件上传
func (*Material) DeleteMaterial ¶
DeleteMaterial 删除永久素材
func (*Material) GetMediaURL ¶
GetMediaURL 返回临时素材的下载地址供用户自己处理 NOTICE: URL 不可公开,因为含access_token 需要立即另存文件
func (*Material) ImageUpload ¶
ImageUpload 图片上传
Click to show internal directories.
Click to hide internal directories.