mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-26 02:47:55 +00:00
added product controller
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export * from './product.controller';
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth, ApiOperation } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
|
||||
import { EnableDisableStatusEnum } from '@app/common/constants/days.enum';
|
||||
import { BaseResponseDto } from '@app/common/dto/base.response.dto';
|
||||
import { ControllerRoute } from '@app/common/constants/controller-route';
|
||||
import { ProductService } from '../services';
|
||||
|
||||
@ApiTags('Product Module')
|
||||
@Controller({
|
||||
version: EnableDisableStatusEnum.ENABLED,
|
||||
path: ControllerRoute.PRODUCT.ROUTE,
|
||||
})
|
||||
export class ProductController {
|
||||
constructor(private readonly productService: ProductService) {}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
@ApiOperation({
|
||||
summary: ControllerRoute.PRODUCT.ACTIONS.LIST_PRODUCT_SUMMARY,
|
||||
description: ControllerRoute.PRODUCT.ACTIONS.LIST_PRODUCT_DESCRIPTION,
|
||||
})
|
||||
async getProducts(): Promise<BaseResponseDto> {
|
||||
return await this.productService.list();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user