File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,7 @@ import (
44 "github.com/gin-gonic/gin"
55)
66
7- /**
8- * 请求返回成功
9- *
10- * @author claer www.bajins.com
11- * @date 2019/6/28 12:48
12- */
7+ // 请求返回成功
138func Success (msg string , data interface {}) gin.H {
149 //var d = &struct {
1510 // code int
@@ -20,12 +15,7 @@ func Success(msg string, data interface{}) gin.H {
2015 return gin.H {"code" : 200 , "message" : msg , "data" : data }
2116}
2217
23- /**
24- * 请求返回错误
25- *
26- * @author claer www.bajins.com
27- * @date 2019/6/28 12:48
28- */
18+ // 请求返回错误
2919func Error (code int , msg string ) gin.H {
3020 //var d = &struct {
3121 // code int
@@ -35,3 +25,14 @@ func Error(code int, msg string) gin.H {
3525
3626 return gin.H {"code" : code , "message" : msg , "data" : "" }
3727}
28+
29+ // 默认系统错误
30+ func SystemError () gin.H {
31+ //var d = &struct {
32+ // code int
33+ // message string
34+ // data interface{}
35+ //}{code:code,message:msg,data:""}
36+
37+ return gin.H {"code" : 500 , "message" : "系统错误!" , "data" : "" }
38+ }
You can’t perform that action at this time.
0 commit comments