| | |
| | | |
| | | 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; |
| | |
| | | |
| | | @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(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @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()); |
| | |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | | |
| | | |
| | | } |