28 lines
543 B
Go
28 lines
543 B
Go
package services
|
|
|
|
import (
|
|
errs "sqlc_example/internal/errors"
|
|
"sqlc_example/models/dto"
|
|
|
|
"github.com/jackc/pgx/v5/pgxpool"
|
|
)
|
|
|
|
type FoodService interface {
|
|
AddFoodItem(obj dto.NewFoodItemDTO) (string, *errs.HTTPErrWrapper)
|
|
}
|
|
|
|
type foodServiceImpl struct {
|
|
pool *pgxpool.Pool
|
|
}
|
|
|
|
// AddFoodItem implements FoodService.
|
|
func (f *foodServiceImpl) AddFoodItem(obj dto.NewFoodItemDTO) (string, *errs.HTTPErrWrapper) {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
func NewFoodService(pool *pgxpool.Pool) FoodService {
|
|
return &foodServiceImpl{
|
|
pool: pool,
|
|
}
|
|
}
|