Skip to content

Commit

Permalink
feat: init DtoOperationSaveFile
Browse files Browse the repository at this point in the history
  • Loading branch information
guesant committed Mar 30, 2024
1 parent 6faeb11 commit a97a9ef
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 188 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile, UseInterceptors } from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Paginate, PaginateQuery } from 'nestjs-paginate';
import * as Dto from '../../(spec)';
import { IContextoDeAcesso } from '../../../../domain';
Expand All @@ -16,6 +15,7 @@ import {
HttpDtoParam,
getSearchInputFromPaginateQuery,
} from '../../../../infrastructure';
import { DtoOperationSaveFile } from '../../../../infrastructure/api-documentate/DtoOperation';
import { AmbienteService } from './ambiente.service';
import { AmbienteOperations } from './dtos/ambiente.operations';

Expand Down Expand Up @@ -84,28 +84,7 @@ export class AmbienteController {
}

@Put('/:id/imagem/capa')
@ApiConsumes('multipart/form-data')
@ApiBody({
schema: {
type: 'object',
required: ['file'],
properties: {
file: {
type: 'string',
format: 'binary',
nullable: false,
},
},
},
})
@UseInterceptors(
FileInterceptor('file', {
limits: {
files: 1,
fileSize: 10 * 1024 * 1024,
},
}),
)
@DtoOperationSaveFile()
async blocoImagemCapaSave(
//
@ContextoDeAcessoHttp() contextoDeAcesso: IContextoDeAcesso,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile, UseInterceptors } from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Paginate, PaginateQuery } from 'nestjs-paginate';
import * as Dto from '../../(spec)';
import { IContextoDeAcesso } from '../../../../domain';
Expand All @@ -11,6 +10,7 @@ import {
DtoOperationFindAll,
DtoOperationFindOne,
DtoOperationGetFile,
DtoOperationSaveFile,
DtoOperationUpdate,
HttpDtoBody,
HttpDtoParam,
Expand Down Expand Up @@ -84,28 +84,7 @@ export class BlocoController {
}

@Put('/:id/imagem/capa')
@ApiConsumes('multipart/form-data')
@ApiBody({
schema: {
type: 'object',
required: ['file'],
properties: {
file: {
type: 'string',
format: 'binary',
nullable: false,
},
},
},
})
@UseInterceptors(
FileInterceptor('file', {
limits: {
files: 1,
fileSize: 10 * 1024 * 1024,
},
}),
)
@DtoOperationSaveFile()
async blocoImagemCapaSave(
//
@ContextoDeAcessoHttp() contextoDeAcesso: IContextoDeAcesso,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile, UseInterceptors } from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import * as Dto from '../../(spec)';
import { IContextoDeAcesso } from '../../../../domain';
import {
Expand All @@ -10,6 +9,7 @@ import {
DtoOperationFindAll,
DtoOperationFindOne,
DtoOperationGetFile,
DtoOperationSaveFile,
DtoOperationUpdate,
HttpDtoBody,
HttpDtoParam,
Expand Down Expand Up @@ -82,28 +82,7 @@ export class UsuarioController {
}

@Put('/:id/imagem/capa')
@ApiConsumes('multipart/form-data')
@ApiBody({
schema: {
type: 'object',
required: ['file'],
properties: {
file: {
type: 'string',
format: 'binary',
nullable: false,
},
},
},
})
@UseInterceptors(
FileInterceptor('file', {
limits: {
files: 1,
fileSize: 10 * 1024 * 1024,
},
}),
)
@DtoOperationSaveFile()
async usuarioImagemCapaSave(
//
@ContextoDeAcessoHttp() contextoDeAcesso: IContextoDeAcesso,
Expand All @@ -126,28 +105,7 @@ export class UsuarioController {
}

@Put('/:id/imagem/perfil')
@ApiConsumes('multipart/form-data')
@ApiBody({
schema: {
type: 'object',
required: ['file'],
properties: {
file: {
type: 'string',
format: 'binary',
nullable: false,
},
},
},
})
@UseInterceptors(
FileInterceptor('file', {
limits: {
files: 1,
fileSize: 10 * 1024 * 1024,
},
}),
)
@DtoOperationSaveFile()
async usuarioImagemPerfilSave(
//
@ContextoDeAcessoHttp() contextoDeAcesso: IContextoDeAcesso,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile, UseInterceptors } from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Paginate, PaginateQuery } from 'nestjs-paginate';
import * as Dto from '../../(spec)';
import { IContextoDeAcesso } from '../../../../domain';
Expand All @@ -11,6 +10,7 @@ import {
DtoOperationFindAll,
DtoOperationFindOne,
DtoOperationGetFile,
DtoOperationSaveFile,
DtoOperationUpdate,
HttpDtoBody,
HttpDtoParam,
Expand Down Expand Up @@ -84,28 +84,7 @@ export class CursoController {
}

@Put('/:id/imagem/capa')
@ApiConsumes('multipart/form-data')
@ApiBody({
schema: {
type: 'object',
required: ['file'],
properties: {
file: {
type: 'string',
format: 'binary',
nullable: false,
},
},
},
})
@UseInterceptors(
FileInterceptor('file', {
limits: {
files: 1,
fileSize: 10 * 1024 * 1024,
},
}),
)
@DtoOperationSaveFile()
async cursoImagemCapaSave(
//
@ContextoDeAcessoHttp() contextoDeAcesso: IContextoDeAcesso,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile, UseInterceptors } from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Paginate, PaginateQuery } from 'nestjs-paginate';
import * as Dto from '../../(spec)';
import { IContextoDeAcesso } from '../../../../domain';
Expand All @@ -11,6 +10,7 @@ import {
DtoOperationFindAll,
DtoOperationFindOne,
DtoOperationGetFile,
DtoOperationSaveFile,
DtoOperationUpdate,
HttpDtoBody,
HttpDtoParam,
Expand Down Expand Up @@ -84,28 +84,7 @@ export class DisciplinaController {
}

@Put('/:id/imagem/capa')
@ApiConsumes('multipart/form-data')
@ApiBody({
schema: {
type: 'object',
required: ['file'],
properties: {
file: {
type: 'string',
format: 'binary',
nullable: false,
},
},
},
})
@UseInterceptors(
FileInterceptor('file', {
limits: {
files: 1,
fileSize: 10 * 1024 * 1024,
},
}),
)
@DtoOperationSaveFile()
async disciplinaImagemCapaSave(
//
@ContextoDeAcessoHttp() contextoDeAcesso: IContextoDeAcesso,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile, UseInterceptors } from '@nestjs/common';
import { FileInterceptor } from '@nestjs/platform-express';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Paginate, PaginateQuery } from 'nestjs-paginate';
import * as Dto from '../../(spec)';
import { IContextoDeAcesso } from '../../../../domain';
Expand All @@ -11,6 +10,7 @@ import {
DtoOperationFindAll,
DtoOperationFindOne,
DtoOperationGetFile,
DtoOperationSaveFile,
DtoOperationUpdate,
HttpDtoBody,
HttpDtoParam,
Expand Down Expand Up @@ -84,28 +84,7 @@ export class TurmaController {
}

@Put('/:id/imagem/capa')
@ApiConsumes('multipart/form-data')
@ApiBody({
schema: {
type: 'object',
required: ['file'],
properties: {
file: {
type: 'string',
format: 'binary',
nullable: false,
},
},
},
})
@UseInterceptors(
FileInterceptor('file', {
limits: {
files: 1,
fileSize: 10 * 1024 * 1024,
},
}),
)
@DtoOperationSaveFile()
async turmaImagemCapaSave(
//
@ContextoDeAcessoHttp() contextoDeAcesso: IContextoDeAcesso,
Expand Down
Loading

0 comments on commit a97a9ef

Please sign in to comment.