| | |
| | | import com.nq.pojo.SiteSetting; |
| | | import com.nq.service.IStockService; |
| | | import com.nq.service.StockDzService; |
| | | import com.nq.utils.redis.RedisKeyConstant; |
| | | import com.nq.utils.redis.RedisShardedPoolUtils; |
| | | import com.nq.utils.translate.GoogleTranslateUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | |
| | | @Controller |
| | | @RequestMapping({"/api/stock/"}) |
| | |
| | | return this.iStockService.getStockByType(pageNum, pageSize, orderBy,keyWords , stockType, request); |
| | | } |
| | | |
| | | @RequestMapping("getGoldCrudeOil.do") |
| | | @ResponseBody |
| | | public ServerResponse getGoldCrudeOil(HttpServletRequest request) { |
| | | |
| | | String gold = RedisShardedPoolUtils.get(RedisKeyConstant.gold); |
| | | String crudeOil = RedisShardedPoolUtils.get(RedisKeyConstant.crude_oil); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("getOptionStock.do") |