zepengdev
2025-06-22 9fcffba8403c50c87006ce8c58d980e0d0ccf892
fix(product): 处理null问题
1 files modified
4 ■■■ changed files
oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductCustomerController.java 4 ●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductCustomerController.java
@@ -18,7 +18,6 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@@ -75,6 +74,9 @@
    /*@PreAuthorize("@el.check('merchant:product:byProductId')")*/
    public ResponseEntity<?> getProductDetails(@PathVariable Long productId) {
        Product product = productService.getById(productId);
        if (ObjUtil.isEmpty(product)) {
            return ResponseEntity.ok(R.success());
        }
        ProductCustomerView customerView = new ProductCustomerView();
        BeanUtil.copyProperties(product, customerView);
        if (ObjUtil.isNotEmpty(product)) {