| | |
| | | @RequestMapping("getGoldCrudeOil.do") |
| | | @ResponseBody |
| | | public ServerResponse getGoldCrudeOil(HttpServletRequest request) { |
| | | |
| | | String gold = RedisShardedPoolUtils.get(RedisKeyConstant.gold); |
| | | String crudeOil = RedisShardedPoolUtils.get(RedisKeyConstant.crude_oil); |
| | | HashMap<String,String> map = new HashMap<>(); |
| | | map.put(new GoogleTranslateUtil().translate("GOLD",request.getHeader("lang")),gold); |
| | | map.put(new GoogleTranslateUtil().translate("CRUDE OIL",request.getHeader("lang")),crudeOil); |
| | | return ServerResponse.createBySuccess(map); |
| | | |
| | | HashMap<String,HashMap> hashMap = new HashMap<>(); |
| | | |
| | | HashMap<String,String> goldMap = new HashMap<>(); |
| | | String goldName = new GoogleTranslateUtil().translate("GOLD", request.getHeader("lang")); |
| | | goldMap.put(goldName,gold); |
| | | hashMap.put("GOLD",goldMap); |
| | | |
| | | HashMap<String,String> crudOilMap = new HashMap<>(); |
| | | String crudeOilName = new GoogleTranslateUtil().translate("CRUDE OIL", request.getHeader("lang")); |
| | | crudOilMap.put(crudeOilName,crudeOil); |
| | | hashMap.put("CRUDE OIL",crudOilMap); |
| | | |
| | | return ServerResponse.createBySuccess(hashMap); |
| | | } |
| | | |
| | | |