Documentation ¶
Index ¶
- Constants
- func Response(c *gin.Context, code int64, msg string, data interface{})
- func ResponseError(c *gin.Context, err error)
- func ResponseOk(c *gin.Context, data interface{})
- func ResponseStream(c *gin.Context, data string)
- func SqlErrorI18n(errorMessage *mysql.MySQLError) string
- type BatchResult
- type Body
- type EmptyResp
- type PageResult
Constants ¶
View Source
const ( SqlKeyDuplicateCode = 1062 DataTooLongError = 1406 )
mysql 错误码
View Source
const ( ERROR = 504 SUCCESS = 200 )
Variables ¶
This section is empty.
Functions ¶
func ResponseError ¶
func ResponseOk ¶
func ResponseStream ¶
func SqlErrorI18n ¶
func SqlErrorI18n(errorMessage *mysql.MySQLError) string
https://fromdual.com/mysql-error-codes-and-messages-1050-1099
Types ¶
type BatchResult ¶
type BatchResult struct {
SuccessCount int64 `json:"success_count"` // 成功数量
}
批量操作结果
type PageResult ¶
type PageResult struct { List interface{} `json:"list"` Page int64 `json:"page"` PageSize int64 `json:"page_size"` Total int64 `json:"total"` }
分页查询结果
Click to show internal directories.
Click to hide internal directories.