admin
2021-03-20 ad3ac53da1c3a11a96ae62d790aa61a81b9eab91
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());
    }
    /**
     * 生成订单
     *