本文整理汇总了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);
}