update: The code structure is finished, and the project can run successfully

This commit is contained in:
QM303176530
2020-04-05 16:18:19 +08:00
parent 1891c1bcbc
commit 08ff55ffce
13 changed files with 60 additions and 50 deletions

View File

@@ -97,8 +97,8 @@ func ParamsMatchFunc(args ...interface{}) (interface{}, error) {
//持久化到数据库 引入自定义规则
func Casbin() *casbin.Enforcer {
a := gormadapter.NewAdapterByDB(global.GVA_DB)
e := casbin.NewEnforcer(global.GVA_CONFIG.CasbinConfig.ModelPath, a)
e := casbin.NewEnforcer(global.GVA_CONFIG.Casbin.ModelPath, a)
e.AddFunction("ParamsMatch", ParamsMatchFunc)
e.LoadPolicy()
_ = e.LoadPolicy()
return e
}

View File

@@ -0,0 +1,6 @@
package model
type PageInfo struct {
Page int `json:"page"`
PageSize int `json:"pageSize"`
}