-
Notifications
You must be signed in to change notification settings - Fork 0
Product reviews branch #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
adrianbucur83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the controller and views
| <artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
| <version>3.2.4</version> | ||
| </dependency> | ||
| <dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have this in the project
| <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa --> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-data-jpa</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have this
| private LocalDateTime date; | ||
| private String userName; | ||
|
|
||
| public Review() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use lomboks' @DaTa
|
|
||
| @Data | ||
| public class ReviewDto { | ||
| private String reviewMsg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these fields should be validated (maybe @NotNull or minimum size?)
| import java.time.LocalDateTime; | ||
|
|
||
| @Data | ||
| public class ReviewUpdateDto { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validation
| language=not set | ||
| numbers.separator=n | ||
|
|
||
| logging.level.root=info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't commit this file :) git rm --cached
| public interface ReviewsRepository extends JpaRepository<Review, Integer> { | ||
| List<Review> getAllByUser(String userName); | ||
|
|
||
| void deleteAllByUser(String userName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteAllByUser_name or something similar will work but you need to have the OneToOne/ OneToMany relation set up correctly
| private LocalDate date; | ||
|
|
||
| private LocalDateTime date; | ||
| private String userName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a User entrity and a relation like ManyToOne
reviews repository and Dto files created