ArtisanCloud / PowerWeChat

PowerWechat是一款基于WeChat SDK for Golang,支持小程序、微信支付、企业微信、公众号等全微信生态
https://powerwechat.artisan-cloud.com
MIT License
1.3k stars 165 forks source link

我们现在支持新建草稿吗? #553

Closed heneyin closed 2 weeks ago

heneyin commented 2 weeks ago

如题,现在有没有新建草稿的能力,在文档里没有找到。

heneyin commented 2 weeks ago

是不是这个?

func APIDraftAdd(ctx *gin.Context) {
    data, err := services.OfficialAccountApp.Publish.DraftAdd(ctx.Request.Context(), &request.RequestDraftAdd{
        Articles: []*request.Article{
            &request.Article{
                Title:              "testTitle",
                Author:             "testAuthor",
                Digest:             "testDigest",
                Content:            "testContent",
                ContentSourceUrl:   "test url",
                ThumbMediaId:       "test",
                NeedOpenComment:    0,
                OnlyFansCanComment: 1,
            },
        },
    })
    if err != nil {
        ctx.String(http.StatusBadRequest, err.Error())
        return
    }
    ctx.JSON(http.StatusOK, data)
}
Matrix-X commented 2 weeks ago

https://developers.weixin.qq.com/doc/offiaccount/Draft_Box/Add_draft.html

是的只是个

image
heneyin commented 2 weeks ago

好的,感谢。