Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

tickers/all endpoint Implementation #376

Closed
wants to merge 3 commits into from
Closed

tickers/all endpoint Implementation #376

wants to merge 3 commits into from

Conversation

anthonyw3
Copy link

@anthonyw3 anthonyw3 commented Feb 14, 2021

No description provided.

@@ -47,6 +47,9 @@ func SetupTickersAPI(engine *gin.Engine, tickers controllers.TickersController,
engine.GET("v2/market/ticker/:id",
middleware.CacheControl(d, endpoint.GetTickerHandlerV2(tickers)))

engine.GET("v2/market/tickers/",
Copy link
Author

@anthonyw3 anthonyw3 Feb 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to conflicts with the existing wildcard (gin-gonic/gin#1301) added v2/market/tickers/ instead of v2/market/tickers/all, which basically follows RESTful design

func (c Controller) getBaseTickers() (watchmarket.Tickers, error) {
dbTickers, err := c.database.GetBaseTickers()
if err != nil {
log.Error(err, "getBaseTickers")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log is not needed here

@@ -50,6 +50,14 @@ func (c Controller) HandleTickersRequestV2(tr controllers.TickerRequestV2) (cont
return createResponseV2(tr, tickers), nil
}

func (c Controller) getTickers(tr controllers.TickerRequestV2) (watchmarket.Tickers, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid having fallback to all tickers if Ids not specific

@anthonyw3 anthonyw3 closed this by deleting the head repository Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants