class AdminController {

	@PostMapping("/{provider}/{code}")
	public Response add(Locale l, @PathVariable String code, @PathVariable String provider) throws IOException {

		Response response = new Response();

		SymbolInfo si = adminService.add(code, provider);

		Object[] args = { si.getName(), si.getCode(), si.getQuote().getPrice(), si.getQuote().getCurrency(), si.getQuote().getTime() };
		response.setMessage(messageSource.getMessage("symbols.success.add", args, l));
		response.setMessageTitle(messageSource.getMessage("success", null, l));

		if (!si.isHistoryFound()) {
			response.setWarningMessage(messageSource.getMessage("symbols.warning.no_historical_data", new Object[] { si.getCode() }, l));
		}
		
		return response;
	}

}