package controllers import ( "github.com/gin-gonic/gin" "goiot-cronapi/common" "net/http" "strconv" ) func Demo(c *gin.Context) { isErr, _ := strconv.Atoi(c.Query("isErr")) if isErr == 1 { common.ReturnError(c, http.StatusBadRequest, "错误") } else { common.ReturnSuccess(c, nil) } }