Logic 逻辑
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface Logic {
"concept": "Logic" | "AuthLogic" | "AuthLogicForCallInterface", // 产品概念
"name": string, // 逻辑名称
"description": string, // 逻辑描述
"triggerType": string, // triggerType
"cron": string, // cron
"overridable": boolean, // overridable
"transactional": Transactional, // 事务
"compilerInfoMap": { java?: { packageName: string, className: string } }, // 编译器信息,目前仅在后端扩展模块中使用。
"typeParams": Array<TypeParam>, // 类型参数列表
"params": Array<Param>, // 输入参数列表
"returns": Array<Return>, // 输出参数列表
"variables": Array<Variable>, // 变量列表
"body": Array<LogicItem>, // 逻辑项列表
"playground": Array<LogicItem>, // 逻辑项列表
}
class LogicTreeNode {
ConceptEnum concept; // 产品概念
String name; // 逻辑名称
String description; // 逻辑描述
String triggerType; // triggerType
String cron; // cron
boolean overridable; // overridable
TransactionalTreeNode transactional; // 事务
Object compilerInfoMap; // 编译器信息,目前仅在后端扩展模块中使用。
List<TypeParamTreeNode> typeParams; // 类型参数列表
List<ParamTreeNode> params; // 输入参数列表
List<ReturnTreeNode> returns; // 输出参数列表
List<VariableTreeNode> variables; // 变量列表
List<LogicItemTreeNode> body; // 逻辑项列表
List<LogicItemTreeNode> playground; // 逻辑项列表
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/Logic",
"definitions": {
"Logic": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"enum": [
"Logic",
"AuthLogic",
"AuthLogicForCallInterface"
]
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"triggerType": {
"type": "string"
},
"cron": {
"type": "string"
},
"overridable": {
"type": "boolean"
},
"transactional": {
"$ref": "#/definitions/Transactional"
},
"compilerInfoMap": {
"type": "object",
"properties": {
"java": {
"type": "object",
"properties": {
"packageName": {
"type": "string"
},
"className": {
"type": "string"
}
},
"required": [
"packageName",
"className"
],
"additionalProperties": false
}
},
"additionalProperties": false
},
"typeParams": {
"type": "array",
"items": {
"$ref": "#/definitions/TypeParam"
}
},
"params": {
"type": "array",
"items": {
"$ref": "#/definitions/Param"
}
},
"returns": {
"type": "array",
"items": {
"$ref": "#/definitions/Return"
}
},
"variables": {
"type": "array",
"items": {
"$ref": "#/definitions/Variable"
}
},
"body": {
"type": "array",
"items": {
"$ref": "#/definitions/LogicItem"
}
},
"playground": {
"type": "array",
"items": {
"$ref": "#/definitions/LogicItem"
}
}
},
"required": [
"concept",
"name",
"description",
"triggerType",
"cron",
"overridable",
"transactional",
"compilerInfoMap",
"typeParams",
"params",
"returns",
"variables",
"body",
"playground"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "Logic",
"name": "String",
"description": "String",
"triggerType": "cronTrigger",
"cron": "0 0 * * * ?",
"overridable": null,
"transactional": null,
"compilerInfoMap": null,
"typeParams": null,
"params": [],
"returns": [],
"variables": [],
"body": [],
"playground": []
}
concept: Logic
name: String
description: String
triggerType: cronTrigger
cron: 0 0 * * * ?
overridable: null
transactional: null
compilerInfoMap: null
typeParams: null
params: []
returns: []
variables: []
body: []
playground: []