section

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 (
	SqlGetAll = "SELECT * FROM section"

	SqlGetById = "SELECT * FROM section WHERE id=?"

	SqlStore = "" /* 211-byte string literal not displayed */

	SqlUpdateSecID = "UPDATE section SET section_number=? WHERE id=?"

	SqlDelete = "DELETE FROM section WHERE id=?"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeError

type CodeError struct {
	Code    int
	Message error
}

type Repository

type Repository interface {
	GetAll() ([]Section, error)
	GetByID(id int) (Section, error)
	Create(secNum, curTemp, minTemp, curCap, minCap, maxCap, wareID, typeID int) (Section, error)
	UpdateSecID(id, secNum int) (Section, CodeError)
	DeleteSection(id int) error
}

func NewRepository

func NewRepository(db *sql.DB) Repository

type Section

type Section struct {
	ID             int `json:"id"`
	SectionNumber  int `json:"section_number"`
	CurTemperature int `json:"current_temperature"`
	MinTemperature int `json:"minimum_temperature"`
	CurCapacity    int `json:"current_capacity"`
	MinCapacity    int `json:"minimum_capacity"`
	MaxCapacity    int `json:"maximum_capacity"`
	WareHouseID    int `json:"warehouse_id"`
	ProductTypeID  int `json:"product_type_id"`
}

type Services

type Services interface {
	GetAll() ([]Section, error)
	GetByID(id int) (Section, error)
	Create(secNum, curTemp, minTemp, curCap, minCap, maxCap, wareID, typeID int) (Section, error)
	UpdateSecID(id, secNum int) (Section, CodeError)
	DeleteSection(id int) error
}

func NewService

func NewService(r Repository) Services

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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