Documentation ¶
Index ¶
- Constants
- func JSON(ctx request.Context, resp *JsonResult)
- type ErrorModel
- type JsonResult
- func Fail() *JsonResult
- func Json(code int, message string, data interface{}, success bool) *JsonResult
- func JsonCreateFail(data interface{}) *JsonResult
- func JsonCreateSucces(data interface{}) *JsonResult
- func JsonData(data interface{}) *JsonResult
- func JsonDataError(data interface{}) *JsonResult
- func JsonDeleteFail(data string) *JsonResult
- func JsonDeleteSuccess(data interface{}) *JsonResult
- func JsonError(err error) *JsonResult
- func JsonErrorCode(code int, message string) *JsonResult
- func JsonErrorData(code int, message string, data interface{}) *JsonResult
- func JsonErrorMsg(message string) *JsonResult
- func JsonFail(data interface{}) *JsonResult
- func JsonItemList(data []interface{}) *JsonResult
- func JsonQueryData(data interface{}) *JsonResult
- func JsonSuccess() *JsonResult
- func JsonUpdateFail(data interface{}) *JsonResult
- func JsonUpdateSuccess(data interface{}) *JsonResult
- type RspBuilder
Constants ¶
View Source
const ( FAIL = 1 OK = 0 )
Variables ¶
This section is empty.
Functions ¶
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 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 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
Click to show internal directories.
Click to hide internal directories.