PortfolioController

@RestController
@RequestMapping(value = "/api/portfolio")
open class PortfolioController

Constructors

Link copied to clipboard
@Autowired
constructor(authContextService: AuthContextService, portfolioService: PortfolioService)

Functions

Link copied to clipboard
@PostMapping(value = "/add")
@PreAuthorize(value = "isAuthenticated()")
open fun addPortfolioAsset(@AuthenticationPrincipal user: ProductUser, @RequestBody portfolioAssetRequest: PortfolioAssetRequest): ResponseEntity<OperationSuccessfulResponse>
Link copied to clipboard
@GetMapping(value = "/empty")
@PreAuthorize(value = "isAuthenticated()")
open fun emptyPortfolio(@AuthenticationPrincipal user: ProductUser): ResponseEntity<HasPortfolioResponse>
Link copied to clipboard
@GetMapping(value = "/get")
@PreAuthorize(value = "isAuthenticated()")
open fun getPortfolio(@AuthenticationPrincipal user: ProductUser): ResponseEntity<PortfolioResponse>
Link copied to clipboard
@GetMapping(value = "/history/get/asset")
@PreAuthorize(value = "isAuthenticated()")
open fun getPortfolioAssetHistory(@AuthenticationPrincipal user: ProductUser): ResponseEntity<List<PortfolioAssetHistory>>
Link copied to clipboard
@GetMapping(value = "/history/get/asset/{currencyName}")
@PreAuthorize(value = "isAuthenticated()")
open fun getPortfolioAssetHistoryByCurrency(@AuthenticationPrincipal user: ProductUser, @PathVariable currencyName: String): ResponseEntity<List<PortfolioAssetHistory>>
Link copied to clipboard
@GetMapping(value = "/history/get")
@PreAuthorize(value = "isAuthenticated()")
open fun getPortfolioHistory(@AuthenticationPrincipal user: ProductUser): ResponseEntity<List<PortfolioHistory>>
Link copied to clipboard
@GetMapping(value = "/history/profit")
@PreAuthorize(value = "isAuthenticated()")
open fun getPortfolioProfit(@AuthenticationPrincipal user: ProductUser): ResponseEntity<AssetValueResponse>
Link copied to clipboard
@GetMapping(value = "/history/profit/{currencyName}")
@PreAuthorize(value = "isAuthenticated()")
open fun getPortfolioProfitByCurrency(@AuthenticationPrincipal user: ProductUser, @PathVariable currencyName: String): ResponseEntity<AssetValueResponse>