response

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FAIL = 1
	OK   = 0
)

Variables

This section is empty.

Functions

func JSON added in v1.0.7

func JSON(ctx request.Context, resp *JsonResult)

JSON gin 框架使用

Types

type ErrorModel

type ErrorModel struct {
	Code    int64       `json:"code"`
	Message string      `json:"message"`
	Success bool        `json:"success"`
	Data    interface{} `json:"Data"`
}

ErrorModel 错误返回模型

func Error

func Error(data interface{}) ErrorModel

func ErrorNoHaveAuthority

func ErrorNoHaveAuthority() ErrorModel

func ErrorTokenInvalidation

func ErrorTokenInvalidation() ErrorModel

ErrorTokenInvalidation 401-未认证登录

func ErrorUnauthorized

func ErrorUnauthorized() ErrorModel

ErrorUnauthorized 401-未认证登录

func ErrorUnregisteredTenantAppDb

func ErrorUnregisteredTenantAppDb() ErrorModel

ErrorUnregisteredTenantAppDb 403-未没注册的应用

type JsonResult added in v1.0.7

type JsonResult struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
	Success bool        `json:"success"`
	Err     error
}

func Fail added in v1.0.7

func Fail() *JsonResult

func Json added in v1.0.7

func Json(code int, message string, data interface{}, success bool) *JsonResult

func JsonCreateFail added in v1.0.7

func JsonCreateFail(data interface{}) *JsonResult

JsonCreateFail 创建失败返回专用

func JsonCreateSucces added in v1.0.7

func JsonCreateSucces(data interface{}) *JsonResult

JsonCreateSucces 创建成功返回专用

func JsonData added in v1.0.7

func JsonData(data interface{}) *JsonResult

func JsonDataError added in v1.0.7

func JsonDataError(data interface{}) *JsonResult

func JsonDeleteFail added in v1.0.7

func JsonDeleteFail(data string) *JsonResult

func JsonDeleteSuccess added in v1.0.7

func JsonDeleteSuccess(data interface{}) *JsonResult

func JsonError added in v1.0.7

func JsonError(err error) *JsonResult

func JsonErrorCode added in v1.0.7

func JsonErrorCode(code int, message string) *JsonResult

func JsonErrorData added in v1.0.7

func JsonErrorData(code int, message string, data interface{}) *JsonResult

func JsonErrorMsg added in v1.0.7

func JsonErrorMsg(message string) *JsonResult

func JsonFail added in v1.0.7

func JsonFail(data interface{}) *JsonResult

JsonFail 请求失败专用

func JsonItemList added in v1.0.7

func JsonItemList(data []interface{}) *JsonResult

func JsonQueryData added in v1.0.7

func JsonQueryData(data interface{}) *JsonResult

JsonQueryData 查询返回专用

func JsonSuccess added in v1.0.7

func JsonSuccess() *JsonResult

func JsonUpdateFail added in v1.0.7

func JsonUpdateFail(data interface{}) *JsonResult

func JsonUpdateSuccess added in v1.0.7

func JsonUpdateSuccess(data interface{}) *JsonResult

JsonUpdateSuccess 更新成功返回专用

type RspBuilder added in v1.0.7

type RspBuilder struct {
	Data map[string]interface{}
}

func (*RspBuilder) Build added in v1.0.7

func (builder *RspBuilder) Build() map[string]interface{}

func (*RspBuilder) JsonResult added in v1.0.7

func (builder *RspBuilder) JsonResult() *JsonResult

func (*RspBuilder) Put added in v1.0.7

func (builder *RspBuilder) Put(key string, value interface{}) *RspBuilder

Jump to

Keyboard shortcuts

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