mtclient

package
v0.0.0-...-905ac7b Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultMeituanClient

type DefaultMeituanClient struct {
	DeveloperId int64
	SignKey     string
	HttpClient  *http.Client
}

func (*DefaultMeituanClient) GetToken

func (client *DefaultMeituanClient) GetToken(businessId int, code string) ([]byte, error)

func (*DefaultMeituanClient) InvokeApi

func (client *DefaultMeituanClient) InvokeApi(apiPath string, businessId int, appAuthToken string, data interface{}) ([]byte, error)

InvokeApi 方法用于自定义路径和参数调用美团api, apiPath用于指定API的路径(不包含域名),例如/waimai/order/queryById data字段用于指定业务参数,可使用map[string]string,也可使用包含业务字段的结构体

func (*DefaultMeituanClient) RefreshToken

func (client *DefaultMeituanClient) RefreshToken(businessId int, refreshToken string) ([]byte, error)

type HttpClient

type HttpClient struct {
	*http.Client
}

type MeituanClient

type MeituanClient interface {
	InvokeApi(apiPath string, businessId int, appAuthToken string, data interface{}) ([]byte, error)

	GetToken(businessId int, code string) ([]byte, error)

	RefreshToken(businessId int, refreshToken string) ([]byte, error)
}

func NewDefaultClient

func NewDefaultClient(developerId int64, signKey string) MeituanClient

func NewDefaultClientWithTimeout

func NewDefaultClientWithTimeout(developerId int64, signKey string, timeoutSec int64) MeituanClient

Jump to

Keyboard shortcuts

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