Go SDK调用说明

github项目地址(https://github.com/idouzi/tongduiba-open-sdk-go)

NOTICE

商城后台正确获取到appKey,appSecret参数 已开放授权调用的API文档,请查看(https://m.tongdui8.com/v1/docs/)

使用

1.头文件中引入包

import (
    "github.com/idouzi/tongduiba-open-sdk-go/util"
)

2.生成自动登录url链接

//传参生成调用对象 
tdb := util.New("YOUR_APP_KEY", "YOUR_APP_SECRET")
params := make(map[string]string)
params["redirect"] = ""
params["unionId"] = YOUR_UNION_ID
params["openId"] = YOUR_OPEN_ID
params["source"] = "app"
//生成自动登录链接
url := tdb.GetUrl(params, "/v1/user/login/auto-login")

3.查询商家积分信息

//传参生成调用对象   
tdb := util.New("YOUR_APP_KEY", "YOUR_APP_SECRET")
params := make(map[string]string)
params["unionId"] = YOUR_UNION_ID
//返回信息
getUrl := tdb.Get(params, "/sdk/api/query-user-points-amount")

results matching ""

    No results matching ""