Documentation ¶
Index ¶
Constants ¶
View Source
const ( SqlGetAll = "SELECT * FROM employees" SqlGetById = "SELECT * FROM employees WHERE id=?" SqlCreate = "INSERT INTO employees (`card_number_id`, `first_name`, `last_name`, `warehouse_id`) VALUES (?, ?, ?, ?)" SqlUpdateFirstName = "UPDATE employees SET first_name=? WHERE id=?" SqlUpdate = "UPDATE employees SET first_name=?, last_name=?, warehouse_id=? WHERE id=?" SqlDelete = "DELETE FROM employees WHERE id=?" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmployeeInboundOrders ¶
type EmployeeOrderCount ¶
type Repository ¶
type Repository interface { Create(cardNum int, firstName string, lastName string, warehouseId int) (Employee, error) GetAll() ([]Employee, error) Delete(id int) error GetById(id int) (Employee, error) Update(id int, firstName string, lastName string, warehouseId int) (Employee, error) }
func NewRepository ¶
func NewRepository(db *sql.DB) Repository
type Services ¶
type Services interface { Create(cardNum int, firstName string, lastName string, warehouseId int) (Employee, error) GetAll() ([]Employee, error) Delete(id int) error GetById(id int) (Employee, error) Update(emp Employee, id int) (Employee, error) GetCount(id, counter int) (EmployeeOrderCount, error) }
func NewService ¶
func NewService(r Repository) Services
Click to show internal directories.
Click to hide internal directories.