package
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Mar 5, 2022
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
- Constants
-
func FailDataMsg(c *gin.Context, data interface{}, err error)
-
func FailMsg(c *gin.Context, err error)
-
func File(c *gin.Context, fileName, filePath string)
-
func OkDataMsg(c *gin.Context, data interface{}, message string)
-
func OkMsg(c *gin.Context, message string)
-
func Result(code code, data interface{}, message string, c *gin.Context)
-
type Response
View Source
const (
CODE_SUCCESS code = "0"
CODE_FAIL code = "1"
)
FailDataMsg
*
- @Description: 返回带消息和数据的失败
- @param c
- @param data
- @param err
FailMsg
*
- @Description: 返回带消息的失败
- @param c
- @param err
File
*
- @Description: 返回文件
- @param c
- @param fileName
- @param filePath
OkDataMsg
*
- @Description: 返回带消息和数据的成功
- @param c
- @param data
- @param message
OkMsg
*
- @Description: 返回带消息的成功
- @param c
- @param message
Result
*
- @Description: Gin统一返回结果
- @param code
- @param data
- @param message
- @param c
type Response struct {
Code code `json:"code"`
Data interface{} `json:"data"`
Message string `json:"message"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.