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 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
|
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));
|
}
|
}
|