Documentation ¶
Index ¶
- func CrossOrigin(c *gin.Context)
- func Error(c *gin.Context, code int, err error, msg string)
- func Error204(c *gin.Context, err error, msg string)
- func Error400(c *gin.Context, err error, msg string)
- func Json(c *gin.Context, t interface{}) (obj interface{}, err error)
- func Ok(c *gin.Context, data interface{}, msg string)
- func ReadObj(c *gin.Context, t interface{}) (obj interface{}, err error)
- type PageVto
- type ResponseVto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CrossOrigin ¶
CrossOrigin is a middleware function that appends headers for options requests and aborts then exits the middleware chain and ends the request. 解决跨域问题
Types ¶
type PageVto ¶
type PageVto struct { List interface{} `json:"list"` Count int `json:"count"` PageIndex int `json:"pageIndex"` PageSize int `json:"pageSize"` }
PageVto 返回分页格式
type ResponseVto ¶
type ResponseVto struct { // 代码 Code int `json:"code" example:"200"` // 数据集 Data interface{} `json:"data"` // 消息 Msg string `json:"msg"` RequestID string `json:"requestId"` }
ResponseVto 返回消息的格式
func (*ResponseVto) ReturnError ¶
func (res *ResponseVto) ReturnError(code int) *ResponseVto
ReturnError 返回错误
Click to show internal directories.
Click to hide internal directories.