favlist

package
v0.0.0-...-c74069a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FavCoin

type FavCoin struct {
	ID           string `json:"id" bson:"id"`
	Symbol       string `json:"symbol" bson:"symbol"`
	CurrentPrice string `json:"current_price" bson:"current_price"`
	UserID       string `json:"user_id" bson:"user_id"`
}

type FavCoinDTO

type FavCoinDTO struct {
	Symbol       string `json:"symbol"`
	CurrentPrice string `json:"current_price"`
	UserID       string `json:"user_id"`
}

type FavCoinEntity

type FavCoinEntity struct {
	ID           string `bson:"id"`
	Symbol       string `bson:"symbol"`
	CurrentPrice string `bson:"current_price"`
	UserID       string `bson:"user_id"`
}

type Handler

type Handler struct {
	Service Service
}

func NewHandler

func NewHandler(service Service) Handler

func (*Handler) CreateFavCoinHandler

func (h *Handler) CreateFavCoinHandler(c *fiber.Ctx) error

func (*Handler) GetFavlistHandler

func (h *Handler) GetFavlistHandler(c *fiber.Ctx) error

func (*Handler) SetupApp

func (h *Handler) SetupApp(app *fiber.App)

type Repository

type Repository struct {
	MongoClient *mongo.Client
}

func NewRepository

func NewRepository(uri string) Repository

func (*Repository) CreateFavCoin

func (r *Repository) CreateFavCoin(favCoin FavCoin) (*FavCoin, error)

func (*Repository) GetFavCoinWithID

func (r *Repository) GetFavCoinWithID(ID string) (*FavCoin, error)

func (*Repository) GetFavlistHistory

func (r *Repository) GetFavlistHistory(UserID string) ([]FavCoin, error)

type Service

type Service struct {
	Repository Repository
}

func NewService

func NewService(repository Repository) Service

func (*Service) CreateFavCoin

func (s *Service) CreateFavCoin(favCoinDTO FavCoinDTO) (*FavCoin, error)

func (*Service) GetTransactionHistory

func (s *Service) GetTransactionHistory(userId string) ([]FavCoin, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL