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


TypeScript node-boot.RequestMapping函數代碼示例

本文整理匯總了TypeScript中node-boot.RequestMapping函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript RequestMapping函數的具體用法?TypeScript RequestMapping怎麽用?TypeScript RequestMapping使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了RequestMapping函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: saveMarks

  @ResponseBody
  @RequestMapping('/marks', RequestType.PUT)
  public saveMarks(request, response): Promise<void> {
    const userId = request.user.id;
    const marks = request.body;

    return this.markService.saveMarks(userId, marks);
  }
開發者ID:douglascvas,項目名稱:biblicando-backend,代碼行數:8,代碼來源:MarkController.ts

示例2: getMarks

  @ResponseBody
  @RequestMapping('/marks', RequestType.GET)
  public getMarks(request, response): Promise<Mark[]> {
    const userId = request.user.id;
    const verseIds = (request.query.verses || '').split(',');

    return this.markService.getMarksForVerses(userId, verseIds);
  }
開發者ID:douglascvas,項目名稱:biblicando-backend,代碼行數:8,代碼來源:MarkController.ts

示例3: getChapter

 @ResponseBody
 @RequestMapping('/chapter/:chapterId', RequestType.GET)
 public async getChapter(request, response): Promise<Chapter> {
   const chapterId = request.params.chapterId;
   return await this.chapterService.findChapter(chapterId);
 }
開發者ID:douglascvas,項目名稱:biblicando-backend,代碼行數:6,代碼來源:ChapterController.ts

示例4: getChapters

 @ResponseBody
 @RequestMapping('/book/:bookId/chapters', RequestType.GET)
 public getChapters(request, response): Promise<Chapter[]> {
   const bookId = request.params.bookId;
   return this.chapterService.findChaptersForBook(bookId);
 }
開發者ID:douglascvas,項目名稱:biblicando-backend,代碼行數:6,代碼來源:ChapterController.ts

示例5: getVerse

 @ResponseBody
 @RequestMapping('/verse/:verseId', RequestType.GET)
 public async getVerse(request, response): Promise<Verse> {
   const verseId = request.params.verseId;
   return await this.verseService.findVerse(verseId);
 }
開發者ID:douglascvas,項目名稱:biblicando-backend,代碼行數:6,代碼來源:VerseController.ts

示例6: getVerses

 @ResponseBody
 @RequestMapping('/chapter/:chapterId/verses', RequestType.GET)
 public async getVerses(request, response): Promise<Verse[]> {
   const chapterId = request.params.chapterId;
   return this.verseService.findVersesForChapter(chapterId);
 }
開發者ID:douglascvas,項目名稱:biblicando-backend,代碼行數:6,代碼來源:VerseController.ts


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