Package net.baguajie.domains

Examples of net.baguajie.domains.TrackShip


    }
    Spot target = spotRepository.findOne(targetId);
    if(target==null){
      throw new RuntimeException("Invalid spot id : " + targetId);
    }
    TrackShip ts = trackShipRepository.getByTargetAndTracked(targetId, signInUser.getId());
    boolean tracked = false;
    if(ts!=null && ts.getStatus() == ApplicationConstants.TRACKSHIP_DISABLED){
      tracked = true;
      ts.setStatus(ApplicationConstants.TRACKSHIP_NORMAL);
      ts.setUpdatedAt(new Date());
      userRepository.inc(signInUser.getId(), "trackCount", 1);
      spotRepository.inc(target.getId(), "trackedCount", 1);
      trackShipRepository.save(ts);
    }else if(ts==null){
      tracked = true;
      ts = new TrackShip();
      ts.setCreatedAt(new Date());
      ts.setUpdatedAt(ts.getCreatedAt());
      ts.setTarget(target);
      ts.setTracked(signInUser);
      ts.setStatus(ApplicationConstants.FOLLOWSHIP_NORMAL);
      userRepository.inc(signInUser.getId(), "trackCount", 1);
      spotRepository.inc(target.getId(), "trackedCount", 1);
      trackShipRepository.save(ts);
    }
    if(tracked){
View Full Code Here


    }
    Spot target = spotRepository.findOne(targetId);
    if(target==null){
      throw new RuntimeException("Invalid spot id : " + targetId);
    }
    TrackShip ts = trackShipRepository.getByTargetAndTracked(targetId, signInUser.getId());
    if(ts!=null && ts.getStatus() == ApplicationConstants.TRACKSHIP_NORMAL){
      ts.setStatus(ApplicationConstants.TRACKSHIP_DISABLED);
      ts.setUpdatedAt(new Date());
      userRepository.inc(signInUser.getId(), "trackCount", -1);
      spotRepository.inc(target.getId(), "trackedCount", -1);
      trackShipRepository.save(ts);
    }
    return new AjaxResult(AjaxResultCode.SUCCESS);
View Full Code Here

TOP

Related Classes of net.baguajie.domains.TrackShip

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.