mirror of
https://github.com/silenceper/wechat.git
synced 2026-03-01 00:35:26 +08:00
Compare commits
2 Commits
f2dedebcd7
...
b3b90e56cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3b90e56cc | ||
|
|
26a6d7dc1d |
@@ -3,6 +3,7 @@ package material
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/silenceper/wechat/v2/util"
|
"github.com/silenceper/wechat/v2/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,14 @@ import (
|
|||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"fmt"
|
"fmt"
|
||||||
"golang.org/x/crypto/pkcs12"
|
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
|
"golang.org/x/crypto/pkcs12"
|
||||||
)
|
)
|
||||||
|
|
||||||
// URIModifier URI修改器
|
// URIModifier URI修改器
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package material
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/silenceper/wechat/v2/util"
|
"github.com/silenceper/wechat/v2/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -55,11 +56,11 @@ func (r *Client) UploadImg(filename string) (*UploadImgResponse, error) {
|
|||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// UploadTempFile 上传临时素材
|
// UploadRemoteTempFile 上传临时素材
|
||||||
// @see https://developer.work.weixin.qq.com/document/path/90253
|
// @see https://developer.work.weixin.qq.com/document/path/90253
|
||||||
// @mediaType 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)
|
// @mediaType 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)
|
||||||
// 临时素材一般都是存储在oss上的,可以直接传递url
|
// 临时素材一般都是存储在oss上的,可以直接传递url
|
||||||
func (r *Client) UploadTempFile(url string, mediaType string) (*UploadTempFileResponse, error) {
|
func (r *Client) UploadRemoteTempFile(url string, mediaType string) (*UploadTempFileResponse, error) {
|
||||||
var (
|
var (
|
||||||
accessToken string
|
accessToken string
|
||||||
err error
|
err error
|
||||||
|
|||||||
Reference in New Issue
Block a user