Open
Conversation
LostKali
reviewed
Dec 12, 2022
LostKali
reviewed
Dec 12, 2022
LostKali
reviewed
Dec 12, 2022
LostKali
reviewed
Dec 12, 2022
LostKali
reviewed
Dec 12, 2022
LostKali
reviewed
Dec 12, 2022
added ticket entity, ticketrecord added mapped to botservice
changed error handler to specific one
changed error handler to specific one
LostKali
reviewed
Dec 30, 2022
|
|
||
| @PostMapping | ||
| public void saveUserData(@RequestBody BuyerRecord buyerRecord) { | ||
| @PostMapping("/buyer-info-save") |
Collaborator
There was a problem hiding this comment.
do no use verbs in the path: https://restfulapi.net/resource-naming/
LostKali
reviewed
Dec 30, 2022
| @Setter | ||
| @Accessors(chain = true) | ||
| public class Buyer { | ||
| public class BuyerModel { |
Collaborator
There was a problem hiding this comment.
what is the reason to change name?
LostKali
reviewed
Dec 30, 2022
|
|
||
| public List<TicketRecordDto> getTickets(/*Long buyerId*/) { | ||
| return ticketRepository.findAll().stream().map(ticketModelTicketRecordDtoConverter::convert).toList(); | ||
| // return ticketRepository.findById(buyerId).stream().toList(); |
Collaborator
There was a problem hiding this comment.
please remove redundant comments
LostKali
reviewed
Dec 30, 2022
|
|
||
| import org.springframework.data.annotation.Id; | ||
|
|
||
| public record BuyerRecordDto(@Id Long id, String firstName, boolean isBot, String lastName, String userName) { |
Collaborator
There was a problem hiding this comment.
why do you named the class with Record suffix?
LostKali
reviewed
Dec 30, 2022
| Timestamp returnDate, Integer numberOfChanges, Long duration, Long distance) { | ||
|
|
||
| @Override | ||
| public String toString() { |
Collaborator
There was a problem hiding this comment.
Do we need special format of to string instead of the produced by the record feature?
LostKali
reviewed
Dec 30, 2022
| processAirportRequest(update); | ||
| } else if (inputMessage.startsWith(SAVE_TICKET)) { | ||
| saveTicket(update); | ||
| } else if (inputMessage.startsWith(SHOW_SAVED_TICKETS)) { |
Collaborator
There was a problem hiding this comment.
please try to use the Strategy pattern
LostKali
reviewed
Dec 30, 2022
| public void postBuyerInfo(BuyerRecordDto buyerRecordDto) { | ||
| BuyerRecordDto sendBuyerRecordDto = restTemplate.postForObject | ||
| ( | ||
| builder.setPath( |
Collaborator
There was a problem hiding this comment.
do not create path for every method call
LostKali
reviewed
Dec 30, 2022
| if (sendBuyerRecord != null) { | ||
| log.info("posted info: {}", sendBuyerRecord.id()); | ||
| public void saveBuyerChosenTicket(String sendTicketRecord) { | ||
| ObjectMapper objectMapper = new ObjectMapper(); |
Collaborator
There was a problem hiding this comment.
define as a bean and inject into the class
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tickets save search