Module 模块
作为分解应用复杂性、支持导入导出的基本单元。目前这个版本是兼容版,只支持三种类型:扩展模块、接口应用、扩展组件。与后续产品制定的模块类型不冲突。
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface Module {
"concept": "Module" | "Connector", // 产品概念
"type": "extension" | "interface" | "component" | "connector", // type,扩展模块 | 从 API 管理导入的接口应用(兼容老版) | 扩展组件(兼容老版)
"version": string, // version
"name": string, // 模块名称
"title": string, // 模块标题
"description": string, // 模块描述
"provider": string, // provider
"externalDependencyMap": { maven?: Array<{ groupId: string, artifactId: string, version: string }> }, // 外部语言依赖,目前仅在后端扩展模块中使用。
"compilerInfoMap": { java?: Array<{ packageName: string,className:string,naslName: string, type: string,javaTypes:Map<string, string> }>,js?: { prefix:string } }, // 外部语言依赖,目前仅在后端扩展模块中使用。
"dataSources": Array<DataSource>, // 数据源列表
"structures": Array<Structure>, // 数据结构列表
"enums": Array<Enum>, // 枚举列表
"logics": Array<Logic>, // 逻辑列表
"interfaces": Array<Interface>, // 接口列表
"views": Array<View>, // 页面列表
"frontendVariables": Array<Variable>, // 变量列表
"processes": Array<Process>, // 流程列表
"frontends": Array<FrontendLibrary>, // 前端库列表
"configuration": Configuration, // 配置管理
"triggerLaunchers": Array<TriggerLauncher>, // 触发器启动器列表
"connections": Array<Connection>, // 连接列表
}
class ModuleTreeNode {
ConceptEnum concept; // 产品概念
TypeEnum type; // type,扩展模块 | 从 API 管理导入的接口应用(兼容老版) | 扩展组件(兼容老版)
String version; // version
String name; // 模块名称
String title; // 模块标题
String description; // 模块描述
String provider; // provider
Object externalDependencyMap; // 外部语言依赖,目前仅在后端扩展模块中使用。
Object compilerInfoMap; // 外部语言依赖,目前仅在后端扩展模块中使用。
List<DataSourceTreeNode> dataSources; // 数据源列表
List<StructureTreeNode> structures; // 数据结构列表
List<EnumTreeNode> enums; // 枚举列表
List<LogicTreeNode> logics; // 逻辑列表
List<InterfaceTreeNode> interfaces; // 接口列表
List<ViewTreeNode> views; // 页面列表
List<VariableTreeNode> frontendVariables; // 变量列表
List<ProcessTreeNode> processes; // 流程列表
List<FrontendLibraryTreeNode> frontends; // 前端库列表
ConfigurationTreeNode configuration; // 配置管理
List<TriggerLauncherTreeNode> triggerLaunchers; // 触发器启动器列表
List<ConnectionTreeNode> connections; // 连接列表
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/Module",
"definitions": {
"Module": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"enum": [
"Module",
"Connector"
]
},
"type": {
"type": "string",
"enum": [
"extension",
"interface",
"component",
"connector"
]
},
"version": {
"type": "string"
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"provider": {
"type": "string"
},
"externalDependencyMap": {
"type": "object",
"properties": {
"maven": {
"type": "array",
"items": {
"type": "object",
"properties": {
"groupId": {
"type": "string"
},
"artifactId": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"groupId",
"artifactId",
"version"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"compilerInfoMap": {
"type": "object",
"properties": {
"java": {
"type": "array",
"items": {
"type": "object",
"properties": {
"packageName": {
"type": "string"
},
"className": {
"type": "string"
},
"naslName": {
"type": "string"
},
"type": {
"type": "string"
},
"javaTypes": {
"type": "object",
"properties": {
"size": {
"type": "number"
}
},
"required": [
"size"
],
"additionalProperties": false
}
},
"required": [
"packageName",
"className",
"naslName",
"type",
"javaTypes"
],
"additionalProperties": false
}
},
"js": {
"type": "object",
"properties": {
"prefix": {
"type": "string"
}
},
"required": [
"prefix"
],
"additionalProperties": false
}
},
"additionalProperties": false
},
"dataSources": {
"type": "array",
"items": {
"$ref": "#/definitions/DataSource"
}
},
"structures": {
"type": "array",
"items": {
"$ref": "#/definitions/Structure"
}
},
"enums": {
"type": "array",
"items": {
"$ref": "#/definitions/Enum"
}
},
"logics": {
"type": "array",
"items": {
"$ref": "#/definitions/Logic"
}
},
"interfaces": {
"type": "array",
"items": {
"$ref": "#/definitions/Interface"
}
},
"views": {
"type": "array",
"items": {
"$ref": "#/definitions/View"
}
},
"frontendVariables": {
"type": "array",
"items": {
"$ref": "#/definitions/Variable"
}
},
"processes": {
"type": "array",
"items": {
"$ref": "#/definitions/Process"
}
},
"frontends": {
"type": "array",
"items": {
"$ref": "#/definitions/FrontendLibrary"
}
},
"configuration": {
"$ref": "#/definitions/Configuration"
},
"triggerLaunchers": {
"type": "array",
"items": {
"$ref": "#/definitions/TriggerLauncher"
}
},
"connections": {
"type": "array",
"items": {
"$ref": "#/definitions/Connection"
}
}
},
"required": [
"concept",
"type",
"version",
"name",
"title",
"description",
"provider",
"externalDependencyMap",
"compilerInfoMap",
"dataSources",
"structures",
"enums",
"logics",
"interfaces",
"views",
"frontendVariables",
"processes",
"frontends",
"configuration",
"triggerLaunchers",
"connections"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "Module",
"type": "app",
"version": "1.2.0",
"name": "defaultModule",
"title": "课程管理系统(默认应用模块)",
"description": "课程管理系统(默认应用模块)的描述",
"provider": "资产中心-平台",
"externalDependencyMap": null,
"compilerInfoMap": null,
"dataSources": [],
"structures": [],
"enums": [],
"logics": [],
"interfaces": [],
"views": [],
"frontendVariables": [],
"processes": [],
"frontends": [],
"configuration": null,
"triggerLaunchers": [],
"connections": []
}
concept: Module
type: app
version: 1.2.0
name: defaultModule
title: 课程管理系统(默认应用模块)
description: 课程管理系统(默认应用模块)的描述
provider: 资产中心-平台
externalDependencyMap: null
compilerInfoMap: null
dataSources: []
structures: []
enums: []
logics: []
interfaces: []
views: []
frontendVariables: []
processes: []
frontends: []
configuration: null
triggerLaunchers: []
connections: []
扩展模块 1
- JSON
- YAML
{
"concept": "Module",
"type": "extension",
"changedTime": "2021-11-14T10:34:01Z",
"branchName": "master",
"version": "1.2.0",
"name": "defaultModule",
"title": "课程管理系统(默认应用模块)",
"description": "课程管理系统(默认应用模块)的描述",
"externalDependencyMap": {
"maven": [
{
"groupId": "com.netease.cloud",
"artifactId": "lowcode",
"version": "1.0.0"
},
{
"groupId": "com.netease.cloud",
"artifactId": "nasl-server",
"version": "1.0.0"
}
]
},
"structures": [],
"enums": [],
"logics": [{
"concept": "Logic",
"name": "addNumber",
"description": "数字加法",
"compilerInfoMap": {
"java": {
"packageName": "com.netease.cloud.util",
"className":"CommonUtil"
}
},
"params": [{
"concept": "Param",
"name": "num1",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null,
"inferred": null
},
"required": true,
"defaultValue": null
}, {
"concept": "Param",
"name": "num2",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null,
"inferred": null
},
"required": true,
"defaultValue": null
}],
"returns": [{
"concept": "Return",
"name": "result1",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null,
"inferred": null
},
"defaultValue": null
}],
"variables": null,
"body": null,
"playground": null
}],
"views": null,
"interfaces": null,
"entities": null,
"processes": null,
"viewComponents": null
}
concept: Module
type: extension
changedTime: 2021-11-14T10:34:01Z
branchName: master
version: 1.2.0
name: defaultModule
title: 课程管理系统(默认应用模块)
description: 课程管理系统(默认应用模块)的描述
externalDependencyMap:
maven:
- groupId: com.netease.cloud
artifactId: lowcode
version: 1.0.0
- groupId: com.netease.cloud
artifactId: nasl-server
version: 1.0.0
structures: []
enums: []
logics:
- concept: Logic
name: addNumber
description: 数字加法
compilerInfoMap:
java:
packageName: com.netease.cloud.util
className: CommonUtil
params:
- concept: Param
name: num1
description: ""
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Integer
typeArguments: null
inferred: null
required: true
defaultValue: null
- concept: Param
name: num2
description: ""
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Integer
typeArguments: null
inferred: null
required: true
defaultValue: null
returns:
- concept: Return
name: result1
description: ""
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Integer
typeArguments: null
inferred: null
defaultValue: null
variables: null
body: null
playground: null
views: null
interfaces: null
entities: null
processes: null
viewComponents: null
扩展模块 2 —— 泛型
- JSON
- YAML
{
"concept": "Module",
"type": "extension",
"changedTime": "2021-11-14T10:34:01Z",
"branchName": "master",
"version": "1.2.0",
"name": "defaultModule",
"title": "课程管理系统(默认应用模块)",
"description": "课程管理系统(默认应用模块)的描述",
"externalDependencyMap": {
"maven": [
{
"groupId": "com.netease.cloud",
"artifactId": "lowcode",
"version": "1.0.0"
},
{
"groupId": "com.netease.cloud",
"artifactId": "nasl-server",
"version": "1.0.0"
}
]
},
"structures": [{
"concept": "Structure",
"name": "Student",
"typeParams": [],
"compilerInfoMap": {
"java": {
"packageName": "com.netease.cloud.DTO"
}
},
"properties": [{
"concept": "StructureProperty",
"name": "name",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "age",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}]
}],
"enums": [{
"concept": "Enum",
"name": "Color",
"label": "颜色",
"description": "表示颜色的枚举",
"compilerInfoMap": {
"java": {
"packageName": "com.netease.cloud.DTO"
}
},
"enumItems": [{
"concept": "EnumItem",
"value": "RED",
"label": "红"
}, {
"concept": "EnumItem",
"value": "GREEN",
"label": "绿"
}, {
"concept": "EnumItem",
"value": "BLUE",
"label": "蓝"
}]
}],
"logics": [{
"concept": "Logic",
"name": "getList",
"description": "获取列表",
"compilerInfoMap": {
"java": {
"packageName": "com.netease.cloud.util",
"className":"CommonUtil"
}
},
"params": [{
"concept": "Param",
"name": "param1",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "reference",
"typeNamespace": "extensions.freemarker.structures",
"typeName": "Student",
"typeArguments": null,
"inferred": null
},
"required": true,
"defaultValue": null
}],
"returns": [{
"concept": "Return",
"name": "result",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "generic",
"typeNamespace": "nasl.collection",
"typeName": "List",
"typeArguments": [{
"concept": "TypeAnnotation",
"typeKind": "reference",
"typeNamespace": "extensions.freemarker.structures",
"typeName": "Student",
"typeArguments": null,
"inferred": null
}],
"inferred": null
},
"defaultValue": null
}],
"variables": null,
"body": null,
"playground": null
}],
"views": null,
"interfaces": null,
"entities": null,
"processes": null,
"viewComponents": null
}
concept: Module
type: extension
changedTime: 2021-11-14T10:34:01Z
branchName: master
version: 1.2.0
name: defaultModule
title: 课程管理系统(默认应用模块)
description: 课程管理系统(默认应用模块)的描述
externalDependencyMap:
maven:
- groupId: com.netease.cloud
artifactId: lowcode
version: 1.0.0
- groupId: com.netease.cloud
artifactId: nasl-server
version: 1.0.0
structures:
- concept: Structure
name: Student
typeParams: []
compilerInfoMap:
java:
packageName: com.netease.cloud.DTO
properties:
- concept: StructureProperty
name: name
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: String
typeArguments: null
- concept: StructureProperty
name: age
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Integer
typeArguments: null
enums:
- concept: Enum
name: Color
label: 颜色
description: 表示颜色的枚举
compilerInfoMap:
java:
packageName: com.netease.cloud.DTO
enumItems:
- concept: EnumItem
value: RED
label: 红
- concept: EnumItem
value: GREEN
label: 绿
- concept: EnumItem
value: BLUE
label: 蓝
logics:
- concept: Logic
name: getList
description: 获取列表
compilerInfoMap:
java:
packageName: com.netease.cloud.util
className: CommonUtil
params:
- concept: Param
name: param1
description: ""
typeAnnotation:
concept: TypeAnnotation
typeKind: reference
typeNamespace: extensions.freemarker.structures
typeName: Student
typeArguments: null
inferred: null
required: true
defaultValue: null
returns:
- concept: Return
name: result
description: ""
typeAnnotation:
concept: TypeAnnotation
typeKind: generic
typeNamespace: nasl.collection
typeName: List
typeArguments:
- concept: TypeAnnotation
typeKind: reference
typeNamespace: extensions.freemarker.structures
typeName: Student
typeArguments: null
inferred: null
inferred: null
defaultValue: null
variables: null
body: null
playground: null
views: null
interfaces: null
entities: null
processes: null
viewComponents: null