locality

package
v0.0.0-...-e85e4ab Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET_REPORT_SELLER = "" /* 126-byte string literal not displayed */
	INSERT            = "INSERT INTO localities (zip_code, locality_name, province_name, country_name) VALUES (?,?,?,?)"
	GETALL            = "SELECT * FROM localities"
	GETBYID           = "SELECT * FROM localities WHERE id = ?"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Locality

type Locality struct {
	Id           int    `json:"id"`
	ZipCode      string `json:"zip_code"`
	LocalityName string `json:"locality_name"`
	ProvinceName string `json:"province_name"`
	CountryName  string `json:"country_name"`
}

type ReportSeller

type ReportSeller struct {
	LocalityID   int    `json:"locality_id"`
	LocalityName string `json:"locality_name"`
	SellersCount int    `json:"sellers_count"`
}

type Repository

type Repository interface {
	GetAll(ctx context.Context) ([]Locality, error)
	GetById(ctx context.Context, id int) (Locality, error)
	Create(ctx context.Context, zipCode, localityName, provinceName, countryName string) (Locality, error)
	ReportSellers(ctx context.Context, id int) (ReportSeller, error)
}

func NewMariaDBRepository

func NewMariaDBRepository(db *sql.DB) Repository

type Service

type Service interface {
	GetAll(ctx context.Context) ([]Locality, error)
	GetById(ctx context.Context, id int) (Locality, error)
	ReportSellers(ctx context.Context, id int) (ReportSeller, error)
	Create(ctx context.Context, zipCode, localityName, provinceName, countryName string) (Locality, error)
}

func NewService

func NewService(r Repository) Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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