| | |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.annotation.DataSource; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.DataSourceType; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService { |
| | | public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysConfig, SysConfig> implements ISysConfigService { |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | |
| | | return retConfig.getConfigValue(); |
| | | } |
| | | return StrUtil.EMPTY; |
| | | } |
| | | |
| | | /** |
| | | * 获取验证码开关 |
| | | * |
| | | * @return true开启,false关闭 |
| | | */ |
| | | @Override |
| | | public boolean selectCaptchaOnOff() { |
| | | String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff"); |
| | | if (StrUtil.isEmpty(captchaOnOff)) { |
| | | return true; |
| | | } |
| | | return Convert.toBool(captchaOnOff); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (StrUtil.equals(UserConstants.YES, config.getConfigType())) { |
| | | throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); |
| | | } |
| | | baseMapper.deleteById(configId); |
| | | redisCache.deleteObject(getCacheKey(config.getConfigKey())); |
| | | } |
| | | baseMapper.deleteBatchIds(Arrays.asList(configIds)); |
| | | } |
| | | |
| | | /** |