Service 层修改为调用 JPA 的 Repository

This commit is contained in:
zhaojun1998
2019-08-26 23:41:42 +08:00
parent 739fa0c8ee
commit b4d169a4c7
2 changed files with 7 additions and 9 deletions

View File

@@ -1,8 +1,7 @@
package im.zhaojun.common.service;
import im.zhaojun.common.mapper.SystemConfigMapper;
import im.zhaojun.common.model.SystemConfig;
import org.springframework.cache.annotation.Cacheable;
import im.zhaojun.common.repository.SystemConfigRepository;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -11,10 +10,9 @@ import javax.annotation.Resource;
public class SystemConfigService {
@Resource
private SystemConfigMapper systemConfigMapper;
private SystemConfigRepository systemConfigRepository;
@Cacheable("zfile")
public SystemConfig getSystemConfig() {
return systemConfigMapper.selectFirstConfig();
return systemConfigRepository.findFirstBy();
}
}