From 6cc97918a5a42e37a3c3867cc5b78a0b9fd43a24 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 29 四月 2022 19:55:41 +0800 Subject: [PATCH] 功能完善 --- app/src/main/java/com/yeshi/makemoney/app/controller/admin/goldcorn/GoldCornGetPriceAdminController.java | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/yeshi/makemoney/app/controller/admin/goldcorn/GoldCornGetPriceAdminController.java b/app/src/main/java/com/yeshi/makemoney/app/controller/admin/goldcorn/GoldCornGetPriceAdminController.java index 6c8989b..82e7722 100644 --- a/app/src/main/java/com/yeshi/makemoney/app/controller/admin/goldcorn/GoldCornGetPriceAdminController.java +++ b/app/src/main/java/com/yeshi/makemoney/app/controller/admin/goldcorn/GoldCornGetPriceAdminController.java @@ -2,6 +2,7 @@ import com.google.gson.*; import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType; +import com.yeshi.makemoney.app.entity.goldcorn.GoldCornPriceCountType; import com.yeshi.makemoney.app.vo.AcceptAdminData; import com.yeshi.makemoney.app.vo.admin.goldcorn.GoldCornGetPriceAdminVO; import net.sf.json.JSONArray; @@ -47,6 +48,12 @@ @Override public JsonElement serialize(GoldCornGetType value, Type type, JsonSerializationContext jsonSerializationContext) { + return value == null ? new JsonPrimitive("") : new JsonPrimitive(value.getName()); + } + }).registerTypeAdapter(GoldCornPriceCountType.class, new JsonSerializer<GoldCornPriceCountType>() { + + @Override + public JsonElement serialize(GoldCornPriceCountType value, Type type, JsonSerializationContext jsonSerializationContext) { return value == null ? new JsonPrimitive("") : new JsonPrimitive(value.getName()); } }).create(); @@ -110,11 +117,12 @@ } + @ResponseBody - @RequestMapping("getPriceTypes") - public String getPriceTypes(HttpSession session) { + @RequestMapping("getCountTypeList") + public String getCountTypeList() { JSONArray array = new JSONArray(); - for (GoldCornGetType type : GoldCornGetType.values()) { + for (GoldCornPriceCountType type : GoldCornPriceCountType.values()) { JSONObject json = new JSONObject(); json.put("key", type.name()); json.put("value", type.getName()); @@ -122,6 +130,5 @@ } return JsonUtil.loadTrueResult(array); } - } -- Gitblit v1.8.0