本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}