Documentation ¶
Overview ¶
Package verify 校验
Package verify 校验
Index ¶
- func HTTPJson(request *model.Request, response *http.Response, body []byte) (code int, isSucceed bool)
- func HTTPStatusCode(request *model.Request, response *http.Response, body []byte) (code int, isSucceed bool)
- func WebSocketJSON(request *model.Request, seq string, msg []byte) (code int, isSucceed bool)
- type ResponseJSON
- type WebSocketResponseJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPJson ¶
func HTTPJson(request *model.Request, response *http.Response, body []byte) (code int, isSucceed bool)
HTTPJson 通过返回的Body 判断 返回示例: {"code":200,"msg":"Success","data":{}} code 默认将http code作为返回码,http code 为200时 取body中的返回code
Types ¶
type ResponseJSON ¶
type ResponseJSON struct { Code int `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` }
ResponseJSON 返回数据结构体
Click to show internal directories.
Click to hide internal directories.