(c *gin.Context, err error, code int, data interface{}, l ...bool)
| 77 | } |
| 78 | |
| 79 | func ErrorWithDataResp(c *gin.Context, err error, code int, data interface{}, l ...bool) { |
| 80 | if len(l) > 0 && l[0] { |
| 81 | if flags.Debug || flags.Dev { |
| 82 | log.Errorf("%+v", err) |
| 83 | } else { |
| 84 | log.Errorf("%v", err) |
| 85 | } |
| 86 | } |
| 87 | c.JSON(200, Resp[interface{}]{ |
| 88 | Code: code, |
| 89 | Message: hidePrivacy(err.Error()), |
| 90 | Data: data, |
| 91 | }) |
| 92 | c.Abort() |
| 93 | } |
| 94 | |
| 95 | func ErrorStrResp(c *gin.Context, str string, code int, l ...bool) { |
| 96 | if len(l) != 0 && l[0] { |
no test coverage detected