Documentation
¶
Index ¶
- func JsonData(ctx *gin.Context, data any)
- func JsonDataMessage(ctx *gin.Context, data any, message string)
- func JsonError(ctx *gin.Context, code int64)
- func JsonErrorMessage(ctx *gin.Context, code int64, error string)
- func JsonFail(ctx *gin.Context)
- func JsonFailMessage(ctx *gin.Context, error string)
- func JsonSuccess(ctx *gin.Context)
- func JsonSuccessMessage(ctx *gin.Context, message string)
- func JsonUnauthorized(ctx *gin.Context)
- func JsonUnauthorizedMessage(ctx *gin.Context, error string)
- type PageData
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonDataMessage ¶ added in v0.7.0
JsonDataMessage return json data with message
func JsonErrorMessage ¶
JsonErrorMessage return json error with message
func JsonFailMessage ¶
JsonFailMessage return json fail with message
func JsonSuccessMessage ¶
JsonSuccessMessage return json success with message
func JsonUnauthorized ¶
JsonUnauthorized return json unauthorized
func JsonUnauthorizedMessage ¶
JsonUnauthorizedMessage return json unauthorized with message
Types ¶
type Result ¶
type Result struct { Code int64 `json:"code"` State bool `json:"state"` Message *string `json:"message,omitempty"` Error *string `json:"error,omitempty"` Data any `json:"data,omitempty"` }
Result is a generic json result type
func DataMessage ¶ added in v0.7.0
DataMessage return success result with data result and message
func ErrorMessage ¶
ErrorMessage return error result with error message
func FailMessage ¶
FailMessage return fail result with error message
func SuccessMessage ¶
SuccessMessage return success result with message
Click to show internal directories.
Click to hide internal directories.