fix #17
36
sync.go
36
sync.go
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue