| | |
| | | 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; |
| | |
| | | @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)); |
| | | } |
| | | |
| | |
| | | @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)); |
| | | } |
| | | |