v2.0 优化代码生成提示

This commit is contained in:
zhuoda
2022-11-07 23:29:48 +08:00
parent 2be5a1dfc8
commit c919f17c1e
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()));