【修复】代码生成

This commit is contained in:
PandaGoAdmin
2022-07-16 18:49:57 +08:00
parent a6c5e581e3
commit 9223c6404f
19 changed files with 295 additions and 148 deletions

View File

@@ -1,6 +1,7 @@
package ginx
import (
"encoding/json"
"net/http"
"pandax/base/biz"
"pandax/base/global"
@@ -23,6 +24,16 @@ func BindQuery(g *gin.Context, data any) {
panic(any(biz.NewBizErr(err.Error())))
}
}
func ParamsToAny(g *gin.Context, in any) {
vars := make(map[string]any)
for _, v := range g.Params {
vars[v.Key] = v.Value
}
marshal, _ := json.Marshal(vars)
err := json.Unmarshal(marshal, in)
biz.ErrIsNil(err, "error get path value encoding unmarshal")
return
}
// 获取分页参数
func GetPageParam(g *gin.Context) *model.PageParam {