v2.0 优化下代码生成的提示

This commit is contained in:
zhuoda
2022-11-07 23:27:02 +08:00
parent 9631dbe008
commit 01b7f93a9b
5 changed files with 9 additions and 4 deletions

View File

@@ -149,6 +149,11 @@ public class CodeGeneratorService {
}
}
// 校验表必须有主键
if(!tableColumns.stream().filter( e -> "PRI".equalsIgnoreCase(e.getColumnKey())).findAny().isPresent()){
return ResponseDTO.userErrorParam("表必须有主键,请联系后端查看下数据库表结构");
}
codeGeneratorConfigEntity.setTableName(form.getTableName());
codeGeneratorConfigEntity.setBasic(JSON.toJSONString(form.getBasic()));
codeGeneratorConfigEntity.setFields(JSONArray.toJSONString(form.getFields()));