當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript routing-controllers.Get函數代碼示例

本文整理匯總了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

    @Get('/')
    getAll() {

    }
開發者ID:eqiuno,項目名稱:xiaojia,代碼行數:4,代碼來源:Dictionay.ts


注:本文中的routing-controllers.Get函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。