1
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
address_list_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/address_list/response"
|
||||
freightTemplate_create_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_create/request"
|
||||
shop_batchCreateStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/request"
|
||||
shop_batchCreateStore_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/response"
|
||||
shop_bindStoreFreight_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreFreight/request"
|
||||
shop_bindStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/request"
|
||||
shop_editStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_editStore/request"
|
||||
@@ -99,16 +98,15 @@ func splicingTimeToDoudian(openTime1, closeTime1, openTime2, closeTime2 int16) (
|
||||
}
|
||||
|
||||
// shop/batchCreateStore 批量创建门店
|
||||
func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (storeInfo *shop_batchCreateStore_response.Store, err error) {
|
||||
func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (vendorStoreID string, err error) {
|
||||
var (
|
||||
storeIDs string
|
||||
lists []shop_batchCreateStore_request.StoreListItem
|
||||
ShopBatchCreateStoreParam *shop_batchCreateStore_request.ShopBatchCreateStoreParam
|
||||
)
|
||||
timeStr := ""
|
||||
empty := &shop_batchCreateStore_response.Store{}
|
||||
if storeDetail.OpenTime1 == 0 || storeDetail.CloseTime1 == 0 {
|
||||
return empty, fmt.Errorf("营业时间必填")
|
||||
return "", fmt.Errorf("营业时间必填")
|
||||
} else {
|
||||
globals.SugarLogger.Debug("storeDetail.OpenTime1, storeDetail.CloseTime1======", storeDetail.OpenTime1, storeDetail.CloseTime1)
|
||||
timeStr = splicingTimeToDoudian(storeDetail.OpenTime1, storeDetail.CloseTime1, storeDetail.OpenTime2, storeDetail.CloseTime2)
|
||||
@@ -139,7 +137,7 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
||||
StoreList: lists,
|
||||
}
|
||||
if resp, err := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).BatchCreateStore(ShopBatchCreateStoreParam); err != nil {
|
||||
return empty, err
|
||||
return "", err
|
||||
} else {
|
||||
//if len(resp.ResultList) == 0 {
|
||||
// return "", errors.New("创建店铺失败")
|
||||
@@ -154,14 +152,16 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
||||
// return "", err
|
||||
// }
|
||||
//}
|
||||
ans := ""
|
||||
globals.SugarLogger.Debug("resp.ResultList========", resp.ResultList[0])
|
||||
for k, v := range resp.ResultList {
|
||||
if k != len(resp.ResultList) {
|
||||
storeIDs += utils.Int64ToStr(v.Store.StoreId) + ","
|
||||
}
|
||||
storeIDs += utils.Int64ToStr(v.Store.StoreId)
|
||||
storeIDs += utils.Int64ToStr(v.Store.StoreId) + v.Store.Name + v.Store.StoreCode
|
||||
//ans := resp.ResultList[0].Store
|
||||
}
|
||||
return resp.ResultList[0].Store, nil
|
||||
return storeIDs, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user