diff --git a/api/app/lib/models/acquisition_log.js b/api/app/lib/models/acquisition_log.js new file mode 100644 index 0000000..6019acb --- /dev/null +++ b/api/app/lib/models/acquisition_log.js @@ -0,0 +1,75 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const AcquisitionLog = sequelize.define("acquisitionLog", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "ID唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_acquisition_log_id_uindex" + }, + task: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "采集任务", + primaryKey: false, + field: "task", + autoIncrement: false, + references: { + key: "id", + model: "tAcquisitionTask" + } + }, + success: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "是否采集成功", + primaryKey: false, + field: "success", + autoIncrement: false + }, + startTime: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "任务开始时间", + primaryKey: false, + field: "start_time", + autoIncrement: false + }, + endTime: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "任务结束时间", + primaryKey: false, + field: "end_time", + autoIncrement: false + }, + details: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "采集详情", + primaryKey: false, + field: "details", + autoIncrement: false + } + }, { + tableName: "t_acquisition_log", + comment: "", + indexes: [] + }); + dc.models.AcquisitionLog = AcquisitionLog; + return AcquisitionLog; +}; \ No newline at end of file diff --git a/api/app/lib/models/acquisition_task.js b/api/app/lib/models/acquisition_task.js new file mode 100644 index 0000000..7e16592 --- /dev/null +++ b/api/app/lib/models/acquisition_task.js @@ -0,0 +1,120 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const AcquisitionTask = sequelize.define("acquisitionTask", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "ID唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_acquisition_task_id_uindex" + }, + taskName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "任务名称", + primaryKey: false, + field: "task_name", + autoIncrement: false + }, + dataSource: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "数据源", + primaryKey: false, + field: "data_source", + autoIncrement: false, + references: { + key: "id", + model: "tDataSource" + } + }, + storageStrategy: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "入库策略", + primaryKey: false, + field: "storage_strategy", + autoIncrement: false + }, + autoReleased: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "是否自动发布", + primaryKey: false, + field: "auto_released", + autoIncrement: false + }, + description: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "描述", + primaryKey: false, + field: "description", + autoIncrement: false + }, + enabled: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "是否已启用", + primaryKey: false, + field: "enabled", + autoIncrement: false + }, + cron: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "cron表达式", + primaryKey: false, + field: "cron", + autoIncrement: false + }, + retried: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "是否重试", + primaryKey: false, + field: "retried", + autoIncrement: false + }, + retryCount: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "重试次数", + primaryKey: false, + field: "retry_count", + autoIncrement: false + }, + retryTime: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "重试间隔时间,单位:分钟", + primaryKey: false, + field: "retry_time", + autoIncrement: false + } + }, { + tableName: "t_acquisition_task", + comment: "", + indexes: [] + }); + dc.models.AcquisitionTask = AcquisitionTask; + return AcquisitionTask; +}; \ No newline at end of file diff --git a/api/app/lib/models/adapter.js b/api/app/lib/models/adapter.js new file mode 100644 index 0000000..a1614bf --- /dev/null +++ b/api/app/lib/models/adapter.js @@ -0,0 +1,71 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Adapter = sequelize.define("adapter", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "ID唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_adapter_id_uindex" + }, + adapterName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "适配器名称", + primaryKey: false, + field: "adapter_name", + autoIncrement: false + }, + adapterVersion: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "适配器版本", + primaryKey: false, + field: "adapter_version", + autoIncrement: false + }, + toolName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "工具名称", + primaryKey: false, + field: "tool_name", + autoIncrement: false + }, + description: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "描述", + primaryKey: false, + field: "description", + autoIncrement: false + }, + config: { + type: DataTypes.JSONB, + allowNull: false, + defaultValue: null, + comment: "配置信息\r\n多个参数信息,每个参数组成:\r\n{param:参数名,\r\ntitle:标题,\r\ndefault:默认值,\r\nrequired:是否必填,\r\ndescription:描述}", + primaryKey: false, + field: "config", + autoIncrement: false + } + }, { + tableName: "t_adapter", + comment: "", + indexes: [] + }); + dc.models.Adapter = Adapter; + return Adapter; +}; \ No newline at end of file diff --git a/api/app/lib/models/alarms.js b/api/app/lib/models/alarms.js new file mode 100644 index 0000000..20f428d --- /dev/null +++ b/api/app/lib/models/alarms.js @@ -0,0 +1,53 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Alarms = sequelize.define("alarms", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "ID唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_alarms_id_uindex" + }, + content: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "预警内容", + primaryKey: false, + field: "content", + autoIncrement: false + }, + level: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "预警等级", + primaryKey: false, + field: "level", + autoIncrement: false + }, + time: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "预警时间", + primaryKey: false, + field: "time", + autoIncrement: false + } + }, { + tableName: "t_alarms", + comment: "", + indexes: [] + }); + dc.models.Alarms = Alarms; + return Alarms; +}; \ No newline at end of file diff --git a/api/app/lib/models/business_metadata_database.js b/api/app/lib/models/business_metadata_database.js new file mode 100644 index 0000000..aca199b --- /dev/null +++ b/api/app/lib/models/business_metadata_database.js @@ -0,0 +1,124 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const BusinessMetadataDatabase = sequelize.define("businessMetadataDatabase", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_business_metadata_database_id_uindex" + }, + resourceName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源名称", + primaryKey: false, + field: "resource_name", + autoIncrement: false + }, + resourceAbstract: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源摘要", + primaryKey: false, + field: "resource_abstract", + autoIncrement: false + }, + resourceProvider: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源提供方", + primaryKey: false, + field: "resource_provider", + autoIncrement: false + }, + resourceCategory: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源分类", + primaryKey: false, + field: "resource_category", + autoIncrement: false + }, + resourceId: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源标识符", + primaryKey: false, + field: "resource_id", + autoIncrement: false + }, + metadataId: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "元数据标识符", + primaryKey: false, + field: "metadata_id", + autoIncrement: false + }, + createBy: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "创建者", + primaryKey: false, + field: "create_by", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + createAt: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "创建时间", + primaryKey: false, + field: "create_at", + autoIncrement: false + }, + updateAt: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "修改时间", + primaryKey: false, + field: "update_at", + autoIncrement: false + }, + metadataDatabase: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "库表元数据", + primaryKey: false, + field: "metadata_database", + autoIncrement: false, + references: { + key: "id", + model: "tMetadataDatabase" + } + } + }, { + tableName: "t_business_metadata_database", + comment: "", + indexes: [] + }); + dc.models.BusinessMetadataDatabase = BusinessMetadataDatabase; + return BusinessMetadataDatabase; +}; \ No newline at end of file diff --git a/api/app/lib/models/business_metadata_file.js b/api/app/lib/models/business_metadata_file.js new file mode 100644 index 0000000..350750a --- /dev/null +++ b/api/app/lib/models/business_metadata_file.js @@ -0,0 +1,124 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const BusinessMetadataFile = sequelize.define("businessMetadataFile", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_business_metadata_file_id_uindex" + }, + resourceName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源名称", + primaryKey: false, + field: "resource_name", + autoIncrement: false + }, + resourceAbstract: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源摘要", + primaryKey: false, + field: "resource_abstract", + autoIncrement: false + }, + resourceProvider: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源提供方", + primaryKey: false, + field: "resource_provider", + autoIncrement: false + }, + resourceCategory: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源分类", + primaryKey: false, + field: "resource_category", + autoIncrement: false + }, + resourceId: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源标识符", + primaryKey: false, + field: "resource_id", + autoIncrement: false + }, + metadataId: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "元数据标识符", + primaryKey: false, + field: "metadata_id", + autoIncrement: false + }, + createBy: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "创建者", + primaryKey: false, + field: "create_by", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + createAt: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "创建时间", + primaryKey: false, + field: "create_at", + autoIncrement: false + }, + updateAt: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "修改时间", + primaryKey: false, + field: "update_at", + autoIncrement: false + }, + metadataFile: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "文件元数据", + primaryKey: false, + field: "metadata_file", + autoIncrement: false, + references: { + key: "id", + model: "tMetadataFile" + } + } + }, { + tableName: "t_business_metadata_file", + comment: "", + indexes: [] + }); + dc.models.BusinessMetadataFile = BusinessMetadataFile; + return BusinessMetadataFile; +}; \ No newline at end of file diff --git a/api/app/lib/models/business_metadata_restapi.js b/api/app/lib/models/business_metadata_restapi.js new file mode 100644 index 0000000..749ebeb --- /dev/null +++ b/api/app/lib/models/business_metadata_restapi.js @@ -0,0 +1,124 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const BusinessMetadataRestapi = sequelize.define("businessMetadataRestapi", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_business_metadata_restapi_id_uindex" + }, + resourceName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源名称", + primaryKey: false, + field: "resource_name", + autoIncrement: false + }, + resourceAbstract: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源摘要", + primaryKey: false, + field: "resource_abstract", + autoIncrement: false + }, + resourceProvider: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源提供方", + primaryKey: false, + field: "resource_provider", + autoIncrement: false + }, + resourceCategory: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源分类", + primaryKey: false, + field: "resource_category", + autoIncrement: false + }, + resourceId: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "信息资源标识符", + primaryKey: false, + field: "resource_id", + autoIncrement: false + }, + metadataId: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "元数据标识符", + primaryKey: false, + field: "metadata_id", + autoIncrement: false + }, + createBy: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "创建者", + primaryKey: false, + field: "create_by", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + createAt: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "创建时间", + primaryKey: false, + field: "create_at", + autoIncrement: false + }, + updateAt: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "修改时间", + primaryKey: false, + field: "update_at", + autoIncrement: false + }, + metadataRestapi: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "接口元数据", + primaryKey: false, + field: "metadata_restapi", + autoIncrement: false, + references: { + key: "id", + model: "tMetadataRestapi" + } + } + }, { + tableName: "t_business_metadata_restapi", + comment: "", + indexes: [] + }); + dc.models.BusinessMetadataRestapi = BusinessMetadataRestapi; + return BusinessMetadataRestapi; +}; \ No newline at end of file diff --git a/api/app/lib/models/data_source.js b/api/app/lib/models/data_source.js new file mode 100644 index 0000000..6ce8b21 --- /dev/null +++ b/api/app/lib/models/data_source.js @@ -0,0 +1,88 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const DataSource = sequelize.define("dataSource", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "ID唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_data_source_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "数据源名称", + primaryKey: false, + field: "name", + autoIncrement: false + }, + audited: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "是否审核", + primaryKey: false, + field: "audited", + autoIncrement: false + }, + adapter: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "适配器", + primaryKey: false, + field: "adapter", + autoIncrement: false, + references: { + key: "id", + model: "tAdapter" + } + }, + mountPath: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "数据源挂载路径", + primaryKey: false, + field: "mount_path", + autoIncrement: false, + references: { + key: "id", + model: "tResourceCatalog" + } + }, + description: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "描述", + primaryKey: false, + field: "description", + autoIncrement: false + }, + config: { + type: DataTypes.JSONB, + allowNull: false, + defaultValue: null, + comment: "数据源参数配置", + primaryKey: false, + field: "config", + autoIncrement: false + } + }, { + tableName: "t_data_source", + comment: "", + indexes: [] + }); + dc.models.DataSource = DataSource; + return DataSource; +}; \ No newline at end of file diff --git a/api/app/lib/models/meta_model.js b/api/app/lib/models/meta_model.js new file mode 100644 index 0000000..b9da97d --- /dev/null +++ b/api/app/lib/models/meta_model.js @@ -0,0 +1,107 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const MetaModel = sequelize.define("metaModel", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_meta_model_id_uindex" + }, + modelType: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "元模型类型", + primaryKey: false, + field: "model_type", + autoIncrement: false + }, + attributeName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "属性名称", + primaryKey: false, + field: "attribute_name", + autoIncrement: false + }, + attributeCode: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "属性代码", + primaryKey: false, + field: "attribute_code", + autoIncrement: false + }, + dataType: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "数据类型", + primaryKey: false, + field: "data_type", + autoIncrement: false + }, + length: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "长度", + primaryKey: false, + field: "length", + autoIncrement: false + }, + control: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "输入控件", + primaryKey: false, + field: "control", + autoIncrement: false + }, + nullable: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "是否允许为空", + primaryKey: false, + field: "nullable", + autoIncrement: false + }, + readOnly: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "是否只读", + primaryKey: false, + field: "read_only", + autoIncrement: false + }, + description: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "描述", + primaryKey: false, + field: "description", + autoIncrement: false + } + }, { + tableName: "t_meta_model", + comment: "", + indexes: [] + }); + dc.models.MetaModel = MetaModel; + return MetaModel; +}; \ No newline at end of file diff --git a/api/app/lib/models/metadata_database.js b/api/app/lib/models/metadata_database.js new file mode 100644 index 0000000..a39aecc --- /dev/null +++ b/api/app/lib/models/metadata_database.js @@ -0,0 +1,124 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const MetadataDatabase = sequelize.define("metadataDatabase", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_metadata_database_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "名称", + primaryKey: false, + field: "name", + autoIncrement: false + }, + code: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "代码", + primaryKey: false, + field: "code", + autoIncrement: false + }, + type: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "元数据类型", + primaryKey: false, + field: "type", + autoIncrement: false + }, + description: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "描述(详情)", + primaryKey: false, + field: "description", + autoIncrement: false + }, + attributesParam: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "属性", + primaryKey: false, + field: "attributes", + autoIncrement: false + }, + catalog: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "资源目录", + primaryKey: false, + field: "catalog", + autoIncrement: false, + references: { + key: "id", + model: "tResourceCatalog" + } + }, + parent: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "父级元数据", + primaryKey: false, + field: "parent", + autoIncrement: false + }, + createBy: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "创建者", + primaryKey: false, + field: "create_by", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + createAt: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "创建时间", + primaryKey: false, + field: "create_at", + autoIncrement: false + }, + updateAt: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "修改时间", + primaryKey: false, + field: "update_at", + autoIncrement: false + } + }, { + tableName: "t_metadata_database", + comment: "", + indexes: [] + }); + dc.models.MetadataDatabase = MetadataDatabase; + return MetadataDatabase; +}; \ No newline at end of file diff --git a/api/app/lib/models/metadata_file.js b/api/app/lib/models/metadata_file.js new file mode 100644 index 0000000..1b72aab --- /dev/null +++ b/api/app/lib/models/metadata_file.js @@ -0,0 +1,115 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const MetadataFile = sequelize.define("metadataFile", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_metadata_file_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "文件名称", + primaryKey: false, + field: "name", + autoIncrement: false + }, + type: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "文件类型", + primaryKey: false, + field: "type", + autoIncrement: false + }, + size: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "文件大小", + primaryKey: false, + field: "size", + autoIncrement: false + }, + description: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "文件描述", + primaryKey: false, + field: "description", + autoIncrement: false + }, + attributesParam: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "属性", + primaryKey: false, + field: "attributes", + autoIncrement: false + }, + catalog: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "资源目录", + primaryKey: false, + field: "catalog", + autoIncrement: false, + references: { + key: "id", + model: "tResourceCatalog" + } + }, + createBy: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "创建者", + primaryKey: false, + field: "create_by", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + createAt: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "创建时间", + primaryKey: false, + field: "create_at", + autoIncrement: false + }, + updateAt: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "修改时间", + primaryKey: false, + field: "update_at", + autoIncrement: false + } + }, { + tableName: "t_metadata_file", + comment: "", + indexes: [] + }); + dc.models.MetadataFile = MetadataFile; + return MetadataFile; +}; \ No newline at end of file diff --git a/api/app/lib/models/metadata_restapi.js b/api/app/lib/models/metadata_restapi.js new file mode 100644 index 0000000..214133e --- /dev/null +++ b/api/app/lib/models/metadata_restapi.js @@ -0,0 +1,142 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const MetadataRestapi = sequelize.define("metadataRestapi", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_metadata_restapi_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "接口名称", + primaryKey: false, + field: "name", + autoIncrement: false + }, + url: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "接口路由", + primaryKey: false, + field: "url", + autoIncrement: false + }, + method: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "请求方法", + primaryKey: false, + field: "method", + autoIncrement: false + }, + queryParam: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "查询参数", + primaryKey: false, + field: "query_param", + autoIncrement: false + }, + bodyParam: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "请求实体", + primaryKey: false, + field: "body_param", + autoIncrement: false + }, + return: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "接口返回值", + primaryKey: false, + field: "return", + autoIncrement: false + }, + enabled: { + type: DataTypes.BOOLEAN, + allowNull: true, + defaultValue: null, + comment: "是否已启用", + primaryKey: false, + field: "enabled", + autoIncrement: false + }, + attributesParam: { + type: DataTypes.JSONB, + allowNull: true, + defaultValue: null, + comment: "属性", + primaryKey: false, + field: "attributes", + autoIncrement: false + }, + catalog: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "资源目录", + primaryKey: false, + field: "catalog", + autoIncrement: false, + references: { + key: "id", + model: "tResourceCatalog" + } + }, + createBy: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "创建者", + primaryKey: false, + field: "create_by", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + createAt: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "创建时间", + primaryKey: false, + field: "create_at", + autoIncrement: false + }, + updateAt: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "修改时间", + primaryKey: false, + field: "update_at", + autoIncrement: false + } + }, { + tableName: "t_metadata_restapi", + comment: "", + indexes: [] + }); + dc.models.MetadataRestapi = MetadataRestapi; + return MetadataRestapi; +}; \ No newline at end of file diff --git a/api/app/lib/models/resource_access.js b/api/app/lib/models/resource_access.js new file mode 100644 index 0000000..fe87cd2 --- /dev/null +++ b/api/app/lib/models/resource_access.js @@ -0,0 +1,84 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const ResourceAccess = sequelize.define("resourceAccess", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "ID唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_resource_access_id_uindex" + }, + resourceName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "资源名称", + primaryKey: false, + field: "resource_name", + autoIncrement: false + }, + resourceDesc: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "资源描述", + primaryKey: false, + field: "resource_desc", + autoIncrement: false + }, + resourceCount: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "资源数", + primaryKey: false, + field: "resource_count", + autoIncrement: false + }, + resourceType: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "资源类型", + primaryKey: false, + field: "resource_type", + autoIncrement: false + }, + user: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "访问用户", + primaryKey: false, + field: "user", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + time: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "访问时间", + primaryKey: false, + field: "time", + autoIncrement: false + } + }, { + tableName: "t_resource_access", + comment: "", + indexes: [] + }); + dc.models.ResourceAccess = ResourceAccess; + return ResourceAccess; +}; \ No newline at end of file diff --git a/api/app/lib/models/resource_catalog.js b/api/app/lib/models/resource_catalog.js new file mode 100644 index 0000000..6f24402 --- /dev/null +++ b/api/app/lib/models/resource_catalog.js @@ -0,0 +1,62 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const ResourceCatalog = sequelize.define("resourceCatalog", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_resource_catalog_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "名称", + primaryKey: false, + field: "name", + autoIncrement: false + }, + code: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "代码", + primaryKey: false, + field: "code", + autoIncrement: false + }, + description: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "描述", + primaryKey: false, + field: "description", + autoIncrement: false + }, + parent: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "父级目录", + primaryKey: false, + field: "parent", + autoIncrement: false + } + }, { + tableName: "t_resource_catalog", + comment: "", + indexes: [] + }); + dc.models.ResourceCatalog = ResourceCatalog; + return ResourceCatalog; +}; \ No newline at end of file diff --git a/api/app/lib/models/resource_consumption.js b/api/app/lib/models/resource_consumption.js new file mode 100644 index 0000000..a0d8e8f --- /dev/null +++ b/api/app/lib/models/resource_consumption.js @@ -0,0 +1,124 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const ResourceConsumption = sequelize.define("resourceConsumption", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "ID唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_resource_consumption_id_uindex" + }, + resourceName: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "资源名称", + primaryKey: false, + field: "resource_name", + autoIncrement: false + }, + resourceType: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "资源类型", + primaryKey: false, + field: "resource_type", + autoIncrement: false + }, + applyBy: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "申请人", + primaryKey: false, + field: "apply_by", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + applyAt: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "申请时间", + primaryKey: false, + field: "apply_at", + autoIncrement: false + }, + requirements: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "需求描述", + primaryKey: false, + field: "requirements", + autoIncrement: false + }, + approveState: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "审批状态", + primaryKey: false, + field: "approve_state", + autoIncrement: false + }, + approveBy: { + type: DataTypes.INTEGER, + allowNull: true, + defaultValue: null, + comment: "审批人", + primaryKey: false, + field: "approve_by", + autoIncrement: false, + references: { + key: "id", + model: "tUser" + } + }, + approveAt: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + comment: "审批时间", + primaryKey: false, + field: "approve_at", + autoIncrement: false + }, + approveRemarks: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "审批意见", + primaryKey: false, + field: "approve_remarks", + autoIncrement: false + }, + token: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "令牌", + primaryKey: false, + field: "token", + autoIncrement: false + } + }, { + tableName: "t_resource_consumption", + comment: "", + indexes: [] + }); + dc.models.ResourceConsumption = ResourceConsumption; + return ResourceConsumption; +}; \ No newline at end of file diff --git a/api/app/lib/models/tag.js b/api/app/lib/models/tag.js new file mode 100644 index 0000000..2f44aba --- /dev/null +++ b/api/app/lib/models/tag.js @@ -0,0 +1,48 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const Tag = sequelize.define("tag", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_tag_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "标签名称", + primaryKey: false, + field: "name", + autoIncrement: false + }, + tagSet: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "归属的标签集", + primaryKey: false, + field: "tag_set", + autoIncrement: false, + references: { + key: "id", + model: "tTagSet" + } + } + }, { + tableName: "t_tag", + comment: "", + indexes: [] + }); + dc.models.Tag = Tag; + return Tag; +}; \ No newline at end of file diff --git a/api/app/lib/models/tag_database.js b/api/app/lib/models/tag_database.js new file mode 100644 index 0000000..6ac90c7 --- /dev/null +++ b/api/app/lib/models/tag_database.js @@ -0,0 +1,52 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const TagDatabase = sequelize.define("tagDatabase", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_tag_database_id_uindex" + }, + tag: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "标签", + primaryKey: false, + field: "tag", + autoIncrement: false, + references: { + key: "id", + model: "tTag" + } + }, + database: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "库表元数据", + primaryKey: false, + field: "database", + autoIncrement: false, + references: { + key: "id", + model: "tMetadataDatabase" + } + } + }, { + tableName: "t_tag_database", + comment: "", + indexes: [] + }); + dc.models.TagDatabase = TagDatabase; + return TagDatabase; +}; \ No newline at end of file diff --git a/api/app/lib/models/tag_file.js b/api/app/lib/models/tag_file.js new file mode 100644 index 0000000..5cf4453 --- /dev/null +++ b/api/app/lib/models/tag_file.js @@ -0,0 +1,52 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const TagFile = sequelize.define("tagFile", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_tag_file_id_uindex" + }, + tag: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "标签", + primaryKey: false, + field: "tag", + autoIncrement: false, + references: { + key: "id", + model: "tTag" + } + }, + file: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "文件元数据", + primaryKey: false, + field: "file", + autoIncrement: false, + references: { + key: "id", + model: "tMetadataFile" + } + } + }, { + tableName: "t_tag_file", + comment: "", + indexes: [] + }); + dc.models.TagFile = TagFile; + return TagFile; +}; \ No newline at end of file diff --git a/api/app/lib/models/tag_restapi.js b/api/app/lib/models/tag_restapi.js new file mode 100644 index 0000000..461d44b --- /dev/null +++ b/api/app/lib/models/tag_restapi.js @@ -0,0 +1,52 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const TagRestapi = sequelize.define("tagRestapi", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_tag_restapi_id_uindex" + }, + tag: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "标签", + primaryKey: false, + field: "tag", + autoIncrement: false, + references: { + key: "id", + model: "tTag" + } + }, + restapi: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "接口元数据", + primaryKey: false, + field: "restapi", + autoIncrement: false, + references: { + key: "id", + model: "tMetadataRestapi" + } + } + }, { + tableName: "t_tag_restapi", + comment: "", + indexes: [] + }); + dc.models.TagRestapi = TagRestapi; + return TagRestapi; +}; \ No newline at end of file diff --git a/api/app/lib/models/tag_set.js b/api/app/lib/models/tag_set.js new file mode 100644 index 0000000..6bd3447 --- /dev/null +++ b/api/app/lib/models/tag_set.js @@ -0,0 +1,35 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const TagSet = sequelize.define("tagSet", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_tag_set_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "标签集名称", + primaryKey: false, + field: "name", + autoIncrement: false + } + }, { + tableName: "t_tag_set", + comment: "", + indexes: [] + }); + dc.models.TagSet = TagSet; + return TagSet; +}; \ No newline at end of file diff --git a/api/app/lib/models/user.js b/api/app/lib/models/user.js index 0ab5935..a4b5709 100644 --- a/api/app/lib/models/user.js +++ b/api/app/lib/models/user.js @@ -1,42 +1,62 @@ /* eslint-disable*/ + 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const User = sequelize.define("user", { - id: { - type: DataTypes.INTEGER, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "id", - autoIncrement: true - }, - username: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "username", - autoIncrement: false - }, - password: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "password", - autoIncrement: false - } - }, { - tableName: "t_user", - comment: "", - indexes: [] - }); - dc.models.User = User; - return User; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const User = sequelize.define("user", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: "唯一标识", + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "t_user_id_uindex" + }, + name: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "姓名", + primaryKey: false, + field: "name", + autoIncrement: false + }, + username: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "用户名", + primaryKey: false, + field: "username", + autoIncrement: false + }, + password: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "密码", + primaryKey: false, + field: "password", + autoIncrement: false + }, + role: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "角色", + primaryKey: false, + field: "role", + autoIncrement: false + } + }, { + tableName: "t_user", + comment: "", + indexes: [] + }); + dc.models.User = User; + return User; }; \ No newline at end of file diff --git a/api/app/lib/models/user_token.js b/api/app/lib/models/user_token.js index 3f6f8d4..6dcb654 100644 --- a/api/app/lib/models/user_token.js +++ b/api/app/lib/models/user_token.js @@ -1,42 +1,43 @@ /* eslint-disable*/ + 'use strict'; module.exports = dc => { - const DataTypes = dc.ORM; - const sequelize = dc.orm; - const UserToken = sequelize.define("userToken", { - token: { - type: DataTypes.STRING, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: true, - field: "token", - autoIncrement: false - }, - userInfo: { - type: DataTypes.JSONB, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "user_info", - autoIncrement: false - }, - expired: { - type: DataTypes.DATE, - allowNull: false, - defaultValue: null, - comment: null, - primaryKey: false, - field: "expired", - autoIncrement: false - } - }, { - tableName: "t_user_token", - comment: "", - indexes: [] - }); - dc.models.UserToken = UserToken; - return UserToken; + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const UserToken = sequelize.define("userToken", { + token: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "token", + autoIncrement: false + }, + userInfo: { + type: DataTypes.JSONB, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "user_info", + autoIncrement: false + }, + expired: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "expired", + autoIncrement: false + } + }, { + tableName: "t_user_token", + comment: "", + indexes: [] + }); + dc.models.UserToken = UserToken; + return UserToken; }; \ No newline at end of file diff --git a/api/package.json b/api/package.json index 53a45cb..cd41ba8 100644 --- a/api/package.json +++ b/api/package.json @@ -36,6 +36,7 @@ "redis": "^3.1.2", "request": "^2.88.2", "rimraf": "^2.6.3", + "sequelize-automate-freesun": "^1.2.2", "superagent": "^3.5.2", "uuid": "^3.3.2" },