Ejemplo n.º 1
0
 @GET
 @RequestMapping("/multiply/{names}")
 @Produces(MediaType.APPLICATION_JSON)
 public List<StockVo> getTwoStocks(@PathVariable("names") String names) {
   List<StockVo> array = new ArrayList<>();
   if (names != null) {
     String[] stringLets = names.split(" ");
     for (int i = 0; i < stringLets.length; i++) {
       if (StringPatternAware.isStockCode(stringLets[i])) {
         array.add(stocksService.queryStock(stringLets[i]));
       }
     }
   }
   return array;
 }
Ejemplo n.º 2
0
 @GET
 @RequestMapping("/{name}")
 @Produces(MediaType.APPLICATION_JSON)
 public StockVo getStock(@PathVariable("name") String name) {
   return stocksService.queryStock(name);
 }