@Test public void testGetWeeklyRetainInfo() throws Exception { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); Date now = new Date(); Date lastSunday = calendar.getTime(); if (DateUtils.isSameDay(lastSunday, now)) { lastSunday = DateUtils.addDays(lastSunday, -7); } Date lastMonday = DateUtils.addDays(lastSunday, -6); final WxMaAnalysisService service = wxMaService.getAnalysisService(); WxMaRetainInfo retainInfo = service.getWeeklyRetainInfo(lastMonday, lastSunday); assertNotNull(retainInfo); System.out.println(retainInfo); }
@Override public WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate) throws WxErrorException { return getRetainInfo(beginDate, endDate, GET_WEEKLY_RETAIN_INFO_URL); }
WxMaAnalysisServiceImpl implements WxMaAnalysisService { @Override public WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate) throws WxErrorException { return getRetainInfo(beginDate, endDate, GET_WEEKLY_RETAIN_INFO_URL); } }
WxMaAnalysisServiceImpl implements WxMaAnalysisService { @Override public WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate) throws WxErrorException { return getRetainInfo(beginDate, endDate, GET_WEEKLY_RETAIN_INFO_URL); } WxMaAnalysisServiceImpl(WxMaService wxMaService); }
WxMaAnalysisServiceImpl implements WxMaAnalysisService { @Override public WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate) throws WxErrorException { return getRetainInfo(beginDate, endDate, GET_WEEKLY_RETAIN_INFO_URL); } WxMaAnalysisServiceImpl(WxMaService wxMaService); @Override List<WxMaSummaryTrend> getDailySummaryTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getDailyVisitTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getWeeklyVisitTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getMonthlyVisitTrend(Date beginDate, Date endDate); @Override WxMaVisitDistribution getVisitDistribution(Date beginDate, Date endDate); @Override WxMaRetainInfo getDailyRetainInfo(Date beginDate, Date endDate); @Override WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate); @Override WxMaRetainInfo getMonthlyRetainInfo(Date beginDate, Date endDate); @Override List<WxMaVisitPage> getVisitPage(Date beginDate, Date endDate); @Override WxMaUserPortrait getUserPortrait(Date beginDate, Date endDate); }
WxMaAnalysisServiceImpl implements WxMaAnalysisService { @Override public WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate) throws WxErrorException { return getRetainInfo(beginDate, endDate, GET_WEEKLY_RETAIN_INFO_URL); } WxMaAnalysisServiceImpl(WxMaService wxMaService); @Override List<WxMaSummaryTrend> getDailySummaryTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getDailyVisitTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getWeeklyVisitTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getMonthlyVisitTrend(Date beginDate, Date endDate); @Override WxMaVisitDistribution getVisitDistribution(Date beginDate, Date endDate); @Override WxMaRetainInfo getDailyRetainInfo(Date beginDate, Date endDate); @Override WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate); @Override WxMaRetainInfo getMonthlyRetainInfo(Date beginDate, Date endDate); @Override List<WxMaVisitPage> getVisitPage(Date beginDate, Date endDate); @Override WxMaUserPortrait getUserPortrait(Date beginDate, Date endDate);  }