use of com.dimple.project.system.domain.Config in project DimpleBlog by martin-chips.
the class SettingController method emailSetting.
@GetMapping("/emailSetting")
@PreAuthorize("@permissionService.hasPermission('system:setting:emailSetting:query')")
public AjaxResult emailSetting() {
Config config = configService.selectConfigByKey(ConfigKey.CONFIG_KEY_EMAIL_SETTING);
// convert to site setting
if (config != null) {
EmailSetting emailSetting = JSON.parseObject(config.getConfigValue(), EmailSetting.class);
emailSetting.setPassword("*************************");
return AjaxResult.success(emailSetting);
}
return AjaxResult.success(new EmailSetting());
}
use of com.dimple.project.system.domain.Config in project DimpleBlog by martin-chips.
the class SettingController method editSiteSetting.
@PutMapping("siteSetting")
@PreAuthorize("@permissionService.hasPermission('system:setting:siteSetting:edit')")
@Log(title = "系统设置-网站设置", businessType = BusinessType.UPDATE)
public AjaxResult editSiteSetting(@RequestBody SiteSetting siteSetting) {
String jsonString = JSON.toJSONString(siteSetting);
Config config = new Config();
config.setConfigKey(ConfigKey.CONFIG_KEY_SITE_SETTING);
config.setConfigValue(jsonString);
return AjaxResult.success(configService.updateConfigByConfigKey(config));
}
use of com.dimple.project.system.domain.Config in project DimpleBlog by martin-chips.
the class QiNiuServiceImpl method updateQiNiuConfig.
@Override
public int updateQiNiuConfig(QiNiuConfig qiNiuConfig) {
String qiNiuConfigString = JSON.toJSONString(qiNiuConfig);
Config config = new Config();
config.setConfigKey(ConfigKey.CONFIG_KEY_QI_NIU);
config.setConfigValue(qiNiuConfigString);
config.setUpdateBy(SecurityUtils.getUsername());
return configService.updateConfigByConfigKey(config);
}
use of com.dimple.project.system.domain.Config in project DimpleBlog by martin-chips.
the class QiNiuServiceImpl method getQiNiuConfig.
@Override
public QiNiuConfig getQiNiuConfig() {
Config config = configService.selectConfigByKey(ConfigKey.CONFIG_KEY_QI_NIU);
// 七牛云Config的配置Json
String configValue = config.getConfigValue();
if (StringUtils.isEmpty(configValue)) {
return new QiNiuConfig();
}
return JSON.parseObject(configValue, QiNiuConfig.class);
}
use of com.dimple.project.system.domain.Config in project DimpleBlog by martin-chips.
the class ConfigServiceImpl method checkConfigKeyUnique.
@Override
public String checkConfigKeyUnique(Config config) {
Long id = StringUtils.isNull(config.getId()) ? -1L : config.getId();
Config info = configMapper.checkConfigKeyUnique(config.getConfigKey());
if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
Aggregations