mirror of
https://github.com/sakaljurgis/kodi-api-server.git
synced 2026-07-09 04:47:41 +00:00
add some frame to lrt service
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { Controller, Get, Param, Query, Req } from '@nestjs/common';
|
||||
import { Request } from 'express';
|
||||
import { LrtService } from './lrt.service';
|
||||
|
||||
@Controller('api/lrt')
|
||||
export class LrtController {
|
||||
constructor(private readonly lrtService: LrtService) {}
|
||||
|
||||
@Get()
|
||||
getLrtMenu(@Req() request: Request) {
|
||||
return {
|
||||
mod: 'lrt - menu',
|
||||
path: request.url,
|
||||
};
|
||||
getLrtMenu() {
|
||||
return this.lrtService.getMainMenu();
|
||||
}
|
||||
|
||||
@Get('search')
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { LrtController } from './lrt.controller';
|
||||
import { LrtService } from './lrt.service';
|
||||
import { KodiApiResponseFactory } from '../kodi-api-response.factory';
|
||||
|
||||
@Module({
|
||||
controllers: [LrtController],
|
||||
providers: [],
|
||||
providers: [KodiApiResponseFactory, LrtService],
|
||||
})
|
||||
export class LrtModule {}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import ApiResponse from '../Dto/api-response.dto';
|
||||
import { KodiApiResponseFactory } from '../kodi-api-response.factory';
|
||||
|
||||
@Injectable()
|
||||
export class LrtService {
|
||||
getMainMenu(): string {
|
||||
return 'Hello World!';
|
||||
constructor(
|
||||
private readonly kodiApiResponseFactory: KodiApiResponseFactory,
|
||||
) {}
|
||||
getMainMenu(): ApiResponse {
|
||||
return this.kodiApiResponseFactory.createApiResponse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import ApiResponse from './Dto/api-response.dto';
|
||||
import NotificationResponse from './Dto/notification-response';
|
||||
import NotificationResponse from './Dto/notification-response.dto';
|
||||
|
||||
@Injectable()
|
||||
export class KodiApiResponseFactory {
|
||||
|
||||
@@ -7,6 +7,7 @@ export class KodiApiService {
|
||||
constructor(
|
||||
private readonly kodiApiResponseFactory: KodiApiResponseFactory,
|
||||
) {}
|
||||
|
||||
getMainMenu(): ApiResponse {
|
||||
const apiResponse = this.kodiApiResponseFactory.createApiResponse();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user