From 68ee8235c8cd659fba5e59e3d924d5ea093504ab Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期四, 18 七月 2024 08:39:57 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 102 insertions(+), 0 deletions(-) diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java new file mode 100644 index 0000000..f1bda86 --- /dev/null +++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java @@ -0,0 +1,102 @@ +package com.mes.shelfrack.controller; + +import com.mes.utils.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.web.bind.annotation.*; +import com.mes.shelfrack.entity.ShelfRack; +import com.mes.shelfrack.service.ShelfRackService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.GetMapping; +import java.util.List; + +/** + * + * + * @author system + * @since 2024-07-09 14:51:27 + */ +@RestController +@RequestMapping("/api/shelfRack") +@Api(tags = " 鎺у埗鍣�") +public class ShelfRackController { + + @Autowired + private ShelfRackService shelfRackService; + + /** + * 鍒楄〃鏌ヨ + * + * @param params + * @return + */ + @ApiOperation(value = "鍒楄〃鏌ヨ",notes = "鍒楄〃鏌ヨ",produces = "application/json") + @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) + @PostMapping("/findList") + public Result findList(@RequestBody ShelfRack params) { + List<ShelfRack> result = shelfRackService.findList(params); + return Result.success(result); + } + + /** + * 鏌ヨ + * + * @param id + * @return + */ + @ApiOperation(value = "鏌ヨ", notes = "鏌ヨ璇︽儏") + @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) + @GetMapping("/{id}") + public Result findById(@PathVariable("id") Long id) { + ShelfRack shelfRack = shelfRackService.getBaseMapper().selectById(id); + return Result.success(shelfRack); + } + + /** + * 鏂板 + * + * @param shelfRack + * @return + */ + @ApiOperation(value = "鏂板", notes = "鏂板鏁版嵁") + @ApiResponses({@ApiResponse(code = 200, message = "鎿嶄綔鎴愬姛")}) + @PostMapping + public Result insert( @RequestBody ShelfRack shelfRack) { + boolean result = shelfRackService.save(shelfRack); + return Result.success(result); + } + + /** + * 淇敼 + * + * @param shelfRack + * @return + */ + @ApiOperation(value = "淇敼", notes = "淇敼鏁版嵁") + @ApiResponses({@ApiResponse(code = 200, message = "鎿嶄綔鎴愬姛")}) + @PutMapping + public Result update( @RequestBody ShelfRack shelfRack) { + boolean result = shelfRackService.updateById(shelfRack); + return Result.success(result); + } + + /** + * 鍒犻櫎 + * + * @param id + * @return + */ + @ApiOperation(value = "鍒犻櫎", notes = "鍒犻櫎鏁版嵁") + @DeleteMapping("/{id}") + public Result delete(@PathVariable("id") Long id) { + int result = shelfRackService.getBaseMapper().deleteById(id); + return Result.success(result); + } + +} \ No newline at end of file -- Gitblit v1.8.0