- 修复之前将老平台同步逻辑注释掉引入的BUG

This commit is contained in:
gazebo
2019-08-14 00:20:35 +08:00
parent 18ad339e0c
commit 03e23ca0fd
7 changed files with 111 additions and 118 deletions

View File

@@ -169,16 +169,16 @@ type IMultipleStoresHandler interface {
UpdateSku(db *dao.DaoDB, sku *model.Sku, userName string) (err error)
DeleteSku(db *dao.DaoDB, sku *model.Sku, userName string) (err error)
RefreshAllSkusID(ctx *jxcontext.Context, parentTask tasksch.ITask, isAsync bool) (hint string, err error)
// RefreshAllSkusID(ctx *jxcontext.Context, parentTask tasksch.ITask, isAsync bool) (hint string, err error)
GetSkus(ctx *jxcontext.Context, skuID int, vendorSkuID, skuName string) (skuNameList []*SkuNameInfo, err error)
}
type ISingleStoreHandler interface {
IPurchasePlatformHandler
SyncStoreCategory(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync bool) (hint string, err error)
// SyncStoreCategory(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync bool) (hint string, err error)
RefreshStoresAllSkusID(ctx *jxcontext.Context, parentTask tasksch.ITask, isAsync bool, storeIDs []int) (hint string, err error)
// RefreshStoresAllSkusID(ctx *jxcontext.Context, parentTask tasksch.ITask, isAsync bool, storeIDs []int) (hint string, err error)
}
type BasePurchasePlatform struct {

View File

@@ -2,38 +2,36 @@ package ebai
import (
"testing"
"time"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/model/dao"
)
func TestSyncStoresSkus(t *testing.T) {
skus := make([]int, 100)
for i := 0; i < 100; i++ {
skus[i] = i + 1
}
_, err := CurPurchaseHandler.SyncStoreSkus(jxcontext.AdminCtx, nil, testShopID, skus, false, false)
if err != nil {
t.Fatal(err.Error())
}
time.Sleep(4 * time.Second)
}
// func TestSyncStoresSkus(t *testing.T) {
// skus := make([]int, 100)
// for i := 0; i < 100; i++ {
// skus[i] = i + 1
// }
// _, err := CurPurchaseHandler.SyncStoreSkus(jxcontext.AdminCtx, nil, testShopID, skus, false, false)
// if err != nil {
// t.Fatal(err.Error())
// }
// time.Sleep(4 * time.Second)
// }
func TestSyncOneStoreCategoriesFromRemote2Local(t *testing.T) {
db := dao.GetDB()
err := CurPurchaseHandler.SyncLocalStoreCategory(db, testShopID, "autotest")
if err != nil {
t.Fatal(err.Error())
}
}
// func TestSyncOneStoreCategoriesFromRemote2Local(t *testing.T) {
// db := dao.GetDB()
// err := CurPurchaseHandler.SyncLocalStoreCategory(db, testShopID, "autotest")
// if err != nil {
// t.Fatal(err.Error())
// }
// }
func TestSyncOneStoreCategoriesFromLocal2Remote(t *testing.T) {
_, err := CurPurchaseHandler.SyncStoreCategory(jxcontext.AdminCtx, nil, testShopID, false)
if err != nil {
t.Fatal(err.Error())
}
}
// func TestSyncOneStoreCategoriesFromLocal2Remote(t *testing.T) {
// _, err := CurPurchaseHandler.SyncStoreCategory(jxcontext.AdminCtx, nil, testShopID, false)
// if err != nil {
// t.Fatal(err.Error())
// }
// }
func TestGetAllRemoteSkus(t *testing.T) {
result, err := CurPurchaseHandler.GetStoreSkusFullInfo(jxcontext.AdminCtx, nil, testShopID, testShopBaiduID, nil)

View File

@@ -1,21 +1,16 @@
package elm
import (
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
)
func (p *PurchaseHandler) SyncStoreCategory(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync bool) (hint string, err error) {
return "", nil
}
// func (p *PurchaseHandler) SyncStoreCategory(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync bool) (hint string, err error) {
// return "", nil
// }
// func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, skuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
// return hint, err
// }
func (p *PurchaseHandler) RefreshStoresAllSkusID(ctx *jxcontext.Context, parentTask tasksch.ITask, isAsync bool, storeIDs []int) (hint string, err error) {
return hint, err
}
// func (p *PurchaseHandler) RefreshStoresAllSkusID(ctx *jxcontext.Context, parentTask tasksch.ITask, isAsync bool, storeIDs []int) (hint string, err error) {
// return hint, err
// }
// func (p *PurchaseHandler) FullSyncStoreSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync, isContinueWhenError bool) (hint string, err error) {
// return hint, err

View File

@@ -7,29 +7,29 @@ import (
// _ "git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
)
func TestSyncStoreCategory(t *testing.T) {
hint, err := curPurchaseHandler.SyncStoreCategory(jxcontext.AdminCtx, nil, testShopID, false)
if err != nil {
t.Fatal(err)
}
t.Log(hint)
}
// func TestSyncStoreCategory(t *testing.T) {
// hint, err := curPurchaseHandler.SyncStoreCategory(jxcontext.AdminCtx, nil, testShopID, false)
// if err != nil {
// t.Fatal(err)
// }
// t.Log(hint)
// }
func TestSyncLocalStoreCategory(t *testing.T) {
hint, err := curPurchaseHandler.SyncLocalStoreCategory(jxcontext.AdminCtx, nil, testShopID, true, nil)
if err != nil {
t.Fatal(err)
}
t.Log(hint)
}
// func TestSyncLocalStoreCategory(t *testing.T) {
// hint, err := curPurchaseHandler.SyncLocalStoreCategory(jxcontext.AdminCtx, nil, testShopID, true, nil)
// if err != nil {
// t.Fatal(err)
// }
// t.Log(hint)
// }
func TestSyncStoreSkus(t *testing.T) {
hint, err := curPurchaseHandler.SyncStoreSkus(jxcontext.AdminCtx, nil, testShopID, nil, false, true)
if err != nil {
t.Fatal(err)
}
t.Log(hint)
}
// func TestSyncStoreSkus(t *testing.T) {
// hint, err := curPurchaseHandler.SyncStoreSkus(jxcontext.AdminCtx, nil, testShopID, nil, false, true)
// if err != nil {
// t.Fatal(err)
// }
// t.Log(hint)
// }
func TestDeleteRemoteSkus(t *testing.T) {
err := curPurchaseHandler.DeleteStoreAllSkus(jxcontext.AdminCtx, nil, testShopID, testShopVendorID, true)

View File

@@ -1,31 +1,25 @@
package wsc
import (
"testing"
// func TestSyncLocalStoreCategory(t *testing.T) {
// hint, err := new(PurchaseHandler).SyncLocalStoreCategory(jxcontext.AdminCtx, nil, 100077, false)
// if err != nil {
// t.Fatal(err)
// }
// t.Log(hint)
// }
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
)
// func TestSyncStoreCategory(t *testing.T) {
// hint, err := new(PurchaseHandler).SyncStoreCategory(jxcontext.AdminCtx, nil, 100077, false)
// if err != nil {
// t.Fatal(err)
// }
// t.Log(hint)
// }
func TestSyncLocalStoreCategory(t *testing.T) {
hint, err := new(PurchaseHandler).SyncLocalStoreCategory(jxcontext.AdminCtx, nil, 100077, false)
if err != nil {
t.Fatal(err)
}
t.Log(hint)
}
func TestSyncStoreCategory(t *testing.T) {
hint, err := new(PurchaseHandler).SyncStoreCategory(jxcontext.AdminCtx, nil, 100077, false)
if err != nil {
t.Fatal(err)
}
t.Log(hint)
}
func TestSyncStoreSkus(t *testing.T) {
hint, err := new(PurchaseHandler).SyncStoreSkus(jxcontext.AdminCtx, nil, 100077, nil, false, true)
if err != nil {
t.Fatal(err)
}
t.Log(hint)
}
// func TestSyncStoreSkus(t *testing.T) {
// hint, err := new(PurchaseHandler).SyncStoreSkus(jxcontext.AdminCtx, nil, 100077, nil, false, true)
// if err != nil {
// t.Fatal(err)
// }
// t.Log(hint)
// }