@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager ;
import org.springframework.cache.annotation.CacheConfig ;
import org.springframework.cache.annotation.CacheEvict ;
import org.springframework.cache.annotation.Cacheable ;
import org.springframework.stereotype.Service ;
import com.github.pagehelper.PageInfo ;
import org.springframework.transaction.annotation.Transactional ;
@ -33,8 +34,9 @@ public class ActivityServiceImpl implements ActivityService {
public int add ( Activity activity ) {
return activityMapper . add ( activity ) ;
}
@CacheEvict ( value = "activity" , allEntries = true )
@Override
@CacheEvict ( value = { "activity" } , allEntries = true )
public int edit ( Activity activity ) {
activity . setActivityFlag ( 0 ) ;
return activityMapper . edit ( activity ) ;
@ -46,8 +48,9 @@ public class ActivityServiceImpl implements ActivityService {
return activityMapper . select ( activity ) ;
}
@CacheEvict ( value = { "activity" } , allEntries = true )
@Override
@Cacheable ( key = "#root.method.name + ':'+ #pageNum + '-' + #pageSize + '-' + #activity.hashCode() " )
public PageInfo < Activity > searchForPage ( Integer pageNum , Integer pageSize , Activity activity ) {
/ / PageHelper . startPage ( pageNum , pageSize ) ;
/ / List < Activity > list = activityMapper . select ( activity ) ;