同步返回错误格式修改
This commit is contained in:
@@ -5,8 +5,6 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
|
||||||
@@ -245,62 +243,63 @@ func UnselectStoreSkuListByVendorSkuIDs(storeSkuList []*partner.StoreSkuInfo, ve
|
|||||||
|
|
||||||
func GetErrMsg2FailedSingleList(storeSkuList interface{}, err error, storeID, vendorID int, syncType string) (failedList []*partner.StoreSkuInfoWithErr) {
|
func GetErrMsg2FailedSingleList(storeSkuList interface{}, err error, storeID, vendorID int, syncType string) (failedList []*partner.StoreSkuInfoWithErr) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
var errMsg string
|
||||||
if errExt, ok := err.(*utils.ErrorWithCode); ok {
|
if errExt, ok := err.(*utils.ErrorWithCode); ok {
|
||||||
if storeSkuLists, ok := storeSkuList.([]*partner.StoreSkuInfo); ok {
|
errMsg = errExt.ErrMsg()
|
||||||
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
|
|
||||||
StoreSkuInfo: storeSkuLists[0],
|
|
||||||
ErrMsg: errExt.ErrMsg(),
|
|
||||||
StoreID: storeID,
|
|
||||||
VendoreID: vendorID,
|
|
||||||
SyncType: syncType,
|
|
||||||
}
|
|
||||||
failedList = append(failedList, storeSkuInfoWithErr)
|
|
||||||
} else if storeSkuLists, ok := storeSkuList.([]*dao.StoreSkuSyncInfo); ok {
|
|
||||||
storeSkuInfo := &partner.StoreSkuInfo{
|
|
||||||
SkuID: storeSkuLists[0].SkuID,
|
|
||||||
VendorSkuID: storeSkuLists[0].VendorSkuID,
|
|
||||||
NameID: storeSkuLists[0].NameID,
|
|
||||||
VendorNameID: storeSkuLists[0].VendorNameID,
|
|
||||||
VendorPrice: storeSkuLists[0].VendorPrice,
|
|
||||||
Status: storeSkuLists[0].Status,
|
|
||||||
}
|
|
||||||
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
|
|
||||||
StoreSkuInfo: storeSkuInfo,
|
|
||||||
ErrMsg: errExt.ErrMsg(),
|
|
||||||
StoreID: storeID,
|
|
||||||
VendoreID: vendorID,
|
|
||||||
SyncType: syncType,
|
|
||||||
}
|
|
||||||
failedList = append(failedList, storeSkuInfoWithErr)
|
|
||||||
} else if storeSku, ok := storeSkuList.(*dao.StoreSkuSyncInfo); ok {
|
|
||||||
storeSkuInfo := &partner.StoreSkuInfo{
|
|
||||||
SkuID: storeSku.SkuID,
|
|
||||||
VendorSkuID: storeSku.VendorSkuID,
|
|
||||||
NameID: storeSku.NameID,
|
|
||||||
VendorNameID: storeSku.VendorNameID,
|
|
||||||
VendorPrice: storeSku.VendorPrice,
|
|
||||||
Status: storeSku.Status,
|
|
||||||
}
|
|
||||||
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
|
|
||||||
StoreSkuInfo: storeSkuInfo,
|
|
||||||
ErrMsg: errExt.ErrMsg(),
|
|
||||||
StoreID: storeID,
|
|
||||||
VendoreID: vendorID,
|
|
||||||
SyncType: syncType,
|
|
||||||
}
|
|
||||||
failedList = append(failedList, storeSkuInfoWithErr)
|
|
||||||
} else {
|
|
||||||
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
|
|
||||||
ErrMsg: errExt.ErrMsg(),
|
|
||||||
StoreID: storeID,
|
|
||||||
VendoreID: vendorID,
|
|
||||||
SyncType: syncType,
|
|
||||||
}
|
|
||||||
failedList = append(failedList, storeSkuInfoWithErr)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
globals.SugarLogger.Errorf("GetErrMsg2FailedSingleList:%v", err)
|
errMsg = err.Error()
|
||||||
// globals.SugarLogger.Debugf("GetErrMsg2FailedSingleList:%v", err)
|
}
|
||||||
|
if storeSkuLists, ok := storeSkuList.([]*partner.StoreSkuInfo); ok {
|
||||||
|
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
|
||||||
|
StoreSkuInfo: storeSkuLists[0],
|
||||||
|
ErrMsg: errMsg,
|
||||||
|
StoreID: storeID,
|
||||||
|
VendoreID: vendorID,
|
||||||
|
SyncType: syncType,
|
||||||
|
}
|
||||||
|
failedList = append(failedList, storeSkuInfoWithErr)
|
||||||
|
} else if storeSkuLists, ok := storeSkuList.([]*dao.StoreSkuSyncInfo); ok {
|
||||||
|
storeSkuInfo := &partner.StoreSkuInfo{
|
||||||
|
SkuID: storeSkuLists[0].SkuID,
|
||||||
|
VendorSkuID: storeSkuLists[0].VendorSkuID,
|
||||||
|
NameID: storeSkuLists[0].NameID,
|
||||||
|
VendorNameID: storeSkuLists[0].VendorNameID,
|
||||||
|
VendorPrice: storeSkuLists[0].VendorPrice,
|
||||||
|
Status: storeSkuLists[0].Status,
|
||||||
|
}
|
||||||
|
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
|
||||||
|
StoreSkuInfo: storeSkuInfo,
|
||||||
|
ErrMsg: errMsg,
|
||||||
|
StoreID: storeID,
|
||||||
|
VendoreID: vendorID,
|
||||||
|
SyncType: syncType,
|
||||||
|
}
|
||||||
|
failedList = append(failedList, storeSkuInfoWithErr)
|
||||||
|
} else if storeSku, ok := storeSkuList.(*dao.StoreSkuSyncInfo); ok {
|
||||||
|
storeSkuInfo := &partner.StoreSkuInfo{
|
||||||
|
SkuID: storeSku.SkuID,
|
||||||
|
VendorSkuID: storeSku.VendorSkuID,
|
||||||
|
NameID: storeSku.NameID,
|
||||||
|
VendorNameID: storeSku.VendorNameID,
|
||||||
|
VendorPrice: storeSku.VendorPrice,
|
||||||
|
Status: storeSku.Status,
|
||||||
|
}
|
||||||
|
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
|
||||||
|
StoreSkuInfo: storeSkuInfo,
|
||||||
|
ErrMsg: errMsg,
|
||||||
|
StoreID: storeID,
|
||||||
|
VendoreID: vendorID,
|
||||||
|
SyncType: syncType,
|
||||||
|
}
|
||||||
|
failedList = append(failedList, storeSkuInfoWithErr)
|
||||||
|
} else {
|
||||||
|
storeSkuInfoWithErr := &partner.StoreSkuInfoWithErr{
|
||||||
|
ErrMsg: errMsg,
|
||||||
|
StoreID: storeID,
|
||||||
|
VendoreID: vendorID,
|
||||||
|
SyncType: syncType,
|
||||||
|
}
|
||||||
|
failedList = append(failedList, storeSkuInfoWithErr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return failedList
|
return failedList
|
||||||
|
|||||||
Reference in New Issue
Block a user