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 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
Click to show internal directories.
Click to hide internal directories.