From ad3ac53da1c3a11a96ae62d790aa61a81b9eab91 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 20 三月 2021 18:47:23 +0800
Subject: [PATCH] 完善APP首页顶部标签栏兼容,初步处理推送

---
 src/main/java/com/yeshi/buwan/controller/api/VIPController.java |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/controller/api/VIPController.java b/src/main/java/com/yeshi/buwan/controller/api/VIPController.java
index e1d6c43..2ff98fc 100644
--- a/src/main/java/com/yeshi/buwan/controller/api/VIPController.java
+++ b/src/main/java/com/yeshi/buwan/controller/api/VIPController.java
@@ -28,6 +28,7 @@
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.lang.reflect.Type;
+import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
@@ -92,6 +93,42 @@
         return JsonUtilV2.loadTrueJson(root.toString());
     }
 
+
+    @RequestMapping("getVIPOrderList")
+    @ResponseBody
+    public String getVIPOrderList(AcceptData acceptData, String loginUid, int page) {
+        Gson gson = new GsonBuilder().registerTypeAdapter(VIPPriceType.class, new JsonSerializer<VIPPriceType>() {
+            @Override
+            public JsonElement serialize(VIPPriceType value, Type theType, JsonSerializationContext context) {
+                if (value == null) {
+                    return new JsonPrimitive("");
+                } else {
+                    return new JsonPrimitive(value.getName());
+                }
+            }
+        }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
+            @Override
+            public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
+                if (value == null) {
+                    return new JsonPrimitive("");
+                } else {
+                    return new JsonPrimitive(TimeUtil.getGernalTime(value.getTime(), "yyyy.MM.dd HH:mm"));
+                }
+            }
+        }).create();
+        JSONObject root = new JSONObject();
+
+        List<VIPOrderRecord> list = vipService.listOrderRecord(loginUid, null, page, Constant.pageCount);
+        for (VIPOrderRecord record : list) {
+            record.setIpInfo(null);
+            record.setUpdateTime(null);
+        }
+        long count = vipService.countOrderRecord(loginUid, null);
+        root.put("list", gson.toJson(list));
+        root.put("count", count);
+        return JsonUtilV2.loadTrueJson(root.toString());
+    }
+
     /**
      * 鐢熸垚璁㈠崟
      *

--
Gitblit v1.8.0