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 Details

    • MarketPriceApiController

      public MarketPriceApiController()
  • Method Details

    • getTimeIntervals

      @GetMapping("/time-intervals") public org.springframework.http.ResponseEntity<List<PairEntry>> getTimeIntervals()
      Returns a ResponseEntity containing all MarketTimeIntervals.
      Returns:
      ResponseEntity
    • searchMarketPrices

      @GetMapping("/search") public org.springframework.http.ResponseEntity<PaginatedMarketPriceDTO> searchMarketPrices(@ModelAttribute MarketPriceSearchRequest searchRequest)
      Returns a paginated ResponseEntity containing MarketPrice DTOs 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 uid
      priceInterval - MarketTimeInterval
      start - optional start date/time
      end - optional end date/time
      dateTimeFormat - optional date time format
      Returns:
      ResponseEntity with StreamingResponseBody for 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 uid
      priceInterval - MarketTimeInterval
      dateTimeFormat - optional date time format
      timeZone - optional timezone for non-offset timestamps in the import file
      file - 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 new MarketPrice.
      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 existing MarketPrice.
      Parameters:
      uid - market price uid
      data - CreateUpdateMarketPriceDTO
      Returns:
      ResponseEntity
    • deleteMarketPrice

      @DeleteMapping("/delete-market-price") public org.springframework.http.ResponseEntity<Void> deleteMarketPrice(@RequestParam("uid") String uid)
      Deletes an existing MarketPrice.
      Parameters:
      uid - market price uid
      Returns:
      ResponseEntity