Skip to content

Commit

Permalink
fix: 公众号新增模板接口,合并定义参数
Browse files Browse the repository at this point in the history
  • Loading branch information
yangj23 committed Jul 16, 2024
1 parent 2bf4146 commit 5c0580c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions officialaccount/message/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,15 @@ func (tpl *Template) Add(shortID string, keyNameList []string) (templateID strin
if err != nil {
return
}
var msg = struct {
ShortID string `json:"template_id_short"`
KeyNameList []string `json:"keyword_name_list"`
}{ShortID: shortID, KeyNameList: keyNameList}
uri := fmt.Sprintf("%s?access_token=%s", templateAddURL, accessToken)
var response []byte
var (
msg = struct {
ShortID string `json:"template_id_short"`
KeyNameList []string `json:"keyword_name_list"`
}{ShortID: shortID, KeyNameList: keyNameList}
uri string
response []byte
)
uri = fmt.Sprintf("%s?access_token=%s", templateAddURL, accessToken)
response, err = util.PostJSON(uri, msg)
if err != nil {
return
Expand Down

0 comments on commit 5c0580c

Please sign in to comment.