import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common'; import { CatalogService } from './catalog.service'; @Controller('catalog') export class CatalogController { constructor(private catalogService: CatalogService) {} @Get('all') async catalogAll(@Body() body) { console.log(`/catalog`, 'ON CATALOG ALL ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.catalogAll(body); return res; } @Get('data_apps') async dataAppsAll(@Body() body) { console.log(`/catalog`, 'ON FIND ALL DATA APPS ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.dataAppsAll(body); return res; } @Delete('data_apps/:id') async dataAppsOne(@Param() params, @Body() body) { console.log(`/catalog`, 'ON FIND ONE DATA APP ROUTE'); const { id } = params; const catalogService = new CatalogService(); const res = await catalogService.dataAppsOne(body, id); return res; } @Get('dashboard-metabase') async getAllDashboardMetabase(@Body() body) { console.log(`/catalog`, 'ON GET ALL DASHBOARDS METABASE ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getAllDashboardMetabase(body); return res; } @Get('dashboard-metabase/:id') async getOneDashboardMetabase(@Body() body, @Param() params) { const { id } = params; console.log(`/catalog`, 'ON GET ONE DASHBOARD METABASE ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getOneDashboardMetabase(body, id); return res; } @Get('table-metadata') async getAllTableMetadata(@Body() body) { console.log(`/catalog`, 'ON GET ALL TABLES METADATA ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getAllTableMetadata(body); return res; } @Delete('table-metadata') async deleteOneTableMetadata(@Param() params, @Body() body) { const { id } = params; console.log(`/catalog`, 'ON DELETE ONE TABLE METADATA ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.deleteOneTableMetadata(body, id); return res; } @Get('column-metadata') async getOneColumnMetadata(@Body() body) { console.log(`/catalog`, 'ON GET ONE COLUMN METADATA ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getOneColumnMetadata(body); return res; } @Delete('column-metadata') async deleteOneColumnMetadata(@Param() params, @Body() body) { console.log(`/catalog`, 'ON DELETE ONE COLUMN METADATA ROUTE'); const { id } = params; const catalogService = new CatalogService(); const res = await catalogService.deleteOneColumnMetadata(body, id); return res; } @Get('data-preview') async getOneDataPreview(@Body() body) { console.log(`/catalog`, 'ON GET ONE DATAPREVIEW ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getOneDataPreview(body); return res; } @Get('data-status') async getDataStatus(@Body() body) { console.log(`/catalog`, 'ON GET DATA STATUS ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getDataStatus(body); return res; } @Get('data-description') async getDataDescription(@Body() body) { console.log(`/catalog`, 'ON GET DATA DESCRIPTION ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getDataDescription(body); return res; } @Get('data-docs') async getDataDocs(@Body() body) { console.log(`/catalog`, 'ON GET DATA DOCS ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getDataDocs(body); return res; } @Get('data-rating') async getDataRating(@Body() body) { console.log(`/catalog`, 'ON GET DATA RATING ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getDataRating(body); return res; } @Get('summary-rating/:id') async getSummaryRating(@Param() params, @Body() body) { console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE'); const { id } = params; const catalogService = new CatalogService(); const res = await catalogService.getSummaryRating(id, body); return res; } @Get('data-comment') async getDataComment(@Body() body) { console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getDataComment(body); return res; } @Get('data-review') async getDataReview(@Body() body) { console.log(`/catalog`, 'ON GET DATA REVIEW ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getDataReview(body); return res; } @Post('tags') async createTags(@Body() body) { console.log(`/catalog`, 'ON CREATE TAG ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.createTags(body); return res; } @Get('tags') async findAllTags(@Body() body) { console.log(`/catalog`, 'ON FIND ALL TAGS ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.findAllTags(body); return res; } @Delete('tags/:id') async deleteTags(@Param() params, @Body() body) { console.log(`/catalog`, 'ON DELETE TAG ROUTE'); const { id } = params; const catalogService = new CatalogService(); const res = await catalogService.deleteTags(body, id); return res; } @Post('table-tags') async createTableTags(@Body() body) { console.log(`/catalog`, 'ON CREATE TABLE TAG ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.createTableTags(body); return res; } @Get('table-tags') async getAllTableTags(@Body() body) { console.log(`/catalog`, 'ON GET ALL TABLE TAGS ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.findAllTableTags(body); return res; } @Delete('table-tags') async deleteTableTags(@Param() params, @Body() body) { console.log(`/catalog`, 'ON CREATE TABLE TAGS ROUTE'); const { id } = params; const catalogService = new CatalogService(); const res = await catalogService.deleteTableTags(body, id); return res; } @Get('table-rules') async getTableRules(@Body() body) { console.log(`/catalog`, 'ON GET TABLE RULES ROUTE'); const catalogService = new CatalogService(); const res = await catalogService.getTableRules(body); return res; } @Delete('table-rules') async deleteTableRules(@Param() params, @Body() body) { console.log(`/catalog`, 'ON DELETE TABLE RULES ROUTE'); const { id } = params; const catalogService = new CatalogService(); const res = await catalogService.deleteTableRules(body, id); return res; } }