| | |
| | | @ManagerAuth |
| | | public R edit(Config config) { |
| | | if (Cools.isEmpty(config)){ |
| | | return R.error(); |
| | | return R.error("参数缺失"); |
| | | } |
| | | if (config.getType() == 2){ |
| | | if (!checkJson(config.getValue())){ |
| | |
| | | @ManagerAuth |
| | | public R update(Config config){ |
| | | if (Cools.isEmpty(config) || null==config.getId()){ |
| | | return R.error(); |
| | | return R.error("参数缺失"); |
| | | } |
| | | if (config.getType() == 2){ |
| | | if (!checkJson(config.getValue())){ |
| | |
| | | @ManagerAuth |
| | | public R delete(Integer[] ids){ |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | return R.error("参数缺失"); |
| | | } |
| | | configService.deleteBatchIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | |
| | | * 刷新配置 |
| | | */ |
| | | @RequestMapping(value = "/config/refresh/auth") |
| | | @ManagerAuth |
| | | // @ManagerAuth |
| | | public R refresh(){ |
| | | Parameter parameter; |
| | | try { |
| | | parameter = Parameter.reset(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(); |
| | | return R.error("刷新失败"); |
| | | } |
| | | if (Cools.isEmpty(parameter)){ |
| | | return R.error(); |
| | | return R.error("刷新后为空"); |
| | | } |
| | | return R.ok(); |
| | | } |