package com.ruoyi.demo.service.impl;

import com.ruoyi.demo.entity.SystemSetter;
import com.ruoyi.demo.entity.vo.SystemSetterVo;
import com.ruoyi.demo.mapper.SystemSetterMapper;
import com.ruoyi.demo.service.SystemSetterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class SystemSetterServiceImpl implements SystemSetterService {
    @Autowired
    SystemSetterMapper systemSetterMapper;
    @Override
    public SystemSetter getSystemSetter() {
        SystemSetter systemSetter = systemSetterMapper.selectOne(null);
        return systemSetter;
    }

    @Override
    public void updateSystemSetter(SystemSetterVo systemSetterVo) {
        SystemSetter systemSetter = new SystemSetter(systemSetterVo);
        systemSetterMapper.update(systemSetter,null);
    }
}
