|
@@ -0,0 +1,53 @@
|
|
|
+package cn.iocoder.yudao.module.museum.controller.admin.museuminfo;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.module.museum.controller.admin.museuminfo.vo.MuseumInfoRespVO;
|
|
|
+import cn.iocoder.yudao.module.museum.controller.admin.museuminfo.vo.MuseumInfoSaveVO;
|
|
|
+import cn.iocoder.yudao.module.museum.dal.database.museuminfo.MuseumInfoDO;
|
|
|
+import cn.iocoder.yudao.module.museum.service.museuminfo.MuseumInfoService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+@Tag(name = "博物馆-标本库")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/museum/info")
|
|
|
+@Validated
|
|
|
+public class MuseumInfoController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private MuseumInfoService museumInfoService;
|
|
|
+
|
|
|
+ @PostMapping("/create")
|
|
|
+ @Operation(summary = "新增标本")
|
|
|
+ public Integer createMuseumInfo(@RequestBody MuseumInfoSaveVO saveVO){
|
|
|
+ return museumInfoService.createMuseumInfo(saveVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/update")
|
|
|
+ @Operation(summary = "更新标本")
|
|
|
+ public CommonResult<Boolean> updateMuseumInfo(@RequestBody MuseumInfoSaveVO saveVO){
|
|
|
+ museumInfoService.updateMuseumInfo(saveVO);
|
|
|
+ return CommonResult.success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/delete")
|
|
|
+ @Operation(summary = "删除标本")
|
|
|
+ public CommonResult<Boolean> deleteMuseumInfo(@RequestParam("id") Integer id){
|
|
|
+ museumInfoService.deleteMuseumInfo(id);
|
|
|
+ return CommonResult.success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/get")
|
|
|
+ @Operation(summary = "查找标本")
|
|
|
+ public CommonResult<MuseumInfoRespVO> getMuseumInfo(@RequestParam("id") Integer id){
|
|
|
+ MuseumInfoDO result = museumInfoService.selectMuseumInfo(id);
|
|
|
+ MuseumInfoRespVO result1 = BeanUtils.toBean(result,MuseumInfoRespVO.class);
|
|
|
+ return CommonResult.success(result1);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|