mirror of
https://github.com/xxjwxc/public.git
synced 2025-09-26 20:01:19 +08:00
1
This commit is contained in:
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/usthooz/gutil"
|
||||
"github.com/xxjwxc/public/message"
|
||||
"github.com/xxjwxc/public/mycache"
|
||||
"github.com/xxjwxc/public/myglobal"
|
||||
"github.com/xxjwxc/public/myhttp"
|
||||
"github.com/xxjwxc/public/mylog"
|
||||
"github.com/xxjwxc/public/tools"
|
||||
@@ -358,6 +357,7 @@ func (_wx *wxTools) GetFreepublish(max int64) (out []FreepublishiInfo, err error
|
||||
for {
|
||||
bo, _ := json.Marshal(req)
|
||||
resb, _ := myhttp.OnPostJSON(_sendFreepublish+accessToken, string(bo))
|
||||
fmt.Println(string(resb))
|
||||
var res FreepublishiInfoResp
|
||||
json.Unmarshal(resb, &res)
|
||||
if res.ItemCount == 0 {
|
||||
@@ -404,7 +404,7 @@ func (_wx *wxTools) GetMaterial(mediaId string) (string, error) {
|
||||
var res MediaResp
|
||||
err = json.Unmarshal(resb, &res)
|
||||
if err != nil {
|
||||
id := fmt.Sprintf("/file/img/%v.jpg", myglobal.GetNode().GetID())
|
||||
id := fmt.Sprintf("/file/img/%v.jpg", mediaId)
|
||||
fileName := path.Join(tools.GetCurrentDirectory(), id)
|
||||
tools.WriteFileEx(fileName, resb, true)
|
||||
return id, nil
|
||||
|
@@ -127,6 +127,10 @@ type CustomMsg struct {
|
||||
Text *CustomText `json:"text,omitempty"` // 文本类容
|
||||
Voice *CustomVoice `json:"voice,omitempty"` // 语音
|
||||
Music *CustomMusic `json:"music,omitempty"` // 音乐消息
|
||||
Image *CustomImage `json:"image,omitempty"` // 图片消息
|
||||
}
|
||||
type CustomImage struct {
|
||||
MediaId string `json:"media_id"` // 图片
|
||||
}
|
||||
|
||||
type CustomText struct {
|
||||
|
Reference in New Issue
Block a user