What is Status
The module a-status
provides the status
feature, which can store the status values of the backend service running. For example, when the role tree
changes, it is marked by the status roleDirty
Usage of Status
Module a-status
injects object status
into ctx.meta
through middleware mechanism
src/suite-vendor/test-party/modules/test-party/backend/src/controller/test/feat/status.js
set
// set(name, value)
await this.ctx.meta.status.set('__enable', true);
Name | Description |
---|---|
name | status name |
value | status value |
get
let value = await this.ctx.meta.status.get('__enable');
Across Module
Access to the status defined by other modules
// other module's status
const moduleStatus = this.ctx.meta.status.module('test-party');
// get
let value = await moduleStatus.get('__enable');
Comments: