Commit 8188e53a by yuwei

2.0.0项目初始化

parent 9024780f
...@@ -27,6 +27,7 @@ public class RedisCacheConfig extends CachingConfigurerSupport { ...@@ -27,6 +27,7 @@ public class RedisCacheConfig extends CachingConfigurerSupport {
* @return * @return
*/ */
@Bean @Bean
@Override
public KeyGenerator keyGenerator() { public KeyGenerator keyGenerator() {
return new KeyGenerator() { return new KeyGenerator() {
@Override @Override
......
...@@ -9,10 +9,6 @@ import cn.datax.service.quartz.mapstruct.QrtzJobMapper; ...@@ -9,10 +9,6 @@ import cn.datax.service.quartz.mapstruct.QrtzJobMapper;
import cn.datax.service.quartz.dao.QrtzJobDao; import cn.datax.service.quartz.dao.QrtzJobDao;
import cn.datax.common.base.BaseServiceImpl; import cn.datax.common.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -25,7 +21,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -25,7 +21,6 @@ import org.springframework.transaction.annotation.Transactional;
* @author yuwei * @author yuwei
* @since 2020-05-14 * @since 2020-05-14
*/ */
@CacheConfig(cacheNames = "data:quartz:jobs")
@Service @Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntity> implements QrtzJobService { public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntity> implements QrtzJobService {
...@@ -44,7 +39,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit ...@@ -44,7 +39,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit
ScheduleUtil.createScheduleJob(qrtzJob); ScheduleUtil.createScheduleJob(qrtzJob);
} }
@CachePut(key = "#p0.id")
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateQrtzJob(QrtzJobDto qrtzJobDto) { public void updateQrtzJob(QrtzJobDto qrtzJobDto) {
...@@ -53,14 +47,12 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit ...@@ -53,14 +47,12 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit
ScheduleUtil.updateScheduleJob(qrtzJob); ScheduleUtil.updateScheduleJob(qrtzJob);
} }
@Cacheable(key = "#id")
@Override @Override
public QrtzJobEntity getQrtzJobById(String id) { public QrtzJobEntity getQrtzJobById(String id) {
QrtzJobEntity qrtzJobEntity = super.getById(id); QrtzJobEntity qrtzJobEntity = super.getById(id);
return qrtzJobEntity; return qrtzJobEntity;
} }
@CacheEvict(key = "#id")
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void deleteQrtzJobById(String id) { public void deleteQrtzJobById(String id) {
...@@ -68,7 +60,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit ...@@ -68,7 +60,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit
qrtzJobDao.deleteById(id); qrtzJobDao.deleteById(id);
} }
@CachePut(key = "#id")
@Override @Override
public void pauseById(String id) { public void pauseById(String id) {
QrtzJobEntity job = getQrtzJobById(id); QrtzJobEntity job = getQrtzJobById(id);
...@@ -77,7 +68,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit ...@@ -77,7 +68,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit
ScheduleUtil.pauseJob(id); ScheduleUtil.pauseJob(id);
} }
@CachePut(key = "#id")
@Override @Override
public void resumeById(String id) { public void resumeById(String id) {
QrtzJobEntity job = getQrtzJobById(id); QrtzJobEntity job = getQrtzJobById(id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment