first commit

This commit is contained in:
2026-02-17 13:06:23 +08:00
commit 7cbd3d061d
349 changed files with 126558 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package controller
import (
"net/http"
"xiawan/wx/api/vo"
"github.com/gin-gonic/gin"
)
func validateData(ctx *gin.Context, model interface{}) bool {
// ShouldBindJSON
err := ctx.ShouldBindJSON(&model)
if err != nil {
ctx.JSON(http.StatusOK, vo.DTO{
Code: vo.FAIL_DATA,
Data: nil,
Text: "\"提交数据错误!\"",
})
ctx.Abort()
return false
}
return true
}