feat: creat main products query
This commit is contained in:
25
app/repos/productsRepo/productsRepo.go
Normal file
25
app/repos/productsRepo/productsRepo.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user