App 应用
应用的根节点,包含应用的基本信息。
1. 结构声明
- TS Declaration
- JSON Schema
class App extends BaseNode {
id: string = '';
ideVersion: string;
name: string = '';
title: string;
icon: string;
desc: string;
dnsAddr: string;
hasUserCenter: boolean;
hasAuth: boolean;
dataSources: Array<DataSource>;
structures: Array<Structure>;
enums: Array<Enum>;
logics: Array<Logic>;
overriddenLogics: Array<OverriddenLogic>;
interfaces: Array<AbstractInterface>;
frontendTypes: Array<FrontendType>;
backend: Backend = new Backend();
processes: Array<Process>;
processV2s: Array<ProcessV2>;
roles: Array<Role>;
configuration: Configuration = new Configuration();
connectorDependencies: Array<Connector>;
interfaceDependencies: Array<Module>;
dependencies: Array<Module>;
integration: Integration;
authLogics: Array<AuthLogic>;
authLogicsForCallInterface: Array<AuthLogicForCallInterface>;
connections: Array<Connection>;
triggerLaunchers: Array<TriggerLauncher>;
metadataTypes: Array<MetadataType>;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"type": "string"
},
"ideVersion": {
"type": "string"
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"icon": {
"type": "string"
},
"desc": {
"type": "string"
},
"dnsAddr": {
"type": "string"
},
"hasUserCenter": {
"type": "boolean"
},
"hasAuth": {
"type": "boolean"
},
"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"
}
},
"overriddenLogics": {
"type": "array",
"items": {
"$ref": "#/definitions/OverriddenLogic"
}
},
"interfaces": {
"type": "array",
"items": {
"$ref": "#/definitions/AbstractInterface"
}
},
"frontendTypes": {
"type": "array",
"items": {
"$ref": "#/definitions/FrontendType"
}
},
"backend": {
"$ref": "#/definitions/Backend"
},
"processes": {
"type": "array",
"items": {
"$ref": "#/definitions/Process"
}
},
"processV2s": {
"type": "array",
"items": {
"$ref": "#/definitions/ProcessV2"
}
},
"roles": {
"type": "array",
"items": {
"$ref": "#/definitions/Role"
}
},
"configuration": {
"$ref": "#/definitions/Configuration"
},
"connectorDependencies": {
"type": "array",
"items": {
"$ref": "#/definitions/Connector"
}
},
"interfaceDependencies": {
"type": "array",
"items": {
"$ref": "#/definitions/Module"
}
},
"dependencies": {
"type": "array",
"items": {
"$ref": "#/definitions/Module"
}
},
"integration": {
"$ref": "#/definitions/Integration"
},
"authLogics": {
"type": "array",
"items": {
"$ref": "#/definitions/AuthLogic"
}
},
"authLogicsForCallInterface": {
"type": "array",
"items": {
"$ref": "#/definitions/AuthLogicForCallInterface"
}
},
"connections": {
"type": "array",
"items": {
"$ref": "#/definitions/Connection"
}
},
"triggerLaunchers": {
"type": "array",
"items": {
"$ref": "#/definitions/TriggerLauncher"
}
},
"metadataTypes": {
"type": "array",
"items": {
"$ref": "#/definitions/MetadataType"
}
}
},
"required": [
"id",
"ideVersion",
"name",
"title",
"icon",
"desc",
"dnsAddr",
"hasUserCenter",
"hasAuth",
"dataSources",
"structures",
"enums",
"logics",
"overriddenLogics",
"interfaces",
"frontendTypes",
"backend",
"processes",
"processV2s",
"roles",
"configuration",
"connectorDependencies",
"interfaceDependencies",
"dependencies",
"integration",
"authLogics",
"authLogicsForCallInterface",
"connections",
"triggerLaunchers",
"metadataTypes"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "App",
"id": "1de42d35-9d11-4578-9ebe-e3a62c69cd9c",
"ideVersion": "3.7",
"name": "course",
"title": "课程管理系统",
"icon": "app.icon",
"desc": "课程管理系统",
"dnsAddr": "course.codewave.163.com",
"hasUserCenter": true,
"hasAuth": true,
"dataSources": [
{
"concept": "DataSource",
"name": "defaultDS",
"description": "默认数据源",
"entities": [
{
"concept": "Entity",
"name": "Product",
"description": "",
"uuid": "bd624ce40865488faff6d6e6a5f04422",
"tableName": "product",
"origin": "ide",
"properties": [
{
"concept": "EntityProperty",
"name": "price",
"uuid": "8f9b69575e4c4e33b8673aefe7ada2c0",
"label": "",
"description": "",
"columnName": "price",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Decimal",
"inferred": false,
"ruleMap": {
"scale": 2
}
},
"databaseTypeAnnotation": {
"concept": "DatabaseTypeAnnotation",
"typeName": "decimal",
"arguments": {
"precision": "31"
}
},
"display": {
"inDetail": true,
"inFilter": true,
"inForm": true,
"inTable": true
},
"rules": [],
"generationRule": "manual"
},
{
"concept": "EntityProperty",
"name": "name",
"uuid": "f617749bae2545639102821de778add3",
"label": "",
"description": "",
"columnName": "name",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"inferred": false,
"ruleMap": {}
},
"display": {
"inDetail": true,
"inFilter": true,
"inForm": true,
"inTable": true
},
"rules": [],
"generationRule": "manual"
}
],
"indexes": []
}
],
"ddlStrategy": "originNotTable"
}
],
"structures": [
{
"concept": "Structure",
"name": "ProductOrder",
"description": "",
"properties": [
{
"concept": "StructureProperty",
"name": "product",
"label": "商品",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "reference",
"typeNamespace": "app.dataSources.defaultDS.entities",
"typeName": "Product",
"inferred": false,
"ruleMap": {}
},
"jsonName": "",
"description": ""
},
{
"concept": "StructureProperty",
"name": "order",
"label": "订单",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "reference",
"typeNamespace": "app.dataSources.defaultDS.entities",
"typeName": "OrderForm",
"inferred": false,
"ruleMap": {}
},
"jsonName": "",
"description": ""
},
{
"concept": "StructureProperty",
"name": "count",
"label": "数量",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
},
"jsonName": "",
"description": ""
}
]
}
],
"enums": [],
"logics": [
{
"concept": "Logic",
"name": "logic1",
"title": "标题",
"description": "",
"triggerType": "",
"cron": "",
"overridable": false,
"transactional": {
"concept": "Transactional",
"enabled": false,
"propagation": "REQUIRED",
"isolation": "DEFAULT"
},
"params": [
{
"concept": "Param",
"name": "list",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeNamespace": "nasl.collection",
"typeKind": "generic",
"typeName": "List",
"typeArguments": [
{
"concept": "TypeAnnotation",
"typeNamespace": "nasl.core",
"typeKind": "primitive",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
}
],
"inferred": false,
"ruleMap": {}
}
}
],
"returns": [
{
"concept": "Return",
"name": "result",
"description": ""
}
],
"variables": [],
"body": [
{
"concept": "Start"
},
{
"concept": "Assignment",
"label": "赋值",
"left": {
"concept": "Identifier",
"namespace": "",
"name": "result"
},
"right": {
"concept": "NullLiteral"
}
},
{
"concept": "End"
}
],
"playground": []
}
],
"overriddenLogics": [],
"backend": {
"concept": "Backend",
"name": "",
"variables": []
},
"interfaces": [],
"frontendTypes": [],
"processes": [],
"processV2s": [],
"roles": [],
"connectorDependencies": [],
"interfaceDependencies": [],
"dependencies": [],
"configuration": {
"concept": "Configuration",
"groups": []
},
"integration": {
"concept": "Integration",
"connectors": []
},
"authLogics": [],
"authLogicsForCallInterface": [],
"connections": [],
"triggerLaunchers": [],
"metadataTypes": []
}
concept: App
id: 1de42d35-9d11-4578-9ebe-e3a62c69cd9c
ideVersion: "3.7"
name: course
title: 课程管理系统
icon: app.icon
desc: 课程管理系统
dnsAddr: course.codewave.163.com
hasUserCenter: true
hasAuth: true
dataSources:
- concept: DataSource
name: defaultDS
description: 默认数据源
entities:
- concept: Entity
name: Product
description: ""
uuid: bd624ce40865488faff6d6e6a5f04422
tableName: product
origin: ide
properties:
- concept: EntityProperty
name: price
uuid: 8f9b69575e4c4e33b8673aefe7ada2c0
label: ""
description: ""
columnName: price
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Decimal
inferred: false
ruleMap:
scale: 2
databaseTypeAnnotation:
concept: DatabaseTypeAnnotation
typeName: decimal
arguments:
precision: "31"
display:
inDetail: true
inFilter: true
inForm: true
inTable: true
rules: []
generationRule: manual
- concept: EntityProperty
name: name
uuid: f617749bae2545639102821de778add3
label: ""
description: ""
columnName: name
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: String
inferred: false
ruleMap: {}
display:
inDetail: true
inFilter: true
inForm: true
inTable: true
rules: []
generationRule: manual
indexes: []
ddlStrategy: originNotTable
structures:
- concept: Structure
name: ProductOrder
description: ""
properties:
- concept: StructureProperty
name: product
label: 商品
typeAnnotation:
concept: TypeAnnotation
typeKind: reference
typeNamespace: app.dataSources.defaultDS.entities
typeName: Product
inferred: false
ruleMap: {}
jsonName: ""
description: ""
- concept: StructureProperty
name: order
label: 订单
typeAnnotation:
concept: TypeAnnotation
typeKind: reference
typeNamespace: app.dataSources.defaultDS.entities
typeName: OrderForm
inferred: false
ruleMap: {}
jsonName: ""
description: ""
- concept: StructureProperty
name: count
label: 数量
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Long
inferred: false
ruleMap: {}
jsonName: ""
description: ""
enums: []
logics:
- concept: Logic
name: logic1
title: 标题
description: ""
triggerType: ""
cron: ""
overridable: false
transactional:
concept: Transactional
enabled: false
propagation: REQUIRED
isolation: DEFAULT
params:
- concept: Param
name: list
description: ""
typeAnnotation:
concept: TypeAnnotation
typeNamespace: nasl.collection
typeKind: generic
typeName: List
typeArguments:
- concept: TypeAnnotation
typeNamespace: nasl.core
typeKind: primitive
typeName: Long
inferred: false
ruleMap: {}
inferred: false
ruleMap: {}
returns:
- concept: Return
name: result
description: ""
variables: []
body:
- concept: Start
- concept: Assignment
label: 赋值
left:
concept: Identifier
namespace: ""
name: result
right:
concept: NullLiteral
- concept: End
playground: []
overriddenLogics: []
backend:
concept: Backend
name: ""
variables: []
interfaces: []
frontendTypes: []
processes: []
processV2s: []
roles: []
connectorDependencies: []
interfaceDependencies: []
dependencies: []
configuration:
concept: Configuration
groups: []
integration:
concept: Integration
connectors: []
authLogics: []
authLogicsForCallInterface: []
connections: []
triggerLaunchers: []
metadataTypes: []
对应的代码如下:
- 文本化 NASL
dataSource defaultDS {
@(
description = "",
uuid = "bd624ce40865488faff6d6e6a5f04422",
tableName = "product",
origin = "ide",
)
entity Product {
@(
label = "",
description = "",
uuid = "8f9b69575e4c4e33b8673aefe7ada2c0",
columnName = "price",
databaseTypeAnnotation = @DatabaseTypeAnnotation(
typeName = "decimal",
arguments = [ "precision" -> "31" ],
)
,
generationRule = "manual",
)
price: Decimal;
@(
label = "",
description = "",
uuid = "f617749bae2545639102821de778add3",
columnName = "name",
generationRule = "manual",
)
name: String;
}
}
//
@(description = "")
struct ProductOrder {
@(
label = "商品",
description = "",
jsonName = "",
)
product: app::dataSources::defaultDS::entities::Product;
@(
label = "订单",
description = "",
jsonName = "",
)
order: app::dataSources::defaultDS::entities::OrderForm;
@(
label = "数量",
description = "",
jsonName = "",
)
count: Integer;
}
//
@(
title = "标题",
description = "",
triggerType = "",
cron = "",
transactional = [编译方法未实现],
overridable = false,
)
logic logic1(list: List<Integer>) => result {
result = null
end
}