我目前正在从事一个有角度的项目。我将不得不为该项目处理一些对象,但是我将通过调用API来获得此类的专有性。
API将为我提供JSON中的元数据,并且随着元数据的变化,我无法定义用于操作对象的永久类。
我做了很多研究,但没有发现任何结果,也许我做得不好,对不起我的英语,但在此先感谢您的帮助!
这是我想用来创建类的元数据
const PARTNERSHIP = {
version: '0.1',
properties: [
{
id: 'id', label: 'ID', description: 'ID description', type: 'S', required: true, readonly: true,
},
{
id: 'label', label: 'Name', description: 'Name description', type: 'S', required: true,
},
{
id: 'description', label: 'Description', description: 'Description description', type: 'S', required: true,
},
{
id: 'active', label: 'Active', description: 'Active', type: 'B', values: [true, false], default: false,
},
{
// * When type == 'E' (enum), look below for description
id: 'config', label: 'config', description: 'Config', type: 'E', typeRef: 'conf',
},
{
id: 'createdAt', label: 'Created At', description: 'Moment of creation, timestamp in millis, value to be displayed as date', type: 'N', readonly: true,
},
{
id: 'updatedAt', label: 'Updated At', description: 'Moment of update, timestamp in millis, value to be displayed as date', type: 'N', readonly: true,
},
],