Documentation
¶
Index ¶
- func SendRedirect(c *gin.Context, data string)
- func SendRedirect302(c *gin.Context, data string)
- func SendResponse(c *gin.Context, err error, data interface{})
- func SendResponseEx(c *gin.Context, err error, data interface{})
- func SendString(c *gin.Context, code int, data string)
- type AmisOptions
- type AmisOptionsList
- type ListResponse
- type Response
- type ResponseEx
- type UploadResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendResponse ¶
返回 Json
{
"code": 0,
"message": "",
"data": {
...其他字段
}
}
code: 返回 0,表示当前接口正确返回,否则按错误请求处理;
message: 返回接口处理信息,主要用于表单提交或请求失败时的 toast 显示;
data: 必须返回一个结构的对象。
func SendResponseEx ¶
返回 Json
{
"status": 0,
"msg": "",
"data": {
...其他字段
}
}
status: 返回 0,表示当前接口正确返回,否则按错误请求处理;
msg: 返回接口处理信息,主要用于表单提交或请求失败时的 toast 显示;
data: 必须返回一个结构的对象。
Types ¶
type AmisOptions ¶
type AmisOptionsList ¶
type AmisOptionsList struct {
Options []AmisOptions `json:"options"`
}
https://baidu.gitee.io/amis/zh-CN/components/form/options#%E8%BF%9C%E7%A8%8B%E6%8B%89%E5%8F%96 https://baidu.gitee.io/amis/zh-CN/components/form/list-select
type ListResponse ¶
type ListResponse struct {
Items interface{} `json:"items" form:"items"`
Total int64 `json:"total" form:"total"`
}
type ResponseEx ¶
type UploadResponse ¶
type UploadResponse struct {
Filename string `json:"filename"`
Value string `json:"value"`
URL string `json:"url"`
Hash string `json:"hash"`
}
https://baidu.gitee.io/amis/zh-CN/components/form/input-file
Click to show internal directories.
Click to hide internal directories.