本文整理汇总了TypeScript中routing-controllers.Get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript Get函数的具体用法?TypeScript Get怎么用?TypeScript Get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Get函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: getStatus
@Get('/')
@OpenAPI({
summary: "Get Loader Status",
description: "Check to see if blockchain has been loaded by node"
})
@ResponseSchema('responses.loader.getStatus')
public getStatus() {
return {
loaded: this.loaderModule.loaded,
};
}
开发者ID:RiseVision,项目名称:rise-node,代码行数:11,代码来源:loaderAPI.ts
示例2: getStatusSync
@Get('/sync')
@OpenAPI({
summary: "Get Loader Sync Status",
description: "Retrieve current status of node's blockchain sync"
})
@ResponseSchema('responses.loader.getStatusSync')
public getStatusSync() {
return {
broadhash: this.systemModule.broadhash,
consensus: this.appState.get('node.consensus'),
height : this.blocksModule.lastBlock.height,
syncing : this.loaderModule.isSyncing,
};
}
开发者ID:RiseVision,项目名称:rise-node,代码行数:14,代码来源:loaderAPI.ts
示例3: ping
@Get('/ping')
@OpenAPI({
summary: "Ping",
description: "Ping node to see if capable of syncing quickly enough (within two blocks)"
})
@ResponseSchema('responses.loader.ping')
public ping() {
let status = false;
if (this.blocksModule.lastBlock) {
const secondsAgo = Math.floor(Date.now() / 1000) -
(Math.floor(this.constants.epochTime.getTime() / 1000) + this.blocksModule.lastBlock.timestamp);
status = secondsAgo < this.constants.blockReceiptTimeOut;
}
return { success: status };
}
开发者ID:RiseVision,项目名称:rise-node,代码行数:16,代码来源:loaderAPI.ts
示例4: get
@Get('/')
async get(): Promise<any> {
let client = await this.client;
let pet = await client.pet.getPetById({ petId: 7 });
return pet;
}
开发者ID:iamchairs,项目名称:node-microservice-demo,代码行数:6,代码来源:PetStoreController.ts
示例5: getAll
开发者ID:eqiuno,项目名称:xiaojia,代码行数:4,代码来源:Dictionay.ts
注:本文中的routing-controllers.Get函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论