mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-28 18:50:06 +00:00
Compare commits
3
Commits
v1.4.3-alpha.2
...
v1.4.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
849b979e63 | ||
|
|
28580782b1 | ||
|
|
c997e91912 |
@@ -1,4 +1,12 @@
|
|||||||
import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
|
import {
|
||||||
|
Body,
|
||||||
|
Controller,
|
||||||
|
Delete,
|
||||||
|
Get,
|
||||||
|
Param,
|
||||||
|
Post,
|
||||||
|
Query,
|
||||||
|
} from '@nestjs/common';
|
||||||
import { CatalogService } from './catalog.service';
|
import { CatalogService } from './catalog.service';
|
||||||
|
|
||||||
@Controller('catalog')
|
@Controller('catalog')
|
||||||
@@ -62,14 +70,17 @@ export class CatalogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('table-metadata')
|
@Get('table-metadata')
|
||||||
async getAllTableMetadata(@Body() body) {
|
async getAllTableMetadata(@Body() body, @Query() query) {
|
||||||
console.log(`/catalog`, 'ON GET ALL TABLES METADATA ROUTE');
|
console.log(`/catalog`, 'ON GET ALL TABLES METADATA ROUTE');
|
||||||
|
|
||||||
const catalogService = new CatalogService();
|
const catalogService = new CatalogService();
|
||||||
|
if (!query) {
|
||||||
const res = await catalogService.getAllTableMetadata(body);
|
const res = await catalogService.getAllTableMetadata(body);
|
||||||
|
return res;
|
||||||
return res;
|
} else {
|
||||||
|
const res = await catalogService.getOneTableMetadata(body, query);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete('table-metadata/:id')
|
@Delete('table-metadata/:id')
|
||||||
@@ -162,6 +173,17 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('data-rating')
|
||||||
|
async createDataRating(@Body() body) {
|
||||||
|
console.log(`/catalog`, 'ON GET DATA RATING ROUTE');
|
||||||
|
|
||||||
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
|
const res = await catalogService.createDataRating(body);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Get('summary-rating/:id')
|
@Get('summary-rating/:id')
|
||||||
async getSummaryRating(@Param() params, @Body() body) {
|
async getSummaryRating(@Param() params, @Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
console.log(`/catalog`, 'ON GET SUMMARY RATING ROUTE');
|
||||||
@@ -185,6 +207,17 @@ export class CatalogController {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('data-comment')
|
||||||
|
async createDataComment(@Body() body) {
|
||||||
|
console.log(`/catalog`, 'ON GET DATA COMMENT ROUTE');
|
||||||
|
|
||||||
|
const catalogService = new CatalogService();
|
||||||
|
|
||||||
|
const res = await catalogService.createDataComment(body);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Get('data-review')
|
@Get('data-review')
|
||||||
async getDataReview(@Body() body) {
|
async getDataReview(@Body() body) {
|
||||||
console.log(`/catalog`, 'ON GET DATA REVIEW ROUTE');
|
console.log(`/catalog`, 'ON GET DATA REVIEW ROUTE');
|
||||||
|
|||||||
@@ -75,6 +75,19 @@ class CatalogService {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getOneTableMetadata(body, params) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const { data } = await axios.get(
|
||||||
|
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/table-metadata/`,
|
||||||
|
{ params: params },
|
||||||
|
);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
async deleteOneTableMetadata(id, body) {
|
async deleteOneTableMetadata(id, body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
@@ -171,6 +184,19 @@ class CatalogService {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async createDataRating(body) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const { data } = await axios.post(
|
||||||
|
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-rating/`,
|
||||||
|
body,
|
||||||
|
);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
async getSummaryRating(id, body) {
|
async getSummaryRating(id, body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
@@ -194,6 +220,19 @@ class CatalogService {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async createDataComment(body) {
|
||||||
|
const customer =
|
||||||
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
? ``
|
||||||
|
: `-${body.info.customer.toLowerCase()}`;
|
||||||
|
|
||||||
|
const { data } = await axios.post(
|
||||||
|
`${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera/api/catalog/data-comment/`,
|
||||||
|
body,
|
||||||
|
);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
async getDataReview(body) {
|
async getDataReview(body) {
|
||||||
const customer =
|
const customer =
|
||||||
body.info.customer.toLowerCase() === 'dadosfera'
|
body.info.customer.toLowerCase() === 'dadosfera'
|
||||||
|
|||||||
Reference in New Issue
Block a user