Documentation ¶
Overview ¶
Package material 素材管理
Index ¶
- func Get(ctx *corporation.App, params url.Values, header http.Header) (resp *http.Response, err error)
- func Jssdk(ctx *corporation.App, params url.Values) (resp *http.Response, err error)
- func Upload(ctx *corporation.App, media string, params url.Values) (resp []byte, err error)
- func UploadImg(ctx *corporation.App, media string) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(ctx *corporation.App, params url.Values, header http.Header) (resp *http.Response, err error)
获取临时素材
See: https://work.weixin.qq.com/api/doc/90000/90135/90254
GET https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID
func Jssdk ¶
获取高清语音素材
See: https://work.weixin.qq.com/api/doc/90000/90135/90255
GET https://qyapi.weixin.qq.com/cgi-bin/media/get/jssdk?access_token=ACCESS_TOKEN&media_id=MEDIA_ID
func Upload ¶
上传临时素材
See: https://work.weixin.qq.com/api/doc/90000/90135/90253
POST(@media) https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE
Example ¶
package main import ( "fmt" "net/url" "github.com/cvblood/qywxapi/corporation" "github.com/cvblood/qywxapi/corporation/apis/material" ) func main() { var ctx *corporation.App media := "" params := url.Values{} resp, err := material.Upload(ctx, media, params) fmt.Println(resp, err) }
Output:
func UploadImg ¶
func UploadImg(ctx *corporation.App, media string) (resp []byte, err error)
上传图片
See: https://work.weixin.qq.com/api/doc/90000/90135/90256
POST(@media) https://qyapi.weixin.qq.com/cgi-bin/media/uploadimg?access_token=ACCESS_TOKEN
Example ¶
package main import ( "fmt" "github.com/cvblood/qywxapi/corporation" "github.com/cvblood/qywxapi/corporation/apis/material" ) func main() { var ctx *corporation.App media := "" resp, err := material.UploadImg(ctx, media) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.