github.com/chanxuehong/wechat@v0.0.0-20230222024006-36f0325263cd/mp/shakearound/page/update.go (about)

     1  package page
     2  
     3  import (
     4  	"github.com/chanxuehong/wechat/mp/core"
     5  )
     6  
     7  type UpdateParameters struct {
     8  	PageId      int64  `json:"page_id"`               // 必须, 摇周边页面唯一ID
     9  	Title       string `json:"title,omitempty"`       // 必须, 在摇一摇页面展示的主标题,不超过6个字
    10  	Description string `json:"description,omitempty"` // 必须, 在摇一摇页面展示的副标题,不超过7个字
    11  	PageURL     string `json:"page_url,omitempty"`    // 必须, 跳转链接
    12  	IconURL     string `json:"icon_url,omitempty"`    // 必须, 在摇一摇页面展示的图片。图片需先上传至微信侧服务器,用“素材管理-上传图片素材”接口上传图片,返回的图片URL再配置在此处
    13  	Comment     string `json:"comment,omitempty"`     // 可选, 页面的备注信息,不超过15个字
    14  }
    15  
    16  // 编辑页面信息
    17  func Update(clt *core.Client, para *UpdateParameters) (err error) {
    18  	var result core.Error
    19  
    20  	incompleteURL := "https://api.weixin.qq.com/shakearound/page/update?access_token="
    21  	if err = clt.PostJSON(incompleteURL, para, &result); err != nil {
    22  		return
    23  	}
    24  
    25  	if result.ErrCode != core.ErrCodeOK {
    26  		err = &result
    27  		return
    28  	}
    29  	return
    30  }