youzansdk

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

youzansdk

有赞SDK Golang实现

使用说明

加积分

  var client youzansdk.YouzanClient
	client = youzansdk.YouzanClient{
		Token:           accessToken,
		ClientID:        clientID,
		ClientSecretKey: config.YouzanConfig[clientID].ClientSecret,
	}
  req := request.YouzanCrmCustomerPointsIncreaseRequest{
		Reason:    "测试积分增加",
		KdtID:     42555125,
		RequestID: "2222222222222222222",
		ClientID:  "21552144",
		Points:    100,
		User: struct {
			AccountType int8   `json:"account_type"`
			AccountID   string `json:"account_id"`
		}{
			AccountType: 5,
			AccountID:   "openid of youzan",
		},
	}
	res := response.YouzanCrmCustomerPointsIncreaseResponse{}
	body, err := client.Execute(&req, &res)

Thanks

jetbrains

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type YouzanClient

type YouzanClient struct {
	Token           string
	URL             string
	ClientSecretKey string
	ClientID        string
}

YouzanClient ..

func (YouzanClient) DecryptMessage

func (c YouzanClient) DecryptMessage(message string) (string, error)

func (YouzanClient) Execute

func (c YouzanClient) Execute(request request.BaseRequest, v interface{}) (string, error)

Execute 执行请求

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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