use of com.ruoyi.system.domain.SysConfig in project RuoYi-Vue by yangzongzhuan.
the class SysConfigServiceImpl method checkConfigKeyUnique.
/**
* 校验参数键名是否唯一
*
* @param config 参数配置信息
* @return 结果
*/
@Override
public String checkConfigKeyUnique(SysConfig config) {
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
use of com.ruoyi.system.domain.SysConfig in project hocassian-media-matrix by hokaso.
the class SysConfigServiceImpl method selectConfigById.
/**
* 查询参数配置信息
*
* @param configId 参数配置ID
* @return 参数配置信息
*/
@Override
@DataSource(DataSourceType.MASTER)
public SysConfig selectConfigById(Long configId) {
SysConfig config = new SysConfig();
config.setConfigId(configId);
return configMapper.selectConfig(config);
}
use of com.ruoyi.system.domain.SysConfig in project hocassian-media-matrix by hokaso.
the class SysConfigServiceImpl method checkConfigKeyUnique.
/**
* 校验参数键名是否唯一
*
* @param config 参数配置信息
* @return 结果
*/
@Override
public String checkConfigKeyUnique(SysConfig config) {
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
use of com.ruoyi.system.domain.SysConfig in project hocassian-media-matrix by hokaso.
the class SysConfigServiceImpl method deleteConfigByIds.
/**
* 批量删除参数信息
*
* @param configIds 需要删除的参数ID
* @return 结果
*/
@Override
public int deleteConfigByIds(Long[] configIds) {
for (Long configId : configIds) {
SysConfig config = selectConfigById(configId);
if (StringUtils.equals(UserConstants.YES, config.getConfigType())) {
throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
}
}
int count = configMapper.deleteConfigByIds(configIds);
if (count > 0) {
Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
redisCache.deleteObject(keys);
}
return count;
}
Aggregations