作者 yangfu

block chain edit

version: v1
kind: HttpApi
metadata:
service: blockChain
path: /block-chains
endpoints:
- method: createBlockChain
route:
post: /
- method: updateBlockChain
route:
put: /{blockChainId}
- method: getBlockChain
route:
get: /{blockChainId}
- method: removeBlockChain
route:
delete: /{blockChainId}
- method: listBlockChain
route:
get: /
params:
- name: offset
- name: limit
... ...
... ... @@ -19,3 +19,9 @@ metadata:
- method: listMenu
route:
post: /search
- method: batchDeleteMenu
route:
post: /batch-delete
- method: batchEnableMenu
route:
post: /batch-enable
... ...
version: v1
kind: Attribute
metadata:
name: data
description: 数据体
type:
primitive: string
... ...
version: v1
kind: Attribute
metadata:
name: hash
description: 数据块hash
type:
primitive: string
... ...
version: v1
kind: Attribute
metadata:
name: issueId
description: 溯源ID 标记同一个系列的数据;例如订单相关事件
type:
primitive: string
... ...
version: v1
kind: Attribute
metadata:
name: primaryId
description: 来源数据唯一ID
type:
primitive: string
... ...
version: v1
kind: Attribute
metadata:
name: source
description: 数据来源 例如:app.model
type:
primitive: string
... ...
version: v1
kind: Attribute
metadata:
name: upChainId
description: 上链数据唯一标识
type:
primitive: int64
... ...
version: v1
kind: Attribute
metadata:
name: upChainStatus
description: 上链状态 1:成功 2:失败
type:
primitive: int
... ...
version: v1
kind: Schema
metadata:
name: upChain
description: 上链数据
attributes:
- ref: upChainId
required: true
- ref: source
required: true
- ref: primaryId
required: true
- ref: issueId
required: true
- ref: data
required: true
- ref: hash
required: true
- ref: upChainStatus
required: true
- ref: createdAt
required: true
... ...
version: v1
kind: Method
metadata:
name: createBlockChain
type: command
description: 创建
payload:
- ref: upChainId
required: true
result:
- name: upChain
type:
schema: upChain
required: true
... ...
version: v1
kind: Method
metadata:
name: getBlockChain
type: query
description: 返回
payload:
- ref: upChainId
required: true
result:
- name: upChain
type:
schema: upChain
required: true
... ...
version: v1
kind: Method
metadata:
name: listBlockChain
type: query
description: 返回列表
payload:
- ref: offset
required: true
- ref: limit
required: true
result:
- ref: count
required: true
- name: upChains
type:
array: upChain
required: true
... ...
version: v1
kind: Method
metadata:
name: removeBlockChain
type: command
description: 移除
payload:
- ref: upChainId
required: true
result:
- name: upChain
type:
schema: upChain
required: true
... ...
version: v1
kind: Method
metadata:
name: upChain
type: command
description: 数据上链
payload:
- ref: source
required: true
- ref: primaryId
required: true
- ref: issueId
required: true
- ref: data
required: true
result:
- name: upChain
type:
schema: upChain
required: true
... ...
version: v1
kind: Method
metadata:
name: updateBlockChain
type: command
description: 更新
payload:
- ref: upChainId
required: true
result:
- name: upChain
type:
schema: upChain
required: true
... ...
version: v1
kind: Service
metadata:
name: blockChain
description: 区块链服务
... ...
version: v1
kind: Method
metadata:
name: batchDeleteMenu
type: command
description: 批量删除菜单
payload:
- name: menuIds
description: 菜单ID列表
type:
array: int64
result:
- name: menu
type:
schema: menu
required: true
... ...
version: v1
kind: Method
metadata:
name: batchEnableMenu
type: command
description: 批量启用菜单
payload:
- name: menuIds
description: 菜单ID列表
type:
array: int64
- name: status
description: 菜单状态
type:
primitive: int
result:
- name: menu
type:
schema: menu
required: true
... ...