material

package
v0.0.0-...-b3dc21d Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package material 素材管理

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Upload

func Upload(ctx *corporation.App, media string, params url.Values) (resp []byte, err error)

上传临时素材

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/linbaozhong/wxwork/corporation"
	"github.com/linbaozhong/wxwork/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/linbaozhong/wxwork/corporation"
	"github.com/linbaozhong/wxwork/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.

Jump to

Keyboard shortcuts

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