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