增加必填校验 提升casbin版本 (#1170)

* 添加rule检测

* 调整初始化顺序,防止在数据库创建错误的时候,修改了配置文件。

* (feat):自动生产代码新增校验

* 增加校验功能 升级casbin

Co-authored-by: bypanghu <bypanghu@163.com>
This commit is contained in:
奇淼(piexlmax
2022-07-14 16:20:34 +08:00
committed by GitHub
parent 14de145c02
commit f0d31fd48d
17 changed files with 604 additions and 347 deletions

View File

@@ -158,6 +158,10 @@ func (autoCodeService *AutoCodeService) PreviewTemp(autoCode system.AutoCodeStru
autoCode.HasTimer = true
break
}
if autoCode.Fields[i].Require {
autoCode.NeedValid = true
break
}
}
dataList, _, needMkdir, err := autoCodeService.getNeedList(&autoCode)
if err != nil {
@@ -243,6 +247,10 @@ func (autoCodeService *AutoCodeService) CreateTemp(autoCode system.AutoCodeStruc
autoCode.HasTimer = true
break
}
if autoCode.Fields[i].Require {
autoCode.NeedValid = true
break
}
}
// 增加判断: 重复创建struct
if autoCode.AutoMoveFile && AutoCodeHistoryServiceApp.Repeat(autoCode.StructName, autoCode.Package) {