Skip to content

Feature/marco forage#30

Open
MarcoandreDev wants to merge 3 commits intodevelopfrom
feature/marco-forage
Open

Feature/marco forage#30
MarcoandreDev wants to merge 3 commits intodevelopfrom
feature/marco-forage

Conversation

@MarcoandreDev
Copy link
Collaborator

No description provided.

@RequestBody CultureFilter filters,
Pageable pageable
) {
Page<Culture> page = cultureService.search(filters, pageable);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esse método não poderia ser implementado diretamente no frontend?
Os controllers já possuem um endpoint search que permite consultas dinâmicas automaticamente.

A documentação e implementação está neste PR: #5

private LocalDate date;

private String forage;
private Float averageCost;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sugiro utilizar Double ao invés de Float, pois o Double oferece maior precisão e ajuda a evitar erros de arredondamento em operações de ponto flutuante.

Isso se aplica pros demais campos nessa classe.

ForageDisponibilityDto responseDto = modelMapper.map(createdForage, ForageDisponibilityDto.class);
return new ResponseEntity<>(responseDto, HttpStatus.CREATED);
} catch (Exception e) {
System.err.println("Erro na criação da Foragem: " + e.getMessage());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utilize um Logger para registrar o tratamento da exceção, substituíndo o System.err.println() e o e.printStackTrace()

forage.setPicketArea(createDto.getArea());

try {
LocalDate date = LocalDate.parse(createDto.getFormation().substring(0, 10), DateTimeFormatter.ISO_LOCAL_DATE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A conversão da data não deve ser feita manualmente.
Esse processo pode ser tratado automaticamente pelo se o campo formation for do tipo LocalDate em vez de String.

@MarcoandreDev
Copy link
Collaborator Author

Realizei as mudanças que foram Apontadas. O projeto já foi Atualizado

# Database Config
# Configurações do banco de dados
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=${DATABASE_URL:jdbc:postgresql://localhost:5432/idr}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

não commitar as alteraçoes nesse arquivo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants