京东 api 客户端
本地调试可以在 go.mod 中添加
replace github.com/one-piece-official/jd-api => /Users/xxx/Documents/jd-api
package main
import (
"fmt"
"github.com/one-piece-official/jd-api"
dto "github.com/one-piece-official/jd-api/dto"
)
const (
AppID = ""
AppSecret = ""
)
func main() {
fmt.Println("Hello")
client := jingdong.NewClient(AppID, AppSecret)
var res dto.JdUnionOpenUserRegisterValidateResponse
userStateReq := dto.UserStateReq{
UserID: "869706036987313",
UserIDType: "8",
}
if err := client.Query(&dto.UserAccountDeviceInfoRequest{UserStateReq: userStateReq}, &res); err != nil {
fmt.Println(err)
}
fmt.Println(res.Registered())
}
userIdType 说明:
- 8(安卓移动设备Imei);
- 16(苹果移动设备Openudid);
- 32(苹果移动设备idfa);
- 64(安卓移动设备imei的md5编码,32位,大写,匹配率略低);
- 128(苹果移动设备idfa的md5编码,32位,大写,匹配率略低);
- 32768(安卓移动设备oaid);