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

40 lines
822 B
TypeScript
Raw Normal View History

2023-09-28 13:50:15 +08:00
import { join } from "path";
// 打包路径
export const DistPath = join(__dirname, "../dist");
// 实体描述
export const Entity = {
mapping: [
{
// 自定义匹配
custom: ({ propertyName, type }) => {
// status 原本是tinyint如果是1的话== true 是可以的,但是不能 === true请谨慎使用
if (propertyName === "status" && type == "tinyint") return "boolean";
// 如果没有返回null或者不返回则继续遍历其他匹配规则
return null;
}
},
{
type: "string",
test: ["varchar", "text", "simple-json"]
},
{
type: "string[]",
test: ["simple-array"]
},
{
type: "Date",
test: ["datetime", "date"]
},
{
type: "number",
test: ["tinyint", "int", "decimal"]
},
{
type: "BigInt",
test: ["bigint"]
}
]
};