| | |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemTypePageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemTypeRespVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | * @date 2021年04月22日 9:57 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/pre/item-type") |
| | | @RequestMapping("/model/pre/item-type") |
| | | public class MmItemTypeController { |
| | | |
| | | @Autowired |
| | |
| | | * 预测项类型列表 |
| | | */ |
| | | @GetMapping("/page") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:query')") |
| | | public CommonResult<PageResult<MmItemTypeRespVO>> page(@Validated MmItemTypePageReqVO reqVO) { |
| | | PageResult<MmItemTypeEntity> page = mmItemTypeService.page(reqVO); |
| | | |
| | |
| | | * 预测项类型信息 |
| | | */ |
| | | @GetMapping("/get/{id}") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:query')") |
| | | public CommonResult<MmItemTypeEntity> info(@PathVariable("id") String id) { |
| | | MmItemTypeEntity itemType = mmItemTypeService.selectById(id); |
| | | |
| | |
| | | * 保存预测项类型 |
| | | */ |
| | | @PostMapping("/create") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:create')") |
| | | public CommonResult<Boolean> save(@RequestBody MmItemTypeEntity itemType) { |
| | | int count = mmItemTypeService.check(itemType); |
| | | if (count > 0) { |
| | |
| | | * 修改预测项类型 |
| | | */ |
| | | @PutMapping("/update") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:update')") |
| | | public CommonResult<Boolean> update(@RequestBody MmItemTypeEntity itemType) { |
| | | int count = mmItemTypeService.check(itemType); |
| | | if (count > 0) { |
| | |
| | | * 删除预测项类型 |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-item:delete')") |
| | | public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
| | | mmItemTypeService.deleteBatch(new String[]{id}); |
| | | return success(true); |