| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ard.common.constant.DeviceConstants; |
| | | import com.ard.data.model.domain.ArdModel; |
| | | import com.ard.data.model.service.IArdModelService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | * 查询模型管理列表 |
| | | */ |
| | | @ApiOperation("查询模型管理列表") |
| | | @PreAuthorize("@ss.hasPermi('system:model:list')") |
| | | @PreAuthorize("@ss.hasPermi('data:model:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdModel ardModel) { |
| | | startPage(); |
| | |
| | | * 导出模型管理列表 |
| | | */ |
| | | @ApiOperation("导出模型管理列表") |
| | | @PreAuthorize("@ss.hasPermi('system:model:export')") |
| | | @PreAuthorize("@ss.hasPermi('data:model:export')") |
| | | @Log(title = "模型管理", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ArdModel ardModel) { |
| | |
| | | * 获取模型管理详细信息 |
| | | */ |
| | | @ApiOperation("获取模型管理详细信息") |
| | | @PreAuthorize("@ss.hasPermi('system:model:query')") |
| | | @PreAuthorize("@ss.hasPermi('data:model:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardModelService.selectArdModelById(id)); |
| | |
| | | * 新增模型管理 |
| | | */ |
| | | @ApiOperation("新增模型管理") |
| | | @PreAuthorize("@ss.hasPermi('system:model:add')") |
| | | @PreAuthorize("@ss.hasPermi('data:model:add')") |
| | | @Log(title = "模型管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdModel ardModel) { |
| | | if (DeviceConstants.NOT_UNIQUE.equals(ardModelService.checkArdModelNameUnique(ardModel))) { |
| | | return error("新增模型'" + ardModel.getModelName() + "'失败,已存在"); |
| | | } |
| | | return toAjax(ardModelService.insertArdModel(ardModel)); |
| | | } |
| | | |
| | |
| | | * 修改模型管理 |
| | | */ |
| | | @ApiOperation("修改模型管理") |
| | | @PreAuthorize("@ss.hasPermi('system:model:edit')") |
| | | @PreAuthorize("@ss.hasPermi('data:model:edit')") |
| | | @Log(title = "模型管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdModel ardModel) { |
| | | if (DeviceConstants.NOT_UNIQUE.equals(ardModelService.checkArdModelNameUnique(ardModel))) { |
| | | return error("修改模型'" + ardModel.getModelName() + "'失败,已存在"); |
| | | } |
| | | return toAjax(ardModelService.updateArdModel(ardModel)); |
| | | } |
| | | |
| | |
| | | * 删除模型管理 |
| | | */ |
| | | @ApiOperation("删除模型管理") |
| | | @PreAuthorize("@ss.hasPermi('system:model:remove')") |
| | | @PreAuthorize("@ss.hasPermi('data:model:remove')") |
| | | @Log(title = "模型管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |