コード例 #1
0
  @RequestMapping(method = RequestMethod.GET)
  public @ResponseBody ResponseEntity<String> getList() {
    System.out.println("getTempList");
    Gson gson = new Gson();
    List<SymbolTradableDaily> list = null;
    String payload = "";
    try {
      list = service.selectSymbolTradableDailyTemp();
    } catch (Exception e) {
      return new ResponseEntity<String>(
          gson.toJson(exceptionToJson(e)), HttpStatus.SERVICE_UNAVAILABLE);
    }

    payload = gson.toJson(list);
    return getResponseEntity(payload);
  }
コード例 #2
0
  @RequestMapping(
      value = "/exchange/{exchange_id}/mainSymbol/{main_symbol_id}",
      method = RequestMethod.GET)
  public @ResponseBody ResponseEntity<String> getList(
      @PathVariable("exchange_id") String exchange_id,
      @PathVariable("main_symbol_id") String main_symbol_id) {
    System.out.println("getListByMainSymbol");
    Gson gson = new Gson();
    List<SymbolTradableDaily> list = null;
    String payload = "";
    try {
      MainSymbol mainSymbol = new MainSymbol();
      mainSymbol.setExchange_id(exchange_id);
      mainSymbol.setMain_symbol_id(main_symbol_id);
      list = service.selectSymbolTradableDailyTemp(mainSymbol);
    } catch (Exception e) {
      return new ResponseEntity<String>(
          gson.toJson(exceptionToJson(e)), HttpStatus.SERVICE_UNAVAILABLE);
    }

    payload = gson.toJson(list);
    return getResponseEntity(payload);
  }