forked from magicshui/wechat-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
category.go
30 lines (25 loc) · 826 Bytes
/
category.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// @description wechat 是腾讯微信公众平台 api 的 golang 语言封装
// @link https://github.com/chanxuehong/wechat for the canonical source repository
// @license https://github.com/chanxuehong/wechat/blob/master/LICENSE
// @authors chanxuehong(chanxuehong@gmail.com)
package poi
import (
"github.com/chanxuehong/wechat/mp"
)
// 查询门店信息.
func (clt *Client) GetWxCategory() (categoryList []string, err error) {
var result struct {
mp.Error
CategoryList []string `json:"category_list"`
}
incompleteURL := "https://api.weixin.qq.com/cgi-bin/api_getwxcategory?access_token="
if err = ((*mp.Client)(clt)).GetJSON(incompleteURL, &result); err != nil {
return
}
if result.ErrCode != mp.ErrCodeOK {
err = &result.Error
return
}
categoryList = result.CategoryList
return
}