Compare commits
No commits in common. "0fa6d45ddfe68618cb5a60dad575f8e5379c4105" and "9eba1b9b1aef18d756b0806d19d85e508ad4b2ef" have entirely different histories.
0fa6d45ddf
...
9eba1b9b1a
|
@ -1,7 +1,6 @@
|
||||||
package com.bocloud.sms.booter.controller;
|
package com.bocloud.sms.booter.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.bocloud.sms.entity.SystemConfig;
|
|
||||||
import com.bocloud.sms.interfaces.SystemConfigService;
|
import com.bocloud.sms.interfaces.SystemConfigService;
|
||||||
import com.bocloud.sms.model.ConfigModel;
|
import com.bocloud.sms.model.ConfigModel;
|
||||||
import com.megatron.common.model.GeneralResult;
|
import com.megatron.common.model.GeneralResult;
|
||||||
|
@ -102,10 +101,4 @@ public class SystemConfigController {
|
||||||
public Result configTest(@RequestParam(value = "category") String category) {
|
public Result configTest(@RequestParam(value = "category") String category) {
|
||||||
return systemConfigService.configTest(category);
|
return systemConfigService.configTest(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "通过code查询系统配置信息")
|
|
||||||
@GetMapping("/configs/queryByCode")
|
|
||||||
public GeneralResult<SystemConfig> queryByCode(@RequestParam(value = "code") String code) {
|
|
||||||
return systemConfigService.queryByCode(code);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,4 @@ public interface SystemConfigService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result configTest(String category);
|
Result configTest(String category);
|
||||||
|
|
||||||
GeneralResult<SystemConfig> queryByCode(String code);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,25 +331,4 @@ public class SystemConfigServiceImpl implements SystemConfigService {
|
||||||
}
|
}
|
||||||
return Result.FAILED("测试连接失败");
|
return Result.FAILED("测试连接失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public GeneralResult<SystemConfig> queryByCode(String code) {
|
|
||||||
String errorMsg;
|
|
||||||
|
|
||||||
try {
|
|
||||||
SystemConfig config = systemConfigRepository.queryByCode(code);
|
|
||||||
if (config == null) {
|
|
||||||
return new GeneralResult<>(false, "未查询到code为" + code + "的配置信息");
|
|
||||||
}
|
|
||||||
String value = config.getValue();
|
|
||||||
if (value != null) {
|
|
||||||
config.setValue(value.trim());
|
|
||||||
}
|
|
||||||
return new GeneralResult<>(true, config, "查询成功");
|
|
||||||
} catch (Exception e) {
|
|
||||||
errorMsg = "通过code查询系统配置信息出错," + e.getMessage();
|
|
||||||
log.error(errorMsg, e);
|
|
||||||
return new GeneralResult<>(false, errorMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue