create LRT module frame

This commit is contained in:
Jurgis Sakalauskas
2022-12-06 19:36:10 +02:00
parent d20295326f
commit 8c9190675b
12 changed files with 243 additions and 4 deletions
+50
View File
@@ -0,0 +1,50 @@
import { Controller, Get, Param, Query, Req } from '@nestjs/common';
import { Request } from 'express';
@Controller('api/lrt')
export class LrtController {
@Get()
getLrtMenu(@Req() request: Request) {
return {
mod: 'lrt - menu',
path: request.url,
};
}
@Get('search')
getSearch(@Req() request: Request, @Query('search') search: string) {
return {
mod: 'lrt',
path: request.url,
search: search ?? 'no',
};
}
@Get('cat/:id')
getCategory(@Req() request: Request, @Param('id') id: number) {
return {
mod: 'lrt - category',
path: request.url,
category: id,
};
}
@Get('tema/:tema')
getTema(@Req() request: Request, @Param('tema') tema: string) {
return {
mod: 'lrt - category',
path: request.url,
tema: tema,
};
}
@Get('play/*')
getPlay(@Req() request: Request, @Param() params: string[]) {
const playPath = params[0];
return {
mod: 'lrt - play',
path: request.url,
playPath: playPath,
};
}
}