Просмотр исходного кода

feat: add Product entity fields (categoryId, distributionSystemId)

Add categoryId for product categorization and distributionSystemId for distribution system support.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg 2 месяцев назад
Родитель
Сommit
7d38356fa0

+ 13 - 0
cfc-backend/src/main/java/com/etotem/cfc/dto/ProductDTO.java

@@ -1,9 +1,12 @@
 package com.etotem.cfc.dto;
 
+import com.alibaba.fastjson.JSON;
 import com.etotem.cfc.entity.Product;
 import lombok.Data;
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class ProductDTO {
@@ -23,6 +26,7 @@ public class ProductDTO {
     private String status;
     private String domain;
     private String memberEligible;
+    private List<String> imageList;
     private Long energyDimensionId;
     private String priceLabel;     // 游客 = "登录查看价格",登录后 = null
     private Date createdAt;
@@ -41,6 +45,15 @@ public class ProductDTO {
         d.intro = p.getIntro();
         d.coverImage = p.getCoverImage();
         d.images = p.getImages();
+        if (p.getImages() != null && !p.getImages().isEmpty()) {
+            try {
+                d.imageList = JSON.parseArray(p.getImages(), String.class);
+            } catch (Exception e) {
+                d.imageList = new ArrayList<>();
+            }
+        } else {
+            d.imageList = new ArrayList<>();
+        }
         d.price = p.getPrice();
         d.memberPrice = p.getMemberPrice();
         d.stock = p.getStock();

+ 4 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/Product.java

@@ -38,6 +38,10 @@ public class Product implements Serializable {
     // 分佣系统 - 平台利润率(千分比)
     private Integer profitRate;
 
+    // 电商扩展字段
+    private Long categoryId;               // 商品类目ID
+    private Long distributionSystemId;     // 分销体系ID
+
     private Date createdAt;
     private Date updatedAt;
 }