(c *gin.Context, code int, err error)
| 34 | ) |
| 35 | |
| 36 | func abortWithError(c *gin.Context, code int, err error) { |
| 37 | if err != nil { |
| 38 | _ = c.Error(err) |
| 39 | c.AbortWithStatusJSON(code, gin.H{ |
| 40 | "success": false, |
| 41 | "msg": err.Error(), |
| 42 | }) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | func responseWithData(c *gin.Context, code int, data interface{}) { |
| 47 | c.JSON(code, gin.H{ |
no test coverage detected