From ed6f35069824d71ee6da599a328d865eb0c58550 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期四, 25 四月 2024 09:16:26 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
---
north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
index 44b6654..8c6d027 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
@@ -3,21 +3,50 @@
import com.example.erp.common.Result;
import com.example.erp.entity.sd.Product;
import com.example.erp.service.sd.ProductService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
+import java.util.Map;
@RestController
+@Api(value="浜у搧controller",tags={"浜у搧鎿嶄綔鎺ュ彛"})
@RequestMapping("/product")
public class ProductController {
- @Autowired
+ final
ProductService productService;
+ public ProductController(ProductService productService) {
+ this.productService = productService;
+ }
+
+ @ApiOperation("浜у搧鏌ヨ鎺ュ彛")
@PostMapping ("/{pageNum}/{pageSize}/{glassType}")
public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> glassType, @RequestBody Product product){
-
return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product));
}
+ @ApiOperation("浜у搧淇濆瓨鎺ュ彛")
+ @PostMapping("/saveProduct")
+ public Result saveProduct(@RequestBody Map<String,Object> product){
+ return Result.seccess(productService.saveProduct(product));
+ }
+ @ApiOperation("浜у搧鍒犻櫎鎺ュ彛")
+ @PostMapping("/deleteProductById/{id}")
+ public Result deleteProductById(@PathVariable Integer id){
+ return Result.seccess(productService.deleteProductById(id));
+ }
+
+ @ApiOperation("浜у搧瀹℃牳鐘舵�佷慨鏀规帴鍙�")
+ @PostMapping("/updateProductStateById/{id}/{state}")
+ public Result updateProductStateById(@PathVariable Integer id,@PathVariable Integer state){
+ return Result.seccess(productService.updateProductStateById(id,state));
+ }
+ @ApiOperation("鏍规嵁浜у搧id鏌ヨ浜у搧鎺ュ彛")
+ @PostMapping("/selectProductById/{id}")
+ public Result selectProductById(@PathVariable Integer id){
+ return Result.seccess(productService.selectProductById(id));
+ }
}
--
Gitblit v1.8.0