mirror of
https://github.com/sakaljurgis/kodi-api-server.git
synced 2026-07-09 04:47:41 +00:00
start with all-files module
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import ApiResponse from '../Dto/api-response.dto';
|
||||
import { AllFilesService } from './all-files.service';
|
||||
|
||||
@Controller('api/all')
|
||||
export class AllFilesController {
|
||||
constructor(private readonly allFilesService: AllFilesService) {}
|
||||
|
||||
@Get()
|
||||
getMenu(): ApiResponse {
|
||||
return this.allFilesService.getMenu();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { AllFilesController } from './all-files.controller';
|
||||
import { AllFilesService } from './all-files.service';
|
||||
import { KodiApiResponseFactory } from '../kodi-api-response.factory';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [AllFilesController],
|
||||
providers: [AllFilesService, KodiApiResponseFactory],
|
||||
})
|
||||
export class AllFilesModule {}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import ApiResponse from '../Dto/api-response.dto';
|
||||
import { KodiApiResponseFactory } from '../kodi-api-response.factory';
|
||||
|
||||
@Injectable()
|
||||
export class AllFilesService {
|
||||
constructor(private readonly koiApiResponseFactory: KodiApiResponseFactory) {}
|
||||
|
||||
getMenu(): ApiResponse {
|
||||
const apiResponse = this.koiApiResponseFactory.createApiResponse();
|
||||
apiResponse
|
||||
.createItem()
|
||||
.setLabel('Movies')
|
||||
.setPath('all/movie')
|
||||
.setToFolder();
|
||||
apiResponse
|
||||
.createItem()
|
||||
.setLabel('Shows')
|
||||
.setPath('all/show')
|
||||
.setToFolder();
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import { LrtCategory } from './Entity/lrt-category.entity';
|
||||
HttpModule.register({
|
||||
withCredentials: true,
|
||||
}),
|
||||
TypeOrmModule.forFeature([LrtCategory])
|
||||
TypeOrmModule.forFeature([LrtCategory]),
|
||||
],
|
||||
providers: [
|
||||
LrtApiSearchClient,
|
||||
|
||||
@@ -9,9 +9,10 @@ import { KodiApiUrlRewriteMiddleware } from './UrlRewrite/url-rewrite.middleware
|
||||
import { LrtModule } from './LRT/lrt.module';
|
||||
import { KodiApiService } from './kodi-api.service';
|
||||
import { KodiApiResponseFactory } from './kodi-api-response.factory';
|
||||
import { AllFilesModule } from './AllFiles/all-files.module';
|
||||
|
||||
@Module({
|
||||
imports: [LrtModule],
|
||||
imports: [LrtModule, AllFilesModule],
|
||||
controllers: [KodiApiController],
|
||||
providers: [KodiApiService, KodiApiResponseFactory],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user