Documentation ¶
Overview ¶
Package material 素材管理
Index ¶
- func Get(ctx *corporation.App, params url.Values) (resp []byte, err error)
- func Jssdk(ctx *corporation.App, params url.Values) (resp []byte, 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 ¶
获取临时素材
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
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/wechat4work/corporation" "github.com/fastwego/wechat4work/corporation/apis/material" ) func main() { var ctx *corporation.App params := url.Values{} resp, err := material.Get(ctx, params) fmt.Println(resp, err) }
Output:
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
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/wechat4work/corporation" "github.com/fastwego/wechat4work/corporation/apis/material" ) func main() { var ctx *corporation.App params := url.Values{} resp, err := material.Jssdk(ctx, params) fmt.Println(resp, err) }
Output:
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/fastwego/wechat4work/corporation" "github.com/fastwego/wechat4work/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/fastwego/wechat4work/corporation" "github.com/fastwego/wechat4work/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.