打印参数

This commit is contained in:
suyl
2021-07-15 18:21:01 +08:00
parent d2543b62b4
commit ad1f94554a
4 changed files with 11 additions and 29 deletions

View File

@@ -13,7 +13,6 @@ func GetApps(c *gin.Context) {
var (
tokenInfo *model.TokenInfo
)
globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, c.Params, c.ClientIP())
if tokenInfo = checkToken(c); tokenInfo == nil {
return
}
@@ -39,8 +38,7 @@ func AddApp(c *gin.Context) {
err error
param = &AddAppParam{}
)
globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, c.Params, c.ClientIP())
if err = c.Bind(&param); err != nil {
if err = c.ShouldBind(&param); err != nil {
c.JSON(http.StatusOK, &CallBack{
Code: model.ErrCodeNormal,
Desc: err.Error(),
@@ -69,8 +67,7 @@ func DelApp(c *gin.Context) {
AppID int `json:"app_id" form:"app_id" binding:"required"`
}{}
)
globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, c.Params, c.ClientIP())
if err = c.Bind(&param); err != nil {
if err = c.ShouldBind(&param); err != nil {
c.JSON(http.StatusOK, &CallBack{
Code: model.ErrCodeNormal,
Desc: err.Error(),