| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.Classify; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateClassifyDto; |
| | | import com.yuanchu.limslaboratory.service.ClassifyService; |
| | |
| | | |
| | | @ApiOperation("添加分类") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addClassifyInformation(@RequestBody Classify classify) { |
| | | Integer isAddClassifySuccess = classifyService.addClassifyInformation(classify); |
| | | if (isAddClassifySuccess == 1) { |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "分类名称", name = "classifyName", dataTypeClass = String.class) |
| | | }) |
| | | @AuthHandler |
| | | public Result<?> getListClassifyInformation(String classifyName) { |
| | | return Result.success(classifyService.getListClassifyInformation(classifyName)); |
| | | } |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "分类Id", name = "classifyId", dataTypeClass = String.class) |
| | | }) |
| | | @AuthHandler |
| | | public Result<?> deleteClassifyInformation(String classifyId) { |
| | | Boolean isDeleteSuccess = classifyService.deleteClassifyInformation(classifyId); |
| | | if (isDeleteSuccess){ |
| | |
| | | |
| | | @ApiOperation("更新分类") |
| | | @PutMapping("/update") |
| | | @AuthHandler |
| | | public Result<?> updateClassifyInformation(@RequestBody UpdateClassifyDto updateClassifyDto) throws Exception { |
| | | Classify classify = JackSonUtil.unmarshal(JackSonUtil.marshal(updateClassifyDto), Classify.class); |
| | | Boolean isUpdateClassifySuccess = classifyService.updateClassifyInformation(classify); |