From c4174bbb103d95d6cd4714d3cc3070559444d70e Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期四, 30 四月 2026 17:17:41 +0800
Subject: [PATCH] 删除无用代码
---
src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesController.java | 43 ++++++++++++++++++++-----------------------
1 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesController.java b/src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesController.java
index 5229292..5aebb76 100644
--- a/src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesController.java
+++ b/src/main/java/com/ruoyi/warehouse/controller/WarehouseGoodsShelvesController.java
@@ -1,54 +1,51 @@
package com.ruoyi.warehouse.controller;
-import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesDto;
import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves;
import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
-@Api(tags = "鍟嗗搧璐ф灦")
+@Tag(name = "鍟嗗搧璐ф灦")
@RequestMapping("/warehouse/goodsShelves")
+@AllArgsConstructor
public class WarehouseGoodsShelvesController extends BaseController {
- @Autowired
private WarehouseGoodsShelvesService warehouseGoodsShelvesService;
- @GetMapping("/listPage")
- @ApiOperation("鍟嗗搧璐ф灦-鍒嗛〉鏌ヨ")
- @Log(title = "鍟嗗搧璐ф灦-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
- public AjaxResult listPage(Page page, WarehouseGoodsShelves warehouseGoodsShelves) {
- IPage<WarehouseGoodsShelves> listPage = warehouseGoodsShelvesService.listPage(page, warehouseGoodsShelves);
- return AjaxResult.success(listPage);
+
+ @GetMapping("/listById")
+ @Operation(summary = "鍟嗗搧璐ф灦-鏌ヨ")
+ @Log(title = "鍟嗗搧璐ф灦-鏌ヨ", businessType = BusinessType.OTHER)
+ public AjaxResult listById(WarehouseGoodsShelves warehouseGoodsShelves) {
+ List<WarehouseGoodsShelvesDto> list = warehouseGoodsShelvesService.findList(warehouseGoodsShelves);
+ return AjaxResult.success(list);
}
@PostMapping("/add")
- @ApiOperation("鍟嗗搧璐ф灦-娣诲姞")
+ @Operation(summary = "鍟嗗搧璐ф灦-娣诲姞")
@Log(title = "鍟嗗搧璐ф灦-娣诲姞", businessType = BusinessType.INSERT)
public AjaxResult add(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) {
- boolean save = warehouseGoodsShelvesService.add(warehouseGoodsShelves);
- return save ? AjaxResult.success("娣诲姞鎴愬姛") : AjaxResult.error("娣诲姞澶辫触");
+ return AjaxResult.success(warehouseGoodsShelvesService.add(warehouseGoodsShelves));
}
- @PostMapping("/update")
- @ApiOperation("鍟嗗搧璐ф灦-鏇存柊")
+ @PutMapping("/update")
+ @Operation(summary = "鍟嗗搧璐ф灦-鏇存柊")
@Log(title = "鍟嗗搧璐ф灦-鏇存柊", businessType = BusinessType.UPDATE)
public AjaxResult update(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) {
- boolean update = warehouseGoodsShelvesService.updateRowcolById(warehouseGoodsShelves);
- return update ? AjaxResult.success("鏇存柊鎴愬姛") : AjaxResult.error("鏇存柊澶辫触");
+ return AjaxResult.success(warehouseGoodsShelvesService.updateRowcolById(warehouseGoodsShelves));
}
@DeleteMapping("/delete")
- @ApiOperation("鍟嗗搧璐ф灦-鍒犻櫎")
+ @Operation(summary = "鍟嗗搧璐ф灦-鍒犻櫎")
@Log(title = "鍟嗗搧璐ф灦-鍒犻櫎", businessType = BusinessType.DELETE)
public AjaxResult delete(@RequestBody List<Long> ids) {
if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
- boolean remove = warehouseGoodsShelvesService.deleteByIds(ids);
- return remove ? AjaxResult.success("鍒犻櫎鎴愬姛") : AjaxResult.error("鍒犻櫎澶辫触");
+ return AjaxResult.success(warehouseGoodsShelvesService.deleteByIds(ids));
}
}
--
Gitblit v1.9.3