示例#1
0
  @ResponseBody
  @RequestMapping(value = "/days/statlist", method = RequestMethod.GET)
  public WebResult getDaysStatList(
      @RequestParam(defaultValue = "all", value = "platform") String platform,
      @RequestParam(defaultValue = "2", value = "type") Integer type,
      @RequestParam(defaultValue = "", value = "startdate") @DateTimeFormat(pattern = "yyyy-MM-dd")
          Date startDate,
      @RequestParam(defaultValue = "", value = "enddate") @DateTimeFormat(pattern = "yyyy-MM-dd")
          Date endDate) {
    WebResult result = new WebResult();
    try {
      Calendar calendar = Calendar.getInstance(Locale.CHINA);
      calendar.setTime(endDate);
      calendar.add(Calendar.DAY_OF_YEAR, 1);
      endDate = calendar.getTime();
      List<PushStatDoc> data =
          pushStatDocMapper.getPushStatDocListByType(type, platform, startDate, endDate);
      result.setData(data);
    } catch (Exception e) {
      result.setResultCode(ResultCode.FAIL);
      logger.error(e.getMessage());
      e.printStackTrace();
    }

    return result;
  }
示例#2
0
  @ResponseBody
  @RequestMapping(value = "/{docid}/statlist", method = RequestMethod.GET)
  public WebResult getStatListByDocid(@PathVariable String docid) {
    WebResult result = new WebResult();
    try {
      List<PushStatDoc> data = pushStatDocMapper.getPushStatDoc(docid);
      result.setData(data);
    } catch (Exception e) {
      result.setResultCode(ResultCode.FAIL);
      logger.error(e.getMessage());
      e.printStackTrace();
    }

    return result;
  }