| | |
| | | package com.iailab.module.model.mcs.pre.controller.admin; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
| | | import com.iailab.framework.common.exception.ErrorCode; |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | |
| | | @GetMapping("/get/{id}") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-module:query')") |
| | | public CommonResult<DmModuleEntity> info(@PathVariable("id") String id){ |
| | | DmModuleEntity info = dmModuleService.selectById(id); |
| | | DmModuleEntity info = dmModuleService.info(id); |
| | | |
| | | return success(info); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/create") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-module:create')") |
| | | @DSTransactional(rollbackFor= Exception.class) |
| | | public CommonResult<Boolean> save(@RequestBody DmModuleEntity module){ |
| | | int count = dmModuleService.check(module); |
| | | if (count > 0) { |
| | |
| | | */ |
| | | @PutMapping("/update") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-module:update')") |
| | | @DSTransactional(rollbackFor= Exception.class) |
| | | public CommonResult<Boolean> update(@RequestBody DmModuleEntity module){ |
| | | dmModuleService.update(module); |
| | | return success(true); |
| | |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-module:delete')") |
| | | @DSTransactional(rollbackFor= Exception.class) |
| | | public CommonResult<Boolean> delete(@RequestParam("id") String id){ |
| | | dmModuleService.deleteBatch(new String[]{id}); |
| | | return success(true); |