Skip to main content
Version: 3.0

Module 模块

作为分解应用复杂性、支持导入导出的基本单元。目前这个版本是兼容版,只支持三种类型:扩展模块、接口应用、扩展组件。与后续产品制定的模块类型不冲突。

结构声明

interface Module {
"concept": "Module", // 产品概念
"type": "extension" | "interface" | "component", // 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:any }> }, // 外部语言依赖,目前仅在后端扩展模块中使用。
"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, // 配置管理
}

示例

简单示例

{
"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
}

扩展模块 1

{
"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 —— 泛型

{
"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
}