|
|
@ -60,7 +60,7 @@ func ParseParams(p interface{}, c *gin.Context) error {
|
|
|
|
func Params(p interface{}, c *gin.Context) error {
|
|
|
|
func Params(p interface{}, c *gin.Context) error {
|
|
|
|
ct := strings.ToLower(c.Request.Header.Get("Content-Type"))
|
|
|
|
ct := strings.ToLower(c.Request.Header.Get("Content-Type"))
|
|
|
|
if strings.Contains(ct, "application/json") {
|
|
|
|
if strings.Contains(ct, "application/json") {
|
|
|
|
err := c.BindJSON(p)
|
|
|
|
err := c.ShouldBindJSON(p)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|