models

package
v0.0.0-...-da45c02 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

README

resp

返回结构体

处理返回业务码和业务码对应信息

Documentation

Index

Constants

View Source
const (
	//commom
	RESP_OK          = 10000
	RESP_ERR         = 10001
	RESP_PARAM_ERR   = 10002
	RESP_TOKEN_ERR   = 10003
	RESP_NO_ACCESS   = 10004
	RESP_APP_NOT_ON  = 10005
	RESP_UNKNOWN_ERR = 10006
)

响应码 @Description

Variables

This section is empty.

Functions

func GetMsgWithCode

func GetMsgWithCode(code int) string

Types

type RespInfo

type RespInfo struct {
	F_responseNo  int         `required:"true" description:"响应码"`
	F_responseMsg string      `description:"响应码描述"`
	F_data        interface{} `description:"响应内容"`
}

@Title 返回数据结构处理 @Author cbping

func NewRespInfo

func NewRespInfo(code int, msg string, data interface{}) (respInfo *RespInfo)

func NewRespInfoWithCode

func NewRespInfoWithCode(code int, data interface{}) (respInfo *RespInfo)

func (*RespInfo) SetData

func (ri *RespInfo) SetData(data interface{})

@Title SetData @Description

func (*RespInfo) ToStringMap

func (ri *RespInfo) ToStringMap() (res map[string]interface{})

@Title 转化成map @Description @Return map[string]interface{}

Jump to

Keyboard shortcuts

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