wuyouming666
2024-07-11 a3258df8fd03a09d34cde0332e58eee101f5fc36
hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java
@@ -1,5 +1,6 @@
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;
@@ -38,9 +39,9 @@
    @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json")
    @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
    @PostMapping("/findList")
    public ResponseEntity<List<ShelfRack>> findList(@RequestBody ShelfRack params) {
    public Result findList(@RequestBody ShelfRack params) {
        List<ShelfRack> result = shelfRackService.findList(params);
        return ResponseEntity.ok(result);
        return Result.success(result);
    }
    /**
@@ -52,9 +53,9 @@
    @ApiOperation(value = "查询", notes = "查询详情")
    @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
    @GetMapping("/{id}")
    public ResponseEntity<ShelfRack> findById(@PathVariable("id") Long id) {
        ShelfRack shelfRack = shelfRackService.findById(id);
        return ResponseEntity.ok(shelfRack);
    public Result findById(@PathVariable("id") Long id) {
        ShelfRack shelfRack = shelfRackService.getBaseMapper().selectById(id);
        return Result.success(shelfRack);
    }
    /**
@@ -66,9 +67,9 @@
    @ApiOperation(value = "新增", notes = "新增数据")
    @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
    @PostMapping
    public ResponseEntity<Boolean> insert( @RequestBody ShelfRack shelfRack) {
        boolean result = shelfRackService.insert(shelfRack);
        return ResponseEntity.ok(result);
    public Result insert( @RequestBody ShelfRack shelfRack) {
        boolean result = shelfRackService.save(shelfRack);
        return Result.success(result);
    }
    /**
@@ -80,9 +81,9 @@
    @ApiOperation(value = "修改", notes = "修改数据")
    @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
    @PutMapping
    public ResponseEntity<Boolean> update( @RequestBody ShelfRack shelfRack) {
        boolean result = shelfRackService.update(shelfRack);
        return ResponseEntity.ok(result);
    public Result update( @RequestBody ShelfRack shelfRack) {
        boolean result = shelfRackService.updateById(shelfRack);
        return Result.success(result);
    }
    /**
@@ -93,9 +94,9 @@
     */
    @ApiOperation(value = "删除", notes = "删除数据")
    @DeleteMapping("/{id}")
    public ResponseEntity<Integer> delete(@PathVariable("id") Long id) {
        int result = shelfRackService.delete(id);
        return ResponseEntity.ok(result);
    public Result delete(@PathVariable("id") Long id) {
        int result = shelfRackService.getBaseMapper().deleteById(id);
        return Result.success(result);
    }
}