entity

package
v0.0.0-...-4009942 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	URL     string `json:"-"`     // API 地址
	MerchID string `json:"mchid"` // 商户号
	Sign    string `json:"sign"`  // 数据签名
	Data    string `json:"-"`     // 数据
}

Request 请求结构

func NewRequest

func NewRequest(u, merchID, data string) *Request

NewRequest 创建请求

func (*Request) JSON

func (r *Request) JSON() (string, error)

JSON 组合请求对象

func (*Request) Signature

func (r *Request) Signature(key string) error

Signature 计算签名

type Response

type Response struct {
	ReturnCode int    `json:"return_code"` // 1:请求成功,0:请求失败
	ReturnMsg  string `json:"return_msg"`  // 返回消息
	Sign       string `json:"sign"`        // 数据签名
	Data       string `json:"-"`           // 数据
}

Response 响应结构

func ParseResponse

func ParseResponse(data string) *Response

ParseResponse 解析响应

func (*Response) Get

func (r *Response) Get(key string) gjson.Result

Get 获取响应内容

Jump to

Keyboard shortcuts

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