Rev 3339 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/****/package in.shop2020.crm.handler;import in.shop2020.crm.domain.Activity;import in.shop2020.crm.persistence.ActivityMapper;import java.util.List;import org.apache.thrift.TException;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;/*** Handler for CRUD operations done on activities in CRM.** @author mandeep*/@Servicepublic class ActivityHandler {@AutowiredActivityMapper activityMapper;/*** Retrieves all the activities for a customer.** @param customerId* @return* @throws TException*/public List<Activity> getActivities(Long customerId) {return activityMapper.getActivities(customerId);}public void insertActivity(Activity activity) {activityMapper.insertActivity(activity);}public Activity getActivity(long activityId) {return activityMapper.getActivity(activityId);}/*** Returns the latest activity done on a given ticket id** @param ticketId* @return* @throws TException*/public Activity getLastActivity(long ticketId) {return activityMapper.getLastActivity(ticketId);}/*** Gets all activities done on a ticket** @param ticketId* @return* @throws TException*/public List<Activity> getActivitiesForTicket(long ticketId) {return activityMapper.getActivitiesForTicket(ticketId);}}