mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 22:20:27 +08:00
9691fa2b5f
Entity生成 添加 任意键值 和 字段可为undefined Revert "Entity生成 添加 任意键值 和 字段可为undefined" This reverts commit a65490cfb92ca5b9da1803cfc7eef569d796f651. Revert "自动同步服务器的Entity" This reverts commit f24de490ec66ce9617246d7f20dd889153eea65e. eps 自动生成 entity.d.ts 描述文件
37 lines
789 B
TypeScript
37 lines
789 B
TypeScript
export default {
|
||
// 实体生成
|
||
entity: {
|
||
// 是否生成
|
||
enable: true,
|
||
mapping: [
|
||
{
|
||
// 自定义匹配
|
||
custom: ({ entityName, propertyName, type }) => {
|
||
// status原本是tinyint,如果是1的话,== true是可以的,但是不能 === true,请谨慎使用
|
||
if (propertyName === "status" && type == "tinyint") return "boolean";
|
||
//如果没有,返回null或者不返回,则继续遍历其他匹配规则
|
||
return null;
|
||
}
|
||
},
|
||
{
|
||
// 返回类型
|
||
type: "string",
|
||
// 匹配列类型
|
||
includes: ["varchar", "text"]
|
||
},
|
||
{
|
||
type: "Date",
|
||
includes: ["datetime", "date"]
|
||
},
|
||
{
|
||
type: "number",
|
||
includes: ["tinyint", "int", "decimal"]
|
||
},
|
||
{
|
||
type: "BigInt",
|
||
includes: ["bigint"]
|
||
}
|
||
]
|
||
}
|
||
};
|