| @@ -45,7 +45,7 @@ public class CodeConfigController extends BaseController { | |||||
| * @return 单条数据 | * @return 单条数据 | ||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| public GenericsAjaxResult<CodeConfig> queryById(@PathVariable("id") Long id) { | |||||
| public GenericsAjaxResult<CodeConfig> queryById(@PathVariable("id") Long id) throws Exception { | |||||
| return genericsSuccess(this.codeConfigService.queryById(id)); | return genericsSuccess(this.codeConfigService.queryById(id)); | ||||
| } | } | ||||
| @@ -8,7 +8,7 @@ public interface CodeConfigService { | |||||
| Page<CodeConfig> queryByPage(CodeConfig codeConfig, PageRequest pageRequest); | Page<CodeConfig> queryByPage(CodeConfig codeConfig, PageRequest pageRequest); | ||||
| CodeConfig queryById(Long id); | |||||
| CodeConfig queryById(Long id) throws Exception; | |||||
| CodeConfig insert(CodeConfig codeConfig); | CodeConfig insert(CodeConfig codeConfig); | ||||
| @@ -46,8 +46,13 @@ public class CodeConfigServiceImpl implements CodeConfigService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public CodeConfig queryById(Long id) { | |||||
| return this.codeConfigDao.queryById(id); | |||||
| public CodeConfig queryById(Long id) throws Exception { | |||||
| CodeConfig codeConfig = this.codeConfigDao.queryById(id); | |||||
| if (codeConfig == null) { | |||||
| throw new Exception("未查询到代码配置"); | |||||
| } else { | |||||
| return this.codeConfigDao.queryById(id); | |||||
| } | |||||
| } | } | ||||
| @Override | @Override | ||||