model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

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"`
	RequestId string `json:"request_id,omitempty"`
}

BaseResponse 通用返回格式

func (BaseResponse) Error

func (r BaseResponse) Error() string

ErrorMsg 返回的错误信息

func (BaseResponse) IsError

func (r BaseResponse) IsError() bool

IsError 判断接口是否返回错误

type GetRequest

type GetRequest interface {
	// Encode encode request to string
	Encode() string
}

GetRequest get request interface

type PageInfo

type PageInfo struct {
	// 页数
	Page int `json:"page,omitempty"`
	// 页面大小
	PageSize int `json:"page_size,omitempty"`
	// 总数
	TotalNumber int `json:"total_number,omitempty"`
	// 总页数
	TotalPage int `json:"total_page,omitempty"`
}

type PostRequest

type PostRequest interface {
	// Encode encode request to bytes
	Encode() []byte
}

PostRequest post request interface

type Response

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

Response 接口响应

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 {
	// 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