Skip to content
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

Merged

Conversation

prateekj117
Copy link
Member

@prateekj117 prateekj117 commented Jul 26, 2018

Add announcement entity, announcement repository, announcement management service, announcement management controller and announcement utils.

First step for #146

private String message;
@NotNull
@Enumerated(EnumType.STRING)
private boolean scheduled;
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

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

Not needed

Copy link
Member Author

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.

Copy link
Member

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;
Copy link
Member

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);
Copy link
Member

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));
}
Copy link
Member

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()
Copy link
Member

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> {
Copy link
Member

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);
Copy link
Member

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

@iamareebjamal
Copy link
Member

@prateekj117 Please squash your commits so I can review this easily

@iamareebjamal iamareebjamal changed the base branch from master to feature/announcements September 3, 2018 06:59
@iamareebjamal iamareebjamal merged commit 2e83448 into zhcet-amu:feature/announcements Sep 3, 2018
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