| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.asrs.domain.param.ConfigUpdateBatchParam; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | |
| | | return R.ok(configService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/listAll/auth") |
| | | @ManagerAuth |
| | | public R listAll(){ |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(configService.selectList(wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/updateBatch") |
| | | @ManagerAuth |
| | | public R updateBatch(@RequestBody List<ConfigUpdateBatchParam> params){ |
| | | for (ConfigUpdateBatchParam param : params) { |
| | | String code = param.getCode(); |
| | | String value = param.getValue(); |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", code)); |
| | | if (config == null) { |
| | | continue; |
| | | } |
| | | |
| | | config.setValue(value); |
| | | configService.updateById(config); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/edit/auth") |
| | | @ManagerAuth |
| | | public R edit(Config config) { |