mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-12 07:19:08 +00:00
FEAT: network config module using in-factory
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Inject,
|
||||
Param,
|
||||
@@ -14,6 +15,7 @@ import { RequestUser, User } from 'src/authentication/user.decorator';
|
||||
import {
|
||||
CreateNetworkConfigReq,
|
||||
CreateNetworkConfigRes,
|
||||
DeleteNetworkConfigRes,
|
||||
FindAllNetworkConfigsRes,
|
||||
UpdateNetworkConfigReq,
|
||||
UpdateNetworkConfigRes,
|
||||
@@ -39,6 +41,19 @@ export class NetworkConfigController {
|
||||
return this.networkConfigService.findAllNetworkConfigs(user.customer_name);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOkResponse({ type: FindAllNetworkConfigsRes })
|
||||
async findNetworkConfigById(
|
||||
@User() user: RequestUser,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
this.logger.info('GET /network-config/:id', {
|
||||
user: user.user_id,
|
||||
customer: user.customer_name,
|
||||
});
|
||||
return this.networkConfigService.findNetworkConfigById(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@ApiOkResponse({ type: CreateNetworkConfigRes })
|
||||
async createNetworkConfigs(
|
||||
@@ -62,7 +77,7 @@ export class NetworkConfigController {
|
||||
@Param('id') network_config_id: string,
|
||||
@Body() body: UpdateNetworkConfigReq,
|
||||
) {
|
||||
this.logger.info('POST /network-config', {
|
||||
this.logger.info('PATCH /network-config/:id', {
|
||||
user: user.user_id,
|
||||
customer: user.customer_name,
|
||||
});
|
||||
@@ -72,16 +87,16 @@ export class NetworkConfigController {
|
||||
);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOkResponse({ type: FindAllNetworkConfigsRes })
|
||||
async findNetworkConfigById(
|
||||
@Delete(':id')
|
||||
@ApiOkResponse({ type: DeleteNetworkConfigRes })
|
||||
async deleteNetworkConfig(
|
||||
@User() user: RequestUser,
|
||||
@Param('id') id: string,
|
||||
@Param('id') network_config_id: string,
|
||||
) {
|
||||
this.logger.info('GET /network-config', {
|
||||
this.logger.info('DELETE /network-config', {
|
||||
user: user.user_id,
|
||||
customer: user.customer_name,
|
||||
});
|
||||
return this.networkConfigService.findNetworkConfigById(id);
|
||||
return this.networkConfigService.deleteNetworkConfig(network_config_id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user