banner

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Banner struct {
	ID    string `json:"id"`
	Image string `json:"image"`
	Url   string `json:"url"`
}

type BannerDTO

type BannerDTO struct {
	Image string `json:"image"`
	Url   string `json:"url"`
}

type BannerEntity

type BannerEntity struct {
	ID    string `json:"id"`
	Image string `json:"image"`
	Url   string `json:"url"`
}

type BannerList

type BannerList struct {
	Banner []Banner `json:"coins"`
}

type Handler

type Handler struct {
	Service Service
}

func NewHandler

func NewHandler(service Service) Handler

func (*Handler) BannersListHandler

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

func (*Handler) CreateBanner

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

func (*Handler) DeleteBannerHandler

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

func (*Handler) GetBannerHandler

func (h *Handler) GetBannerHandler(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) CreateBanner

func (r *Repository) CreateBanner(banner Banner) (*Banner, error)

func (*Repository) DeleteBanner

func (r *Repository) DeleteBanner(id string) error

func (*Repository) GetBannerByID

func (r *Repository) GetBannerByID(id string) (*Banner, error)

type Service

type Service struct {
	Repository Repository
}

func NewService

func NewService(repository Repository) Service

func (*Service) BannerList

func (s *Service) BannerList() ([]Banner, error)

func (*Service) CreateBanner

func (s *Service) CreateBanner(bannerDTO BannerDTO) (*Banner, error)

func (*Service) DeleteNews

func (s *Service) DeleteNews(dto string) error

func (*Service) GetBanner

func (s *Service) GetBanner(bannerID string) (*Banner, error)

Jump to

Keyboard shortcuts

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