}
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){