| | |
| | | /** |
| | | * 预测项信息 |
| | | */ |
| | | @GetMapping("/info/{id}") |
| | | @GetMapping("/get/{id}") |
| | | public CommonResult<MmPredictItemDTO> info(@PathVariable("id") String id, @RequestParam Map<String, Object> params){ |
| | | MmPredictItemDTO predictItem = mmPredictItemService.getDetailById(id, params); |
| | | return success(predictItem); |
| | |
| | | /** |
| | | * 保存预测项 |
| | | */ |
| | | @PostMapping |
| | | @PostMapping("/create") |
| | | public CommonResult<Boolean> save(@RequestBody MmPredictItemDTO mmPredictItemDto){ |
| | | int count = mmPredictItemService.check(mmPredictItemDto.getMmPredictItem()); |
| | | if (count > 0) { |
| | |
| | | /** |
| | | * 修改预测项 |
| | | */ |
| | | @PutMapping |
| | | @PutMapping("/update") |
| | | public CommonResult<Boolean> update(@RequestBody MmPredictItemDTO mmPredictItemDto){ |
| | | int count = mmPredictItemService.check(mmPredictItemDto.getMmPredictItem()); |
| | | if (count > 0) { |
| | |
| | | /** |
| | | * 删除预测项 |
| | | */ |
| | | @DeleteMapping("{id}") |
| | | public CommonResult<Boolean> delete(@RequestBody String[] itemIds){ |
| | | if (itemIds == null || itemIds.length == 0) { |
| | | return error(999, "参数不能为空"); |
| | | } |
| | | mmPredictItemService.deleteBatch(itemIds); |
| | | @DeleteMapping("/delete") |
| | | public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
| | | mmPredictItemService.deleteBatch(new String[]{id}); |
| | | return success(true); |
| | | } |
| | | |