Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. @Entity
  2. public class Image {
  3.  
  4. @Id
  5. @GeneratedValue(strategy = GenerationType.AUTO)
  6. @Column(name = "ID")
  7. private Long id;
  8.  
  9. @Column(name = "CAPTION")
  10. private String caption;
  11.  
  12. @Column(name = "IMAGE_PATH")
  13. private String imagePath;
  14.  
  15. @Column(name = "IMAGE_NAME")
  16. private String imageName;
  17.  
  18. @Column(name = "NUMBER_OF_VIEW")
  19. private Integer numberOfView;
  20.  
  21. @Column(name = "PUBLISH_TIME")
  22. private Date publishDate;
  23.  
  24. @Scheduled(cron = "*/5 * * * * ?")
  25. public void sendNotification() {
  26. SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm");
  27. Date currentDate = new Date();
  28.  
  29. List<ImageInfo> listImageInfo = imageInfoDao.getImageOfParticularDate(currentDate);
  30. if (listImageInfo.size() > 0) {
  31.  
  32. List<User> listUser = userDao.getAppUser(ACTIVE);
  33. for (ImageInfo imageInfo : listImageInfo) {
  34. for (User user : listUser) {
  35. pushNotification(user.getRegId(), pushGroupNumNotification(imageInfo.getGroupNum()));
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement