enhance(response):应用生成相应的函数。
This commit is contained in:
parent
2281ebe00b
commit
331089a39d
|
@ -15,12 +15,12 @@ func Router() *gin.Engine {
|
|||
return router
|
||||
}
|
||||
|
||||
//404
|
||||
// 404
|
||||
func HandleNotFound(c *gin.Context) {
|
||||
response.NewResult(c).Error(404, "资源未找到")
|
||||
response.NewResult(c).NotFound("指定资源未找到。")
|
||||
}
|
||||
|
||||
//500
|
||||
// 500
|
||||
func Recover(c *gin.Context) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user