wang-hao-jie
2022-06-06 4e837c1e8c6f8a7252fb95776a1530ab737bb684
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package cn.exrick.xboot.core.serviceimpl;
 
import cn.exrick.xboot.core.dao.SettingDao;
import cn.exrick.xboot.core.entity.Setting;
import cn.exrick.xboot.core.service.SettingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
/**
 * 配置接口实现
 * @author Exrick
 */
@Slf4j
@Service
@Transactional
public class SettingServiceImpl implements SettingService {
 
    @Autowired
    private SettingDao settingDao;
 
    @Override
    public Setting get(String id) {
 
        return settingDao.findById(id).orElse(new Setting(id));
    }
 
    @Override
    public Setting saveOrUpdate(Setting setting) {
 
        return settingDao.saveAndFlush(setting);
    }
}