-
Notifications
You must be signed in to change notification settings - Fork 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
Announcements #151
Announcements #151
Conversation
private String message; | ||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
private boolean scheduled; |
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.
It's a boolean, so no Enumerated annotation
private LocalDateTime sentTime = LocalDateTime.now(); | ||
private boolean automated; | ||
|
||
private transient int seenCount; |
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.
Not needed
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.
Localtime will be required I think.
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.
My comment was about seenCount
private transient boolean stopEmailPropagation; | ||
private transient boolean stopFirebasePropagation; | ||
private transient String icon = "https://zhcet-backend.firebaseapp.com/static/img/icon.png"; | ||
private transient Function<Announcement, LinkMessage> linkMessageConverter; |
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.
No transient field needed
|
||
AnnouncementUtils.prepareAnnouncements(model, announcementPage, currentPage); | ||
List<Announcement> notifications = announcementPage.getContent(); | ||
model.addAttribute("notifications", notifications); |
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.
announcements
model.addAttribute("minPage", minPage); | ||
model.addAttribute("maxPage", maxPage); | ||
model.addAttribute("currentPage", getSafePage(currentPage, totalPages)); | ||
} |
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'll reuse notification utils, so no need of recreating this class
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = false) | ||
@ToString() |
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.
Not needed
|
||
public interface AnnouncementRepository extends PagingAndSortingRepository<Announcement, Long> { | ||
public interface AnnouncementRepository extends JpaRepository<Announcement, Long> { |
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.
Revert this
|
||
Page<Announcement> findBySenderUserId(String userId, Pageable Page); | ||
Page<Announcement> findAll(String userId, Pageable pageable); |
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.
Add a new line above this
@prateekj117 Please squash your commits so I can review this easily |
5f531da
to
9e763fd
Compare
92bb43b
to
97ebf3a
Compare
25ff874
to
db4df7d
Compare
db4df7d
to
3459ac6
Compare
Add announcement entity, announcement repository, announcement management service, announcement management controller and announcement utils.
First step for #146