Add fococoffee endpoints
This commit is contained in:
48
src/fococoffee/fococoffee.controller.ts
Normal file
48
src/fococoffee/fococoffee.controller.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { HarbingerService } from './harbinger.service';
|
||||
import { FocoCoffeeService } from './fococoffee.service';
|
||||
import { LimaService } from './lima.service';
|
||||
import { BindleService } from './bindle.service';
|
||||
import { ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('fococoffee')
|
||||
@ApiTags('fococoffee')
|
||||
export class FocoCoffeeController {
|
||||
|
||||
constructor(
|
||||
private readonly focoCoffeeService: FocoCoffeeService,
|
||||
private readonly harbingerService: HarbingerService,
|
||||
private readonly limaService: LimaService,
|
||||
private readonly bindleService: BindleService
|
||||
) { }
|
||||
|
||||
@Get('harbinger/products')
|
||||
@ApiResponse({ status: 200, description: 'Returns the list of Harbinger products' })
|
||||
async getHarbingerProducts() {
|
||||
return this.harbingerService.fetchProducts()
|
||||
}
|
||||
|
||||
@Get('lima/products')
|
||||
@ApiResponse({ status: 200, description: 'Returns the list of Lima products' })
|
||||
async getLimaProducts() {
|
||||
return this.limaService.fetchProducts()
|
||||
}
|
||||
|
||||
@Get('bindle/products')
|
||||
@ApiResponse({ status: 200, description: 'Returns the list of Bindle products' })
|
||||
async getBindleProducts() {
|
||||
return this.bindleService.fetchProducts()
|
||||
}
|
||||
|
||||
@Get('beans')
|
||||
@ApiResponse({ status: 200, description: 'Returns the list of coffee bean products from all suppliers' })
|
||||
async getBeans() {
|
||||
return this.focoCoffeeService.getBeans()
|
||||
}
|
||||
|
||||
@Get('products')
|
||||
@ApiResponse({ status: 200, description: 'Returns the list of all products from all suppliers' })
|
||||
async getAllProducts() {
|
||||
return this.focoCoffeeService.getAllProducts()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user