-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
shields.controller.ts
30 lines (25 loc) · 1.05 KB
/
shields.controller.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Controller, Get, Header, Redirect, HttpStatus } from '@nestjs/common';
import { ApiOperation, ApiTags, ApiResponse } from '@nestjs/swagger';
import { ShieldsService } from './shields.service';
@Controller('api/shields')
@ApiTags('Shields')
export class ShieldsController {
constructor(private readonly shieldsService: ShieldsService) { }
@Get()
@Redirect('api/shields/achievements', HttpStatus.MOVED_PERMANENTLY)
@ApiOperation({ summary: 'Redirects to api/shields/achievements' })
@ApiResponse({ status: HttpStatus.MOVED_PERMANENTLY })
redirectToGetAchievementsShield() {
}
@Get('achievements')
@Header('Content-Type', 'image/svg+xml;charset=utf-8')
@Header('Pragma-directive', 'no-cache')
@Header('Cache-directive', 'no-cache')
@Header('Pragma', 'no-cache')
@Header('Expires', '0')
@Header('Cache-Control', 'no-cache, no-store, must-revalidate')
@ApiOperation({ summary: 'Returns achievements shield' })
async getAchievementsShield(): Promise<string> {
return await this.shieldsService.createAchievementsShield();
}
}