cool-admin-vue/build/cool/lib/eps/config.ts
zhisenyang 9691fa2b5f 自动同步服务器的Entity
Entity生成 添加 任意键值 和 字段可为undefined

Revert "Entity生成 添加 任意键值 和 字段可为undefined"

This reverts commit a65490cfb92ca5b9da1803cfc7eef569d796f651.

Revert "自动同步服务器的Entity"

This reverts commit f24de490ec66ce9617246d7f20dd889153eea65e.

eps 自动生成 entity.d.ts 描述文件
2022-06-18 19:41:22 +08:00

37 lines
789 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"]
}
]
}
};