Class MarketPriceApiController
java.lang.Object
com.bluebell.greenhouse.planter.controllers.market.price.MarketPriceApiController
@RestController
@RequestMapping("${bluebell.base.api.controller.endpoint}/market-price")
@CrossOrigin(origins="*",
methods={GET,DELETE,POST,PUT})
public class MarketPriceApiController
extends Object
Api controller for
MarketPrice.- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> deleteMarketPrice(String uid) Deletes an existingMarketPrice.org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> getMarketPriceReport(String symbolAliasUid, String priceInterval, String start, String end, String dateTimeFormat) Generates a csv report for the given symbol alias and time interval.Returns aResponseEntitycontaining allMarketTimeIntervals.org.springframework.http.ResponseEntity<MarketPriceDTO> postCreateNewMarketPrice(@Valid CreateUpdateMarketPriceDTO data) Creates a newMarketPrice.org.springframework.http.ResponseEntity<Boolean> postImportMarketPrices(String symbolAliasUid, String priceInterval, String dateTimeFormat, String timeZone, org.springframework.web.multipart.MultipartFile file) Imports market prices from a csv/txt file.org.springframework.http.ResponseEntity<Boolean> postIngestMarketPriceDataFromMT4(@Valid MT4MarketData data) Saves MT4 market data to the database.org.springframework.http.ResponseEntity<JobSubmissionDTO> Manually queues a refresh of FirstRateData (FRD) market data.org.springframework.http.ResponseEntity<MarketPriceDTO> putUpdateMarketPrice(String uid, @Valid CreateUpdateMarketPriceDTO data) Updates an existingMarketPrice.org.springframework.http.ResponseEntity<PaginatedMarketPriceDTO> searchMarketPrices(MarketPriceSearchRequest searchRequest) Returns a paginatedResponseEntitycontainingMarketPriceDTOs filtered by the given criteria.
-
Constructor Details
-
MarketPriceApiController
public MarketPriceApiController()
-
-
Method Details
-
getTimeIntervals
@GetMapping("/time-intervals") public org.springframework.http.ResponseEntity<List<PairEntry>> getTimeIntervals()Returns aResponseEntitycontaining allMarketTimeIntervals.- Returns:
ResponseEntity
-
searchMarketPrices
@GetMapping("/search") public org.springframework.http.ResponseEntity<PaginatedMarketPriceDTO> searchMarketPrices(@ModelAttribute MarketPriceSearchRequest searchRequest) Returns a paginatedResponseEntitycontainingMarketPriceDTOs filtered by the given criteria.- Parameters:
searchRequest-MarketPriceSearchRequest- Returns:
ResponseEntity
-
getMarketPriceReport
@GetMapping(value="/get-report", produces="text/csv") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> getMarketPriceReport(@RequestParam("symbolAliasUid") String symbolAliasUid, @RequestParam("priceInterval") String priceInterval, @RequestParam(value="start",required=false) String start, @RequestParam(value="end",required=false) String end, @RequestParam(value="dateTimeFormat",required=false) String dateTimeFormat) throws IOException Generates a csv report for the given symbol alias and time interval.- Parameters:
symbolAliasUid- symbol alias uidpriceInterval-MarketTimeIntervalstart- optional start date/timeend- optional end date/timedateTimeFormat- optional date time format- Returns:
ResponseEntitywithStreamingResponseBodyfor download- Throws:
IOException- io file exception
-
postImportMarketPrices
@PostMapping(value="/import-market-prices", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<Boolean> postImportMarketPrices(@RequestParam("symbolAliasUid") String symbolAliasUid, @RequestParam("priceInterval") String priceInterval, @RequestParam(value="dateTimeFormat",required=false) String dateTimeFormat, @RequestParam(value="timeZone",required=false) String timeZone, @RequestPart("file") org.springframework.web.multipart.MultipartFile file) throws IOException Imports market prices from a csv/txt file.- Parameters:
symbolAliasUid- symbol alias uidpriceInterval-MarketTimeIntervaldateTimeFormat- optional date time formattimeZone- optional timezone for non-offset timestamps in the import filefile- multipart file- Returns:
ResponseEntity- Throws:
IOException- io exception
-
postCreateNewMarketPrice
@PostMapping("/create-market-price") public org.springframework.http.ResponseEntity<MarketPriceDTO> postCreateNewMarketPrice(@Valid @RequestBody @Valid CreateUpdateMarketPriceDTO data) Creates a newMarketPrice.- Parameters:
data-CreateUpdateMarketPriceDTO- Returns:
ResponseEntity
-
postIngestMarketPriceDataFromMT4
@PostMapping("/ingest-market-data-mt4") public org.springframework.http.ResponseEntity<Boolean> postIngestMarketPriceDataFromMT4(@Valid @RequestBody @Valid MT4MarketData data) Saves MT4 market data to the database.- Parameters:
data-MT4MarketData- Returns:
ResponseEntity
-
postRefreshFRDData
@PostMapping("/refresh-frd") public org.springframework.http.ResponseEntity<JobSubmissionDTO> postRefreshFRDData()Manually queues a refresh of FirstRateData (FRD) market data.- Returns:
ResponseEntity
-
putUpdateMarketPrice
@PutMapping("/update-market-price") public org.springframework.http.ResponseEntity<MarketPriceDTO> putUpdateMarketPrice(@RequestParam("uid") String uid, @Valid @RequestBody @Valid CreateUpdateMarketPriceDTO data) Updates an existingMarketPrice.- Parameters:
uid- market price uiddata-CreateUpdateMarketPriceDTO- Returns:
ResponseEntity
-
deleteMarketPrice
@DeleteMapping("/delete-market-price") public org.springframework.http.ResponseEntity<Void> deleteMarketPrice(@RequestParam("uid") String uid) Deletes an existingMarketPrice.- Parameters:
uid- market price uid- Returns:
ResponseEntity
-