| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得详情") |
| | | @PreAuthorize("@ss.hasPermission('sche:model:query')") |
| | | public CommonResult<StScheduleModelRespVO> get(@RequestParam("id") String id){ |
| | | public CommonResult<StScheduleModelRespVO> get(@RequestParam("id") String id) { |
| | | StScheduleModelEntity data = stScheduleModelService.get(id); |
| | | StScheduleModelRespVO result = BeanUtils.toBean(data, StScheduleModelRespVO.class); |
| | | List<StScheduleModelParamEntity> paramList = stScheduleModelParamService.getByModelId(data.getId()); |
| | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建模型") |
| | | @PreAuthorize("@ss.hasPermission('sche:model:create')") |
| | | public CommonResult<Boolean> save(@Valid @RequestBody StScheduleModelSaveReqVO reqVO){ |
| | | public CommonResult<Boolean> save(@Valid @RequestBody StScheduleModelSaveReqVO reqVO) { |
| | | Long count = stScheduleModelService.check(reqVO); |
| | | if (count > 0) { |
| | | return error(999, "名称或编号重复"); |
| | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "更新模型") |
| | | @PreAuthorize("@ss.hasPermission('sche:model:update')") |
| | | public CommonResult<Boolean> update(@Valid @RequestBody StScheduleModelSaveReqVO reqVO){ |
| | | public CommonResult<Boolean> update(@Valid @RequestBody StScheduleModelSaveReqVO reqVO) { |
| | | Long count = stScheduleModelService.check(reqVO); |
| | | if (count > 0) { |
| | | return error(999, "名称或编号重复"); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除模型") |
| | | @PreAuthorize("@ss.hasPermission('sche:model:delete')") |
| | | public CommonResult<Boolean> delete(@RequestParam("id") String id){ |
| | | public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
| | | stScheduleModelService.delete(id); |
| | | return success(true); |
| | | } |