ArtisanCloud/PowerWeChat

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

Closed this issue · 3 comments

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

是不是这个?

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)
}

好的,感谢。