コード例 #1
0
 private DisplayableAccountOccupationEntryVo getAccountStats(User user) throws BusinessException {
   Long userAvailableQuota = documentEntryService.getAvailableSize(user);
   Long userTotalQuota = documentEntryService.getTotalSize(user);
   Long userUsedSize = 0L;
   for (Entry entry : user.getEntries()) {
     if (entry.getEntryType().equals(EntryType.DOCUMENT)) {
       userUsedSize += ((DocumentEntry) entry).getSize();
     }
   }
   DisplayableAccountOccupationEntryVo accountOccupation =
       new DisplayableAccountOccupationEntryVo(
           user.getFirstName(),
           user.getLastName(),
           user.getMail(),
           user.getAccountType(),
           userAvailableQuota,
           userTotalQuota,
           userUsedSize);
   return accountOccupation;
 }
コード例 #2
0
 @Override
 public Long getUserTotalQuota(UserVo userVo) throws BusinessException {
   Account account = accountService.findByLsUuid(userVo.getLsUuid());
   return documentEntryService.getTotalSize(account);
 }