vipSdk

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 vip-sdk

唯品会开放平台golang版本sdk

唯品会api地址

https://vop.vip.com/home#/api/service/list

demo

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

config := &vipSdk.VipBaseConfig{
	AppKey:         AppKey,
	AppSecret:      AppSecret,
	ApiVersion:     "1.0.0",
	AccessToken:    AccessToken,
	BaseUrl:        "https://vop.vipapis.com",
	ConnectTimeout: 3000,
}

request := queryRequest.New(config)
params := request.GetParams()
param := queryRequest.QueryRequest{
	Keyword:   "牛奶",
	RequestId: "requestId:1", //官方建议uuid
}
params.QueryRequest = param
execute, err := request.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 string, timeout int64) (string, error)

Types

type BaseVipApiRequest

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

func (*BaseVipApiRequest) GetClient

func (b *BaseVipApiRequest) GetClient() *VipClient

func (*BaseVipApiRequest) GetConfig

func (b *BaseVipApiRequest) GetConfig() *VipBaseConfig

func (*BaseVipApiRequest) SetClient

func (b *BaseVipApiRequest) SetClient(client *VipClient)

func (*BaseVipApiRequest) SetConfig

func (b *BaseVipApiRequest) SetConfig(config *VipBaseConfig)

type VipBaseApiRequest

type VipBaseApiRequest interface {
	GetConfig() *VipBaseConfig
	SetConfig(*VipBaseConfig)
	GetParamsObject() interface{}
	GetServiceName() string
	GetMethodName() string
}

type VipBaseConfig

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

type VipClient

type VipClient struct {
}
var DefaultVipApiClient *VipClient = NewVipClient()

func NewVipClient

func NewVipClient() *VipClient

func (*VipClient) Request

func (j *VipClient) Request(params VipBaseApiRequest, isNeedAuth bool) (string, error)

Jump to

Keyboard shortcuts

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