guoyuji
2024-02-23 3bee17a52f3ee1f493048465f3e07b31c2102ee5
north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
@@ -1,9 +1,14 @@
package com.example.erp.controller.sd;
import com.example.erp.common.Result;
import com.example.erp.entity.sd.Product;
import com.example.erp.service.sd.ProductService;
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
@RequestMapping("/product")
@@ -11,8 +16,13 @@
    @Autowired
    ProductService productService;
    @GetMapping("/{pageNum}/{pageSize}")
    public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize){
        return Result.seccess(productService.defaultDateProduct(pageNum,pageSize));
    @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));
    }
    @PostMapping("/saveProduct")
    public Result saveProduct(@RequestBody Map<String,Object> product){
        return Result.seccess(productService.saveProduct(product));
    }
}