Documentation ¶
Index ¶
- Constants
- func GetBodyData(c *gin.Context) []byte
- func GetToken(c *gin.Context) string
- func ParseForm(c *gin.Context, obj any) error
- func ParseJSON(c *gin.Context, obj any) error
- func ParseQuery(c *gin.Context, obj any) error
- func ResError(c *gin.Context, err error, status ...int)
- func ResJson(c *gin.Context, status int, v any)
- func ResOk(c *gin.Context)
- func ResPage(c *gin.Context, pr *PageResult)
- func ResSuccess(c *gin.Context, v any)
- type PageResult
- type ResponseResult
Constants ¶
View Source
const ( RequestBodyKey = "request-body" ResponseBodyKey = "response-body" Success = "0" )
Variables ¶
This section is empty.
Functions ¶
func GetBodyData ¶
func ResPage ¶
func ResPage(c *gin.Context, pr *PageResult)
func ResSuccess ¶
Types ¶
type PageResult ¶
func FromPaginationResult ¶
func FromPaginationResult(pr *dbx.PaginationResult) *PageResult
type ResponseResult ¶
type ResponseResult struct { Code string `json:"code"` Data any `json:"data,omitempty"` Message string `json:"message,omitempty"` }
func NewResponseResult ¶
func NewResponseResult(code string, message string, data any) ResponseResult
Click to show internal directories.
Click to hide internal directories.