京东商城修改
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
package tempop
|
package tempop
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/api2"
|
"git.rosy.net.cn/jx-callback/globals/api2"
|
||||||
@@ -24,3 +27,18 @@ func TestJdStoreInfo1125(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Testaa(t *testing.T) {
|
||||||
|
request, _ := http.NewRequest(http.MethodGet, "https://stores.shop.jd.com/stores/updateStoreStatus?storeId=24332466&storeStatus=1", nil)
|
||||||
|
c := &http.Cookie{
|
||||||
|
Name: "thor",
|
||||||
|
Value: "80FAF09E9A09B6E618A68057BDFCFCB8C86E8252DC9F7D3B34572625904FBA0AB6BF053A5325612EC0407791BB05F5301356E71E8B282C40C06D0B5DF3439DEECB102A78FAFF7AC0FC4E2D1FA8DD8BBAE1A011E50B5C74F1870AD982D7BF453F470F31F2241B73AC4C25485025C2ABEBC8A538AF7257824D2FAEE300A1435175B0B451FB5C19B78D729FC83152CA3BAF",
|
||||||
|
}
|
||||||
|
request.AddCookie(c)
|
||||||
|
client := &http.Client{}
|
||||||
|
fmt.Println("test1", request.URL)
|
||||||
|
response, _ := client.Do(request)
|
||||||
|
defer response.Body.Close()
|
||||||
|
bodyData, _ := ioutil.ReadAll(response.Body)
|
||||||
|
fmt.Println("test1", string(bodyData))
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ package jdshop
|
|||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
||||||
@@ -19,9 +16,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID string) (storeDetail *dao.StoreDetail, err error) {
|
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID string) (storeDetail *dao.StoreDetail, err error) {
|
||||||
result, err := api.JdShopAPI.NewInfoList(utils.Str2Int64(vendorStoreID))
|
// result, err := api.JdShopAPI.NewInfoList(utils.Str2Int64(vendorStoreID))
|
||||||
storeDetail.VendorStoreID = vendorStoreID
|
// storeDetail.VendorStoreID = vendorStoreID
|
||||||
storeDetail.Status = JdsStatus2jxStatus(result.StoreStatus)
|
// storeDetail.Status = JdsStatus2jxStatus(result.StoreStatus)
|
||||||
result2, err := api.JdShopAPI.QueryEntityStore(utils.Str2Int64(vendorStoreID))
|
result2, err := api.JdShopAPI.QueryEntityStore(utils.Str2Int64(vendorStoreID))
|
||||||
storeDetail.ID = utils.Str2Int(result2.ExStoreID)
|
storeDetail.ID = utils.Str2Int(result2.ExStoreID)
|
||||||
storeDetail.Name = result2.StoreName
|
storeDetail.Name = result2.StoreName
|
||||||
@@ -59,23 +56,23 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
|||||||
CustomerID: utils.Int2Str(store.ID),
|
CustomerID: utils.Int2Str(store.ID),
|
||||||
}
|
}
|
||||||
err = api.JdShopAPI.UpdateEntityStore(updateEntityStoreParam)
|
err = api.JdShopAPI.UpdateEntityStore(updateEntityStoreParam)
|
||||||
if err == nil {
|
// if err == nil {
|
||||||
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {
|
// if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {
|
||||||
// mergeStatus := jxutils.MergeStoreStatus(store.Status, store.VendorStatus)
|
// // mergeStatus := jxutils.MergeStoreStatus(store.Status, store.VendorStatus)
|
||||||
request, _ := http.NewRequest(http.MethodGet, "https://stores.shop.jd.com/stores/updateStoreStatus?storeId=24332466&storeStatus=1", nil)
|
// request, _ := http.NewRequest(http.MethodGet, "https://stores.shop.jd.com/stores/updateStoreStatus?storeId=24332466&storeStatus=1", nil)
|
||||||
c := &http.Cookie{
|
// c := &http.Cookie{
|
||||||
Name: "thor",
|
// Name: "thor",
|
||||||
Value: "80FAF09E9A09B6E618A68057BDFCFCB8C86E8252DC9F7D3B34572625904FBA0AB6BF053A5325612EC0407791BB05F5301356E71E8B282C40C06D0B5DF3439DEECB102A78FAFF7AC0FC4E2D1FA8DD8BBAE1A011E50B5C74F1870AD982D7BF453F470F31F2241B73AC4C25485025C2ABEBC8A538AF7257824D2FAEE300A1435175B0B451FB5C19B78D729FC83152CA3BAF",
|
// Value: "80FAF09E9A09B6E618A68057BDFCFCB8C86E8252DC9F7D3B34572625904FBA0AB6BF053A5325612EC0407791BB05F5301356E71E8B282C40C06D0B5DF3439DEECB102A78FAFF7AC0FC4E2D1FA8DD8BBAE1A011E50B5C74F1870AD982D7BF453F470F31F2241B73AC4C25485025C2ABEBC8A538AF7257824D2FAEE300A1435175B0B451FB5C19B78D729FC83152CA3BAF",
|
||||||
}
|
// }
|
||||||
request.AddCookie(c)
|
// request.AddCookie(c)
|
||||||
client := &http.Client{}
|
// client := &http.Client{}
|
||||||
fmt.Println("test1", request.URL)
|
// fmt.Println("test1", request.URL)
|
||||||
response, _ := client.Do(request)
|
// response, _ := client.Do(request)
|
||||||
defer response.Body.Close()
|
// defer response.Body.Close()
|
||||||
bodyData, _ := ioutil.ReadAll(response.Body)
|
// bodyData, _ := ioutil.ReadAll(response.Body)
|
||||||
fmt.Println("test1", string(bodyData))
|
// fmt.Println("test1", string(bodyData))
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
|||||||
pic3, err2 := uploadImg2(v.DescImg, name, "desc")
|
pic3, err2 := uploadImg2(v.DescImg, name, "desc")
|
||||||
err = err2
|
err = err2
|
||||||
desc = `<p><img src="` + jdshopapi.JdsImgURL + pic3 + `" style="width: auto; height: auto; max-width: 100%;"><br></p><p><br></p>`
|
desc = `<p><img src="` + jdshopapi.JdsImgURL + pic3 + `" style="width: auto; height: auto; max-width: 100%;"><br></p><p><br></p>`
|
||||||
|
} else {
|
||||||
|
desc = `<p><br></p><p><br></p>`
|
||||||
}
|
}
|
||||||
updateWareParam.Introduction = desc
|
updateWareParam.Introduction = desc
|
||||||
updateWareParam.MobileDesc = desc
|
updateWareParam.MobileDesc = desc
|
||||||
@@ -524,7 +526,8 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j
|
|||||||
sku.StockNum = 0
|
sku.StockNum = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
createSkuParamWare.MarketPrice = jxutils.IntPrice2Standard(vendorPrice)
|
//市场价固定500
|
||||||
|
createSkuParamWare.MarketPrice = 500
|
||||||
return createSkuParamWare, createSkuParamSkus, err
|
return createSkuParamWare, createSkuParamSkus, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user