fix #17

Merged
milano15662 merged 1 commits from develop into master 2022-03-25 08:56:17 +00:00
1 changed files with 18 additions and 18 deletions

36
sync.go
View File

@ -10,91 +10,91 @@ import (
type Sync struct{}
// SyncProduct ...
func (Sync) SyncProduct(productID string, productJSONString string) {
func (Sync) SyncProduct(productID string, product interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncProduct, productID)
// Set redis
redisdb.SetKeyValue(ctx, key, productJSONString)
redisdb.SetKeyValue(ctx, key, product)
return
}
// SyncBrand ...
func (Sync) SyncBrand(brandID, brandJSONString string) {
func (Sync) SyncBrand(brandID string, brand interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncBrand, brandID)
// Set redis
redisdb.SetKeyValue(ctx, key, brandJSONString)
redisdb.SetKeyValue(ctx, key, brand)
return
}
// SyncSupplier ...
func (Sync) SyncSupplier(supplierID, supplierJSONString string) {
func (Sync) SyncSupplier(supplierID string, supplier interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncSupplier, supplierID)
// Set redis
redisdb.SetKeyValue(ctx, key, supplierJSONString)
redisdb.SetKeyValue(ctx, key, supplier)
return
}
// SyncInventory ...
func (Sync) SyncInventory(inventoryID, inventoryJSONString string) {
func (Sync) SyncInventory(inventoryID string, inventory interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncInventory, inventoryID)
// Set redis
redisdb.SetKeyValue(ctx, key, inventoryJSONString)
redisdb.SetKeyValue(ctx, key, inventory)
return
}
// SyncCategory ...
func (Sync) SyncCategory(categoryID, categoryJSONString string) {
func (Sync) SyncCategory(categoryID string, category interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncCategory, categoryID)
// Set redis
redisdb.SetKeyValue(ctx, key, categoryJSONString)
redisdb.SetKeyValue(ctx, key, category)
return
}
// SyncSubCategory ...
func (Sync) SyncSubCategory(subcategoryID, subCategoryJSONString string) {
func (Sync) SyncSubCategory(subcategoryID string, value interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncSubCategory, subcategoryID)
// Set redis
redisdb.SetKeyValue(ctx, key, subCategoryJSONString)
redisdb.SetKeyValue(ctx, key, value)
return
}
// SyncProperty ...
func (Sync) SyncProperty(propertyID, propertyJSONString string) {
func (Sync) SyncProperty(propertyID string, value interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncProperty, propertyID)
// Set redis
redisdb.SetKeyValue(ctx, key, propertyJSONString)
redisdb.SetKeyValue(ctx, key, value)
return
}
// SyncPropertyValue ...
func (Sync) SyncPropertyValue(propertyValueID, propertyValueJSONString string) {
func (Sync) SyncPropertyValue(propertyValueID string, value interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncPropertyValue, propertyValueID)
// Set redis
redisdb.SetKeyValue(ctx, key, propertyValueJSONString)
redisdb.SetKeyValue(ctx, key, value)
return
}
// SyncSKU ...
func (Sync) SyncSKU(skuID, skuJSONString string) {
func (Sync) SyncSKU(skuID string, value interface{}) {
ctx := context.Background()
key := getRedisKey(RedisSyncSKU, skuID)
// Set redis
redisdb.SetKeyValue(ctx, key, skuJSONString)
redisdb.SetKeyValue(ctx, key, value)
return
}