| | |
| | | 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,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); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("getOptionStock.do") |