import 'reflect-metadata' ; import { Get , JsonController , Res , QueryParam } from 'routing-controllers' ; import { ManufacturerService } from '../../services/ManufacturerService' ; @ JsonController ( '/manufacturers' ) export class ManufacturerController { constructor ( private manufacturerService ) { } api apiGroup apiParam apiParam apiParam apiParam apiSuccessExample apiSampleRequest apiErrorExample @ Get ( '/manufacturerlist' ) public async manufacturerList ( @ QueryParam ( 'limit' ) limit , @ QueryParam ( 'offset' ) offset , @ QueryParam ( 'keyword' ) keyword , @ QueryParam ( 'count' ) count , @ Res ( ) response ) { const select = [ 'manufacturerId' , 'name' , 'image' , 'imagePath' , 'sortOrder' , 'isActive' ] ; const search = [ { name : 'name' , op : 'like' , value : keyword , } , { name : 'isActive' , op : 'where' , value : 1 , } , ] ; const WhereConditions = [ ] ; const manufacturerList = await this . manufacturerService . list ( limit , offset , select , search , WhereConditions , count ) ; const successResponse = { status : 1 , message : 'Successfully get all manufacturer List' , data : manufacturerList , } ; return response . status ( 200 ) . send ( successResponse ) ; } }