|
@@ -2,14 +2,17 @@ package cn.cslg.pas.controller;
|
|
|
|
|
|
import cn.cslg.pas.common.core.base.Constants;
|
|
|
import cn.cslg.pas.common.dto.business.ProductDTO;
|
|
|
+import cn.cslg.pas.common.dto.business.UpdateProductDTO;
|
|
|
import cn.cslg.pas.common.model.cronModel.Records;
|
|
|
import cn.cslg.pas.common.model.request.StringRequest;
|
|
|
import cn.cslg.pas.common.utils.Response;
|
|
|
+import cn.cslg.pas.domain.business.Product;
|
|
|
import cn.cslg.pas.exception.ConditionException;
|
|
|
import cn.cslg.pas.exception.UnLoginException;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.factorys.businessFactory.Business;
|
|
|
import cn.cslg.pas.factorys.businessFactory.BusinessFactory;
|
|
|
+import cn.cslg.pas.service.business.ProductService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -34,6 +37,9 @@ public class ProductController {
|
|
|
@Autowired
|
|
|
private BusinessFactory businessFactory;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProductService productService;
|
|
|
+
|
|
|
@Operation(summary = "查询产品")
|
|
|
@PostMapping("/queryProduct")
|
|
|
public Response queryProduct(@RequestBody StringRequest stringRequest) throws Exception {
|
|
@@ -70,9 +76,9 @@ public class ProductController {
|
|
|
@PostMapping("/updateProduct")
|
|
|
public Response updateProduct(String product, List<MultipartFile> files) throws Exception {
|
|
|
if(product != null){
|
|
|
- ProductDTO productDTO = JSONObject.parseObject(product, ProductDTO.class);
|
|
|
+ UpdateProductDTO updateProductDTO = JSONObject.parseObject(product, UpdateProductDTO.class);
|
|
|
Business business = businessFactory.getClass("productService");
|
|
|
- business.updateMessage(productDTO, files);
|
|
|
+ business.updateMessage(updateProductDTO, files);
|
|
|
return Response.success(1);
|
|
|
} else {
|
|
|
return Response.error("网络异常");
|