26 lines
644 B
Go
26 lines
644 B
Go
package productsRepo
|
|
|
|
import (
|
|
"git.ma-al.com/goc_daniel/b2b/app/db"
|
|
)
|
|
|
|
type UIProductsRepo interface {
|
|
GetJSON(p_id_product, p_id_shop, p_id_lang, p_id_customer, b2b_id_country, p_quantity int) (*string, error)
|
|
}
|
|
|
|
type ProductsRepo struct{}
|
|
|
|
func New() UIProductsRepo {
|
|
return &ProductsRepo{}
|
|
}
|
|
|
|
func (repo *ProductsRepo) GetJSON(p_id_product, p_id_shop, p_id_lang, p_id_customer, b2b_id_country, p_quantity int) (*string, error) {
|
|
var product string
|
|
|
|
err := db.DB.Raw(`CALL get_full_product(?,?,?,?,?,?)`, p_id_product, p_id_shop, p_id_lang, p_id_customer, b2b_id_country, p_quantity).
|
|
Scan(&product).
|
|
Error
|
|
|
|
return &product, err
|
|
}
|