From 7ca7d0907e413945b4960ec3e7af7fde218ed875 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 27 May 2025 13:55:42 +0800
Subject: [PATCH] refactor(mall): 重构会员标签信息返回结构

---
 src/main/java/cc/mrbird/febs/mall/vo/MallMemberVo.java                       |    3 ++-
 src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java |   10 +++++++++-
 src/main/java/cc/mrbird/febs/mall/vo/memberLevel/ApiLabelInfoVo.java         |   16 ++++++++++++++++
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
index 4971f43..2a6aafc 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -14,6 +14,7 @@
 import cc.mrbird.febs.mall.mapper.*;
 import cc.mrbird.febs.mall.service.*;
 import cc.mrbird.febs.mall.vo.*;
+import cc.mrbird.febs.mall.vo.memberLevel.ApiLabelInfoVo;
 import cc.mrbird.febs.mall.vo.memberLevel.ApiMemberLabelVo;
 import cc.mrbird.febs.pay.model.BrandWCPayRequestData;
 import cc.mrbird.febs.pay.service.IXcxPayService;
@@ -339,7 +340,14 @@
                             .in(HappyMemberLabel::getId, collect)
             );
             if(CollUtil.isNotEmpty(happyMemberLabels)){
-                mallMemberVo.setLabelList(happyMemberLabels.stream().map(HappyMemberLabel::getIconPng).collect(Collectors.toList()));
+                ArrayList<ApiLabelInfoVo> apiMemberLabelVos = new ArrayList<>();
+                for (HappyMemberLabel happyMemberLabel : happyMemberLabels) {
+                    ApiLabelInfoVo apiLabelInfoVo = new ApiLabelInfoVo();
+                    apiLabelInfoVo.setIconPng(happyMemberLabel.getIconPng());
+                    apiLabelInfoVo.setName(happyMemberLabel.getName());
+                    apiMemberLabelVos.add(apiLabelInfoVo);
+                }
+                mallMemberVo.setLabelList(apiMemberLabelVos);
             }
         }
         return new FebsResponse().success().data(mallMemberVo);
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/MallMemberVo.java b/src/main/java/cc/mrbird/febs/mall/vo/MallMemberVo.java
index fcc4fb9..ea4f405 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/MallMemberVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/MallMemberVo.java
@@ -1,5 +1,6 @@
 package cc.mrbird.febs.mall.vo;
 
+import cc.mrbird.febs.mall.vo.memberLevel.ApiLabelInfoVo;
 import cc.mrbird.febs.vip.entity.MallVipConfig;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -127,5 +128,5 @@
     private Integer newGift;
 
     @ApiModelProperty(value = "会员标识集合")
-    private List<String> labelList;
+    private List<ApiLabelInfoVo> labelList;
 }
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/memberLevel/ApiLabelInfoVo.java b/src/main/java/cc/mrbird/febs/mall/vo/memberLevel/ApiLabelInfoVo.java
new file mode 100644
index 0000000..a5b005e
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/mall/vo/memberLevel/ApiLabelInfoVo.java
@@ -0,0 +1,16 @@
+package cc.mrbird.febs.mall.vo.memberLevel;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "ApiLabelInfoVo", description = "商城用户信息返回类")
+public class ApiLabelInfoVo {
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "会员标识小图标")
+    private String iconPng;
+}

--
Gitblit v1.9.1