Commit 8188e53a by yuwei

2.0.0项目初始化

parent 9024780f
......@@ -27,6 +27,7 @@ public class RedisCacheConfig extends CachingConfigurerSupport {
* @return
*/
@Bean
@Override
public KeyGenerator keyGenerator() {
return new KeyGenerator() {
@Override
......
......@@ -9,10 +9,6 @@ import cn.datax.service.quartz.mapstruct.QrtzJobMapper;
import cn.datax.service.quartz.dao.QrtzJobDao;
import cn.datax.common.base.BaseServiceImpl;
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.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
......@@ -25,7 +21,6 @@ import org.springframework.transaction.annotation.Transactional;
* @author yuwei
* @since 2020-05-14
*/
@CacheConfig(cacheNames = "data:quartz:jobs")
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntity> implements QrtzJobService {
......@@ -44,7 +39,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit
ScheduleUtil.createScheduleJob(qrtzJob);
}
@CachePut(key = "#p0.id")
@Override
@Transactional(rollbackFor = Exception.class)
public void updateQrtzJob(QrtzJobDto qrtzJobDto) {
......@@ -53,14 +47,12 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit
ScheduleUtil.updateScheduleJob(qrtzJob);
}
@Cacheable(key = "#id")
@Override
public QrtzJobEntity getQrtzJobById(String id) {
QrtzJobEntity qrtzJobEntity = super.getById(id);
return qrtzJobEntity;
}
@CacheEvict(key = "#id")
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteQrtzJobById(String id) {
......@@ -68,7 +60,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit
qrtzJobDao.deleteById(id);
}
@CachePut(key = "#id")
@Override
public void pauseById(String id) {
QrtzJobEntity job = getQrtzJobById(id);
......@@ -77,7 +68,6 @@ public class QrtzJobServiceImpl extends BaseServiceImpl<QrtzJobDao, QrtzJobEntit
ScheduleUtil.pauseJob(id);
}
@CachePut(key = "#id")
@Override
public void resumeById(String 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