mt

package
v0.0.0-...-29cfe02 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseUrl = "https://waimaiopen.meituan.com/api/v1/" // 请求根地址
	Timeout = 3000                                     // 超时时间 3000ms
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	AppId       string                 // app id
	AppSecret   string                 // app secret
	Url         string                 // 请求url
	RequestData map[string]interface{} // 请求参数map
	RequestBody string                 // 请求参数:排序的字符串连接 例如:app_poi_code=&medicine_data=
	SystemData  map[string]interface{} // 系统参数map
	SystemBody  string                 // 系统参数:排序的字符串连接 放在get参数中 例如:app_id=&timestamp=&sign=
	// contains filtered or unexported fields
}

func New

func New(appId, appSecret string) *Base

New 初始化

func (*Base) VerifySign

func (b *Base) VerifySign(params map[string]interface{}) bool

VerifySign 验证回调签名

func (*Base) WithClient

func (b *Base) WithClient(method string) (string, error)

WithClient 请求

func (*Base) WithRequestParams

func (b *Base) WithRequestParams(url string, requestData map[string]interface{}) *Base

WithRequestParams get请求参数设置 所有参数 包括系统参数也通过get方式去请求 例如:app_id=&timestamp=&sig=&{请求参数} post请求参数设置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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