cinsiyet eklenior
This commit is contained in:
parent
144db0a55b
commit
36a65611e3
|
|
@ -227,6 +227,8 @@ func getCats(db *gorm.DB, catIDs []int) ([]gm.Category, string, error) {
|
|||
}
|
||||
}
|
||||
|
||||
log.Println(keywords)
|
||||
|
||||
return categories, keywords, nil
|
||||
}
|
||||
|
||||
|
|
@ -245,6 +247,8 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
|
|||
return errCat
|
||||
}
|
||||
|
||||
return tx.Rollback().Error
|
||||
|
||||
brand, err := gm.FindOrCreateBrand(&tx, product.Brand, categories)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
package controller
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package repositories
|
||||
|
||||
import (
|
||||
gm "db_service/gorm_models"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Importer struct {
|
||||
mainCategories []gm.Category
|
||||
baza *gorm.DB
|
||||
families []gm.AttributeFamily
|
||||
}
|
||||
|
||||
func ImporterInstance() Importer {
|
||||
return Importer{}
|
||||
}
|
||||
Loading…
Reference in New Issue