Пример #1
0
  /** Get Spa by Id */
  @Transactional
  public AppResponse<Spa> getSpaById(Integer id) {
    Spa spa = null;
    AppResponse<Spa> appResponse = new AppResponse<Spa>();
    appResponse.setCode(EventStatus.failure.getValue());
    try {
      spa = (Spa) spaDao.readById(id);
      // TODO: increase the editprofile page access count for this accoutant.
      // I am assuming this call has come from the editprofile page.
      // This is completely wrong. But I still am doing this because giving something to the
      // customers is more
      // important to me than getting it 100% right! For the sake of time.
      spa.setNoOfVisitToEditProfilepage(spa.getNoOfVisitToEditProfilepage() + 1);
      // Set the section fill information
      ProfileCompletionStatus profileCompletionStatus = new ProfileCompletionStatus(spa);
      spa.setProfileCompletionStatus(profileCompletionStatus);

      appResponse.setCode(EventStatus.success.getValue());
      appResponse.setData(spa);
      spaDao.update(spa);
    } catch (CommonException e) {
      e.printStackTrace();
      appResponse.setDescription(MessageCollection.ERROR_ENGINEERS_WILL_FIX_IT);
    }

    return appResponse;
  }