Conversation
yspotts
reviewed
Jul 19, 2021
| book.setStoreID(storeID); | ||
| book.setStore(store); | ||
| EntityModel<Book> entityModel = assembler.toModel(repository.save(book)); | ||
| logger.info("Book has been added"); |
Collaborator
There was a problem hiding this comment.
I think it would be nice to include information about the book, using variable substitution like here: http://www.slf4j.org/api/org/slf4j/Logger.html
yspotts
reviewed
Jul 19, 2021
| Book newBook = new Book(element.getAsJsonObject()); | ||
| entityList.add(assembler.toModel(newBook)); | ||
| } | ||
| logger.info("Batch request successfully executed by " + leader.getLeader()); |
Collaborator
There was a problem hiding this comment.
one again, lets use variable substitution
yspotts
reviewed
Jul 19, 2021
|
|
||
| this.leader.setLeader(getLeader()); | ||
|
|
||
| logger.info("Server initialized B-)"); |
Owner
Author
There was a problem hiding this comment.
B-) is a sunglasses wearing emoticon
yspotts
reviewed
Jul 19, 2021
| json.addProperty("id", this.id); | ||
| json.addProperty("address", this.url + "/bookstores/" + this.id); | ||
| createPutConnection(hubUrl, json); | ||
| logger.info("Server connected to network"); |
Collaborator
There was a problem hiding this comment.
again, here it would be good to add some context - id, address
yspotts
reviewed
Jul 19, 2021
|
|
||
| private Long getLeader() throws Exception { | ||
| HttpResponse<String> response = createGetConnection(hubUrl + "/leader", this.url, id); | ||
| logger.info("Leader found. Mission Accomplished"); |
yspotts
reviewed
Jul 19, 2021
| entModelList.add(getAndParseBookStore(this.map.get(storeId))); | ||
| }catch(Exception e){ | ||
| continue; | ||
| }catch(Exception ignored){ |
Collaborator
There was a problem hiding this comment.
this would be a good place for a log message
yspotts
reviewed
Jul 19, 2021
| return ResponseEntity.status(HttpStatus.NO_CONTENT).build(); | ||
| }catch (BookStoreNotFoundException e){ | ||
| if(this.map.containsKey(storeID)){ | ||
| logger.info("Corporate sabotage is Assur, except in a Karpeif against Ben & Jerry's"); |
yspotts
reviewed
Jul 19, 2021
| @SpringBootApplication | ||
| public class DatastoreApplication { | ||
|
|
||
| private static final Logger LOGGER= LoggerFactory.getLogger(DatastoreApplication.class); |
Collaborator
There was a problem hiding this comment.
if we arent gonna use it, I dont think there is any purpose
Collaborator
|
Haha! Love the schtick. A few comments for improvements:
|
yspotts
approved these changes
Jul 20, 2021
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.
No description provided.