Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- public class Image {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name = "ID")
- private Long id;
- @Column(name = "CAPTION")
- private String caption;
- @Column(name = "IMAGE_PATH")
- private String imagePath;
- @Column(name = "IMAGE_NAME")
- private String imageName;
- @Column(name = "NUMBER_OF_VIEW")
- private Integer numberOfView;
- @Column(name = "PUBLISH_TIME")
- private Date publishDate;
- @Scheduled(cron = "*/5 * * * * ?")
- public void sendNotification() {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm");
- Date currentDate = new Date();
- List<ImageInfo> listImageInfo = imageInfoDao.getImageOfParticularDate(currentDate);
- if (listImageInfo.size() > 0) {
- List<User> listUser = userDao.getAppUser(ACTIVE);
- for (ImageInfo imageInfo : listImageInfo) {
- for (User user : listUser) {
- pushNotification(user.getRegId(), pushGroupNumNotification(imageInfo.getGroupNum()));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement