cool-admin-vue/build/cool/lib/eps/config.ts

32 lines
698 B
TypeScript
Raw Normal View History

export default {
entity: {
mapping: [
{
// 自定义匹配
custom: ({ entityName, propertyName, type }) => {
2022-07-21 19:07:32 +08:00
// status 原本是tinyint如果是1的话== true 是可以的,但是不能 === true请谨慎使用
if (propertyName === "status" && type == "tinyint") return "boolean";
2022-06-24 11:10:56 +08:00
// 如果没有返回null或者不返回则继续遍历其他匹配规则
return null;
}
},
{
type: "string",
includes: ["varchar", "text"]
},
{
type: "Date",
includes: ["datetime", "date"]
},
{
type: "number",
includes: ["tinyint", "int", "decimal"]
},
{
type: "BigInt",
includes: ["bigint"]
}
]
}
};