model

package
v0.0.0-...-4c075ac Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package model SDK models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Code    int             `json:"code,omitempty"`    // 返回码
	Message string          `json:"message,omitempty"` // 返回信息
	Data    json.RawMessage `json:"data,omitempty"`    // JSON返回值
	TraceId string          `json:"traceId,omitempty"` // 请求id
}

BaseResponse shared response data struct

func (BaseResponse) Error

func (r BaseResponse) Error() string

Error implement error interface

func (BaseResponse) IsError

func (r BaseResponse) IsError() bool

IsError detect if the response is an error

type GetRequest

type GetRequest interface {
	Url() string
	Encode() string
}

GetRequest request interface for get

type PageInfo

type PageInfo struct {
	TotalCount int `json:"totalCount"`
}

type PostRequest

type PostRequest interface {
	Url() string
	Encode() []byte
}

PostRequest request interface for post

type ReportResponse

type ReportResponse struct {
	Code           int                `json:"code,omitempty"`    // 返回码
	Message        string             `json:"message,omitempty"` // 返回信息
	Data           []order.ReportData `json:"data,omitempty"`    // JSON返回值
	TraceId        string             `json:"traceId,omitempty"` // 请求id
	LastUpdateTime string             `json:"lastUpdateTime,omitempty"`
	TotalCount     int                `json:"totalCount,omitempty"`
}

type Response

type Response interface {
	IsError() bool
	Error() string
}

Response api response interface

type UploadField

type UploadField struct {
	// Key field key
	Key string
	// Value field value
	Value string
	// Reader upload file reader
	Reader io.Reader
}

UploadField multipart/form-data post request field struct

type UploadRequest

type UploadRequest interface {
	Url() string
	// Encode encode request to UploadFields
	Encode() []UploadField
}

UploadRequest multipart/form-data reqeust interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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