mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-12 09:29:07 +00:00
new protospack
This commit is contained in:
@@ -14,6 +14,7 @@ import { PERMISSIONS_GROUPS } from '../../authentication/permissions.enum';
|
||||
import { CatalogService } from './catalog.service';
|
||||
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
||||
import { PackTheMetadata } from 'src/utils/ PackTheMetadata';
|
||||
import { RequestUser, User } from 'src/authentication/user.decorator';
|
||||
|
||||
@ApiTags('Catalog')
|
||||
@Controller('catalog')
|
||||
@@ -120,17 +121,31 @@ export class CatalogController {
|
||||
}
|
||||
|
||||
@Get('table-metadata')
|
||||
async getAllTableMetadata(@Body() body, @Query() query) {
|
||||
async getAllTableMetadata(
|
||||
@Body() body,
|
||||
@Query() query,
|
||||
@User() user: RequestUser,
|
||||
) {
|
||||
this.logger.info(`/catalog - ON GET ALL TABLES METADATA ROUTE`, {
|
||||
user: body.info.user_id,
|
||||
customer: body.info.customer,
|
||||
user: user.user_id,
|
||||
customer: user.customer_name,
|
||||
});
|
||||
const { user_id, customer_name, customer_id } = user;
|
||||
const metadata = PackTheMetadata({
|
||||
user_id,
|
||||
customer_id,
|
||||
customer_name,
|
||||
});
|
||||
|
||||
if (!query) {
|
||||
const res = await this.catalogService.getAllTableMetadata(body);
|
||||
return res;
|
||||
} else {
|
||||
const res = await this.catalogService.getOneTableMetadata(body, query);
|
||||
const res = await this.catalogService.getOneTableMetadata(
|
||||
body,
|
||||
query,
|
||||
metadata,
|
||||
);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -333,16 +348,16 @@ export class CatalogController {
|
||||
}
|
||||
|
||||
@Post('tags')
|
||||
async createTags(@Body() body) {
|
||||
async createTags(@Body() body, @User() user: RequestUser) {
|
||||
this.logger.info(`/catalog - ON CREATE TAG ROUTE`, {
|
||||
user: body.info.user_id,
|
||||
customer: body.info.customer,
|
||||
user: user.user_id,
|
||||
customer: user.customer_name,
|
||||
});
|
||||
const { user_id, customer, customer_id } = body.info;
|
||||
const { user_id, customer_name, customer_id } = user;
|
||||
const metadata = PackTheMetadata({
|
||||
user_id,
|
||||
customer_id,
|
||||
customer_name: customer,
|
||||
customer_name,
|
||||
});
|
||||
|
||||
const res = await this.catalogService.createTags(body, metadata);
|
||||
|
||||
Reference in New Issue
Block a user