コード例 #1
0
 @Override
 public List<MailTask> getMailTasksForToday() {
   String dayOfWeek = getDayAsRegex();
   return dsl.select(NEWS_SOURCES.RECIPE_FILE, USERS.KINDLE_EMAIL)
       .from(
           NEWS_SOURCES
               .join(SUBSCRIPTIONS)
               .on(SUBSCRIPTIONS.NEWS_SOURCE_ID.eq(NEWS_SOURCES.ID))
               .join(USERS)
               .on(SUBSCRIPTIONS.USER_ID.eq(USERS.ID)))
       .where(NEWS_SOURCES.CONTENT_DAYS.like(dayOfWeek))
       .fetch()
       .map(
           x ->
               new MailTask(
                   x.getValue(USERS.KINDLE_EMAIL, String.class),
                   x.getValue(NEWS_SOURCES.RECIPE_FILE, String.class)));
 }
コード例 #2
0
 @Override
 public void unsubscribe(int userId, int newsSourceId) {
   dsl.delete(SUBSCRIPTIONS)
       .where(SUBSCRIPTIONS.USER_ID.eq(userId).and(SUBSCRIPTIONS.NEWS_SOURCE_ID.eq(newsSourceId)))
       .execute();
 }