| | |
| | | * 预测项列表 |
| | | */ |
| | | @GetMapping("/page") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-predict:query')") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:query')") |
| | | public CommonResult<PageResult<MmPredictItemRespVO>> page(@Validated MmPredictItemPageReqVO reqVO) { |
| | | PageResult<MmPredictItemEntity> page = mmPredictItemService.queryPage(reqVO); |
| | | PageResult<MmPredictItemRespVO> result = BeanUtils.toBean(page, MmPredictItemRespVO.class); |
| | |
| | | * 预测项信息 |
| | | */ |
| | | @GetMapping("/get/{id}") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-predict:query')") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:query')") |
| | | public CommonResult<MmPredictItemDTO> info(@PathVariable("id") String id){ |
| | | MmPredictItemDTO predictItem = mmPredictItemService.info(id); |
| | | return success(predictItem); |
| | |
| | | * 保存预测项 |
| | | */ |
| | | @PostMapping("/create") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-predict:create')") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:create')") |
| | | @DSTransactional(rollbackFor= Exception.class) |
| | | public CommonResult<Boolean> save(@RequestBody MmPredictItemDTO mmPredictItemDto){ |
| | | mmPredictItemService.add(mmPredictItemDto); |
| | |
| | | * 修改预测项 |
| | | */ |
| | | @PutMapping("/update") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-predict:update')") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:update')") |
| | | @DSTransactional(rollbackFor= Exception.class) |
| | | public CommonResult<Boolean> update(@RequestBody MmPredictItemDTO mmPredictItemDTO){ |
| | | mmPredictItemService.update(mmPredictItemDTO); |
| | |
| | | * 删除预测项 |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-predict:delete')") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:delete')") |
| | | @DSTransactional(rollbackFor= Exception.class) |
| | | public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
| | | mmPredictItemService.deleteBatch(new String[]{id}); |