MCPcopy
hub / github.com/LyricTian/gin-admin / ParseQuery

Function ParseQuery

pkg/util/gin.go:55–60  ·  view source on GitHub ↗

Parse query parameter to struct

(c *gin.Context, obj interface{})

Source from the content-addressed store, hash-verified

53
54// Parse query parameter to struct
55func 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
63func ParseForm(c *gin.Context, obj interface{}) error {

Callers 4

QueryMethod · 0.92
QueryMethod · 0.92
QueryMethod · 0.92
QueryMethod · 0.92

Calls 2

BadRequestFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected