cool-admin-vue/build/cool/eps/config.ts
神仙都没用 1735d6258e 发布7.x
2023-09-28 13:50:15 +08:00

40 lines
822 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.

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