Documentation
¶
Index ¶
- Constants
- func Redirect(ctx *gin.Context, templateName string)
- func RenderHtml(ctx *gin.Context, templateName string)
- func RenderHtmlWithData(ctx *gin.Context, templateName string, data interface{})
- func RenderJson(ctx *gin.Context, code int, msg string, data interface{})
- func RenderJsonFail(ctx *gin.Context, err error)
- func RenderJsonSuccess(ctx *gin.Context, data interface{})
- type Error
- type ResponseEntity
Constants ¶
View Source
const ( MdContextKey = "md" //gin context里设置的md key RequestIdInMdKey = "requestId" //md里设置的requestId key RequestIdInHttpHeaderKey = "request-id" //请求头 requestId SessionCookieName = "s-token" //session cookie name SessionContextKey = "s-ctx" //session context key )
View Source
const ( //SuccessCode 成功 SuccessCode = 200 //FailCode 失败 FailCode = 500 )
Variables ¶
This section is empty.
Functions ¶
func RenderHtml ¶
func RenderHtmlWithData ¶
func RenderJsonFail ¶
func RenderJsonSuccess ¶
Types ¶
type Error ¶
type Error struct { Code int `json:"code,omitempty"` //错误码 Msg string `json:"msg,omitempty"` //错误信息 }
func NewMsgError ¶
type ResponseEntity ¶
Click to show internal directories.
Click to hide internal directories.