mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 22:20:27 +08:00
40 lines
822 B
TypeScript
40 lines
822 B
TypeScript
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"]
|
||
}
|
||
]
|
||
};
|