code refactor

This commit is contained in:
MaysWind
2024-11-17 13:04:07 +08:00
parent 69498003d8
commit 8f944b1b46
15 changed files with 159 additions and 43 deletions
@@ -1,14 +1,16 @@
package exchangerates
import (
"net/http"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/models"
)
// ExchangeRatesDataSource defines the structure of exchange rates data source
type ExchangeRatesDataSource interface {
// GetRequestUrl returns the data source urls
GetRequestUrls() []string
// BuildRequests returns the http requests
BuildRequests() ([]*http.Request, error)
// Parse returns the common response entity according to the data source raw response
Parse(c core.Context, content []byte) (*models.LatestExchangeRateResponse, error)