cool-admin-vue/build/cool/lib/eps/config.ts
2022-06-24 11:10:56 +08:00

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