Parse query parameter to struct
(c *gin.Context, obj interface{})
| 53 | |
| 54 | // Parse query parameter to struct |
| 55 | func ParseQuery(c *gin.Context, obj interface{}) error { |
| 56 | if err := c.ShouldBindQuery(obj); err != nil { |
| 57 | return errors.BadRequest("", "Failed to parse query: %s", err.Error()) |
| 58 | } |
| 59 | return nil |
| 60 | } |
| 61 | |
| 62 | // Parse body form data to struct |
| 63 | func ParseForm(c *gin.Context, obj interface{}) error { |