获取小程序码
This commit is contained in:
19
platformapi/weixinapi/wxa.go
Normal file
19
platformapi/weixinapi/wxa.go
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package weixinapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
//获取小程序码
|
||||||
|
func (a *API) GetUnlimited(scene, page string) (results interface{}, err error) {
|
||||||
|
params := map[string]interface{}{
|
||||||
|
"scene": scene,
|
||||||
|
"page": page,
|
||||||
|
}
|
||||||
|
bytes, err := json.Marshal(params)
|
||||||
|
if err != nil {
|
||||||
|
return results, err
|
||||||
|
}
|
||||||
|
results, err = a.AccessAPI("wxa/getwxacodeunlimit", nil, string(bytes))
|
||||||
|
return results, err
|
||||||
|
}
|
||||||
13
platformapi/weixinapi/wxa_test.go
Normal file
13
platformapi/weixinapi/wxa_test.go
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package weixinapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestGetUnlimited(t *testing.T) {
|
||||||
|
result, err := api.GetUnlimited("a=1", "")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err.Error())
|
||||||
|
}
|
||||||
|
sugarLogger.Debug(result)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user