jdSdk

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

About jd-sdk

京东开放平台golang版本sdk

京东api地址

https://open.jd.com/#/doc/api?apiCateId=106&apiId=6146&apiName=jingdong.getUserEntryWechatGroupTrack

demo

var (
    AppKey      string = "Your AppKey"
    AppSecret   string = "Your AppSecret"
    AccessToken string = "Your accessToken"
)

config := &jdSdk.JdBaseConfig{
    AppKey:         AppKey,
    AppSecret:      AppSecret,
    ApiVersion:     "1.0",
    AccessToken:    AccessToken,
    BaseUrl:        "https://api.jd.com/routerjson",
    ConnectTimeout: 2000,
}

queryRequest := jdUnionOpenGoodsQuery_request.New(config)
params := queryRequest.GetParams()
goodsQueryParam := jdUnionOpenGoodsQuery_request.GoodsReqDto{
	Keyword: "牛奶",
}
params.GoodsReqDto = goodsQueryParam

execute, err := queryRequest.Execute()
if err != nil {
	fmt.Println(err)
}
fmt.Println(execute)
ps
  • 目前仅只支持了几个api,其他的需要自己手动接入,仿照写即可。

License

Apache License, Version 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpPost

func HttpPost(urls string, data map[string]string, timeout int64) (string, error)

Types

type BaseJdApiRequest

type BaseJdApiRequest struct {
	// contains filtered or unexported fields
}

func (*BaseJdApiRequest) GetClient

func (b *BaseJdApiRequest) GetClient() *JdClient

func (*BaseJdApiRequest) GetConfig

func (b *BaseJdApiRequest) GetConfig() *JdBaseConfig

func (*BaseJdApiRequest) SetClient

func (b *BaseJdApiRequest) SetClient(client *JdClient)

func (*BaseJdApiRequest) SetConfig

func (b *BaseJdApiRequest) SetConfig(config *JdBaseConfig)

type JdBaseApiRequest

type JdBaseApiRequest interface {
	GetConfig() *JdBaseConfig
	SetConfig(*JdBaseConfig)
	GetParamsObject() interface{}
	GetMethodName() string
}

type JdBaseConfig

type JdBaseConfig struct {
	AppKey         string
	AppSecret      string
	AccessToken    string
	BaseUrl        string
	ApiVersion     string
	ConnectTimeout int64
}

type JdClient

type JdClient struct {
}
var DefaultJdApiClient *JdClient = NewJdClient()

func NewJdClient

func NewJdClient() *JdClient

func (*JdClient) Request

func (j *JdClient) Request(params JdBaseApiRequest, isNeedAuth bool) (string, error)

Directories

Path Synopsis
jdUnionOpenGoodsJingfenQuery
jdUnionOpenGoodsQuery
jdUnionOpenOrderRowQuery
jdUnionOpenPromotionBySubUnionIdGet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL