This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws_ext.delete_object_if_exists(bucketNameDest, archiveNameDest) | |
| binary = BytesIO() | |
| for page in objects.page_size(amount_objects).pages(): | |
| zip_file = aws_ext.get_object_summary(bucketNameDest, archiveNameDest) | |
| print("Upload +{} files to {}...".format(amount_objects, archiveNameDest)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| link = aws_ext.link_from_object(bucketNameDest, archiveNameDest) | |
| return function_return(True, "Bucket successfully compressed!", link) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lambda deploy | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3' | |
| services: | |
| db-postgres: | |
| image: postgres | |
| container_name: db-postgres | |
| environment: | |
| POSTGRES_PASSWORD: "postgres" | |
| ports: | |
| - "5432:5432" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "ConnectionStrings": { | |
| "DefaultConnection": "Host=localhost;Port=5432;Database=postgres;User ID=postgres;Password=postgres", | |
| "MongoConnection": "mongodb://root:root@localhost:27017" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CreateClienteCommand : IRequest<CommandReturnDto> | |
| { | |
| public string Nome { get; private set; } | |
| public string Cpf { get; private set; } | |
| public string Rua { get; private set; } | |
| public string Bairro { get; private set; } | |
| public string Cidade { get; private set; } | |
| public string Observacoes { get; private set; } | |
| public CreateClienteCommand(string nome, string cpf, string rua, string bairro, string cidade, string obs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CreateClienteCommandHandler : IRequestHandler<CreateClienteCommand, CommandReturnDto> | |
| { | |
| public CreateClienteCommandHandler(/*Repositories por injeção de dependência*/) | |
| { | |
| } | |
| public Task<CommandReturnDto> Handle(CreateClienteCommand request, CancellationToken cancellationToken) | |
| { | |
| // Insere nos bancos de dados e retorna o CommandReturnDto | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void RegisterServices(IServiceCollection services, IConfiguration configuration) | |
| { | |
| ... | |
| services.AddScoped<IRequestHandler<CreateClienteCommand, CommandReturnDto>, CreateClienteCommandHandler>(); | |
| services.AddScoped<IRequestHandler<RemoveClienteCommand, CommandReturnDto>, RemoveClienteCommandHandler>(); | |
| services.AddScoped<IRequestHandler<UpdateClienteCommand, CommandReturnDto>, UpdateClienteCommandHandler>(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ClienteServices : IClienteServices | |
| { | |
| private readonly IMediator _mediator; | |
| private readonly IMapper _mapper; | |
| private readonly IClienteForQueryRepository _clienteForQueryRepository; | |
| public ClienteServices(IMediator mediator, | |
| IMapper mapper, | |
| IClienteForQueryRepository clienteForQueryRepository) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from urllib.request import Request, urlopen | |
| from bs4 import BeautifulSoup | |
| URL_STOCKS_LIST = 'https://www.infomoney.com.br/cotacoes/empresas-b3/' | |
| HEADER_BASE = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'} | |
| class Scraping: | |
| ... | |
| def set_urls(self, list): |