model

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package model provides common request and response models.

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestTypeBody   = "RequestBody"
	RequestTypeParams = "RequestParams"
	RequestTypeForm   = "RequestForm"
	Context           = "Context"
)

Functions

This section is empty.

Types

type BaseResponse added in v0.2.0

type BaseResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func (*BaseResponse) GetCode added in v0.2.0

func (r *BaseResponse) GetCode() int

func (*BaseResponse) GetData added in v0.2.0

func (r *BaseResponse) GetData() interface{}

func (*BaseResponse) GetMessage added in v0.2.0

func (r *BaseResponse) GetMessage() string

func (*BaseResponse) SetCode added in v0.2.0

func (r *BaseResponse) SetCode(code int)

func (*BaseResponse) SetData added in v0.2.0

func (r *BaseResponse) SetData(data interface{})

func (*BaseResponse) SetMessage added in v0.2.0

func (r *BaseResponse) SetMessage(message string)

type RequestBody added in v0.2.0

type RequestBody struct{}

type RequestForm added in v0.2.0

type RequestForm struct{}

type RequestParams added in v0.2.0

type RequestParams struct{}

type Response

type Response interface {
	SetCode(code int)
	GetCode() int
	SetMessage(message string)
	GetMessage() string
	SetData(data interface{})
	GetData() interface{}
}

Jump to

Keyboard shortcuts

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