Procházet zdrojové kódy
update Web/src/views/system/database/database.ts.
数据源是PostgreSQL时,如果前端的下拉菜单没有bool相关类型的话,在代码生成时IsDelete字段会类型错误。
以下是后端CodeGenUtil里数据类型转换代码:
//PostgreSQL数据类型对应的字段类型
public static string ConvertDataType_PostgreSQL(string dataType)
{
switch (dataType)
{
case "int2":
case "smallint":
return "Int16";
case "int4":
case "integer":
return "int";
case "int8":
case "bigint":
return "long";
case "float4":
case "real":
return "float";
case "float8":
case "double precision":
return "double";
case "numeric":
case "decimal":
case "path":
case "point":
case "polygon":
case "interval":
case "lseg":
case "macaddr":
case "money":
return "decimal";
case "boolean":
case "bool":
case "box":
case "bytea":
return "bool";
case "varchar":
case "character varying":
case "geometry":
case "name":
case "text":
case "char":
case "character":
case "cidr":
case "circle":
case "tsquery":
case "tsvector":
case "txid_snapshot":
case "xml":
case "json":
return "string";
case "uuid":
return "Guid";
case "timestamp":
case "timestamp with time zone":
case "timestamptz":
case "timestamp without time zone":
case "date":
case "time":
case "time with time zone":
case "timetz":
case "time without time zone":
return "DateTime";
case "bit":
case "bit varying":
return "byte[]";
case "varbit":
return "byte";
default:
return "object";
}
}
Signed-off-by: Eadon <guangzhoutop@foxmail.com>